[GH-ISSUE #94] scripts missing src directory while inside docker #46

Closed
opened 2026-02-27 15:54:47 +03:00 by kerem · 3 comments
Owner

Originally created by @travismolick on GitHub (Sep 11, 2025).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/94

When attempting to run a script from scripts inside docker, its attempting to call back a directory into the src but that folder was not copied into the container?

/app $ bun scripts/startup-recovery.ts
error: Cannot find module '../src/lib/recovery' from '/app/scripts/startup-recovery.ts'

Bun v1.2.21 (Linux x64 baseline)
/app $ ls -lhsa
total 68K    
   4.0K drwxr-xr-x    1 root     root        4.0K Sep 10 04:20 .
   4.0K drwxr-xr-x    1 root     root        4.0K Sep 11 06:49 ..
   4.0K drwxr-xr-x    2 gitea-mi nodejs      4.0K Sep 10 04:20 certs
   4.0K drwxr-xr-x    2 bun      bun         4.0K Sep 11 07:49 data
   4.0K drwxr-xr-x    5 root     root        4.0K Sep 10 04:20 dist
  16.0K -rwxr-xr-x    1 root     root       13.5K Sep 10 04:19 docker-entrypoint.sh
   4.0K drwxr-xr-x    3 root     root        4.0K Sep 10 04:19 drizzle
  20.0K drwxr-xr-x  602 root     root       20.0K Sep 10 04:19 node_modules
   4.0K -rw-r--r--    1 root     root        4.0K Sep 10 04:19 package.json
   4.0K drwxr-xr-x    2 root     root        4.0K Sep 10 04:19 scripts
/app $
Originally created by @travismolick on GitHub (Sep 11, 2025). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/94 When attempting to run a script from scripts inside docker, its attempting to call back a directory into the src but that folder was not copied into the container? ``` /app $ bun scripts/startup-recovery.ts error: Cannot find module '../src/lib/recovery' from '/app/scripts/startup-recovery.ts' Bun v1.2.21 (Linux x64 baseline) ``` ``` /app $ ls -lhsa total 68K 4.0K drwxr-xr-x 1 root root 4.0K Sep 10 04:20 . 4.0K drwxr-xr-x 1 root root 4.0K Sep 11 06:49 .. 4.0K drwxr-xr-x 2 gitea-mi nodejs 4.0K Sep 10 04:20 certs 4.0K drwxr-xr-x 2 bun bun 4.0K Sep 11 07:49 data 4.0K drwxr-xr-x 5 root root 4.0K Sep 10 04:20 dist 16.0K -rwxr-xr-x 1 root root 13.5K Sep 10 04:19 docker-entrypoint.sh 4.0K drwxr-xr-x 3 root root 4.0K Sep 10 04:19 drizzle 20.0K drwxr-xr-x 602 root root 20.0K Sep 10 04:19 node_modules 4.0K -rw-r--r-- 1 root root 4.0K Sep 10 04:19 package.json 4.0K drwxr-xr-x 2 root root 4.0K Sep 10 04:19 scripts /app $ ```
kerem 2026-02-27 15:54:47 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@arunavo4 commented on GitHub (Sep 11, 2025):

@travismolick the scripts in the scripts dir are for development purposes. Not sure why are you trying to run these scripts seperately, the docker-entrypoint.sh file handles all these automatically. But if you still want to run the script manually for some reason. run the compiled version at dist/scripts/startup-recovery.js. I will remove the scripts dir from the docker image in future builds to prevent this confusion.

<!-- gh-comment-id:3282335964 --> @arunavo4 commented on GitHub (Sep 11, 2025): @travismolick the scripts in the scripts dir are for development purposes. Not sure why are you trying to run these scripts seperately, the `docker-entrypoint.sh` file handles all these automatically. But if you still want to run the script manually for some reason. run the compiled version at `dist/scripts/startup-recovery.js`. I will remove the scripts dir from the docker image in future builds to prevent this confusion.
Author
Owner

@travismolick commented on GitHub (Sep 11, 2025):

I am following the guide to repair interrupted jobs In the documentation as the server gitea mirror had to reboot, this causing a few mirroring jobs to freeze / hang at a status that they are mirroring but gitea is showing that nothing is happening.

It has been hanged for a few days with the same mirror message and the activity log shows it's doing something but nothing seems to show happening on gitea side and I do not see a option to cancel a mirror operation from the GUI.

Am I not supposed to use the commands provided in the guide to try and fix interrupted jobs in docker then?

<!-- gh-comment-id:3282348709 --> @travismolick commented on GitHub (Sep 11, 2025): I am following the guide to repair interrupted jobs In the documentation as the server gitea mirror had to reboot, this causing a few mirroring jobs to freeze / hang at a status that they are mirroring but gitea is showing that nothing is happening. It has been hanged for a few days with the same mirror message and the activity log shows it's doing something but nothing seems to show happening on gitea side and I do not see a option to cancel a mirror operation from the GUI. Am I not supposed to use the commands provided in the guide to try and fix interrupted jobs in docker then?
Author
Owner

@arunavo4 commented on GitHub (Sep 11, 2025):

Can you post the Logs plus some screenshots. The spripts have been now integrated to automatically detect inturupted jobs from an earlier session whenever the container restarts. If it says no inturupted jobs then either the data is corrupted that it cannot recover so then it would be best to delete and start over. But before that just try restarting the container

<!-- gh-comment-id:3282465474 --> @arunavo4 commented on GitHub (Sep 11, 2025): Can you post the Logs plus some screenshots. The spripts have been now integrated to automatically detect inturupted jobs from an earlier session whenever the container restarts. If it says no inturupted jobs then either the data is corrupted that it cannot recover so then it would be best to delete and start over. But before that just try restarting the container
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#46
No description provided.