mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 17:26:03 +03:00
[GH-ISSUE #2999] [bug]: Docker Compose Backend container always restarting #973
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#973
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cristianorevil on GitHub (Apr 18, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2999
Originally assigned to: @balub, @anwarulislam on GitHub.
Is there an existing issue for this?
Current behavior
I have cloned the repository, copied the .env.example file to .env and changed with custom settings
Running docker compose up -ad the backend container is build but continous restarting with following error:
hoppscotch-backend | node:internal/modules/cjs/loader:958
hoppscotch-backend | throw err;
hoppscotch-backend | ^
hoppscotch-backend |
hoppscotch-backend | Error: Cannot find module '/usr/src/app/dist/main'
hoppscotch-backend | at Module._resolveFilename (node:internal/modules/cjs/loader:955:15)
hoppscotch-backend | at Module._load (node:internal/modules/cjs/loader:803:27)
hoppscotch-backend | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
hoppscotch-backend | at node:internal/main/run_main_module:18:47 {
hoppscotch-backend | code: 'MODULE_NOT_FOUND',
hoppscotch-backend | requireStack: []
hoppscotch-backend | }
Steps to reproduce
Clone repository
Copy .env.example to .env
Execute docker compose up -d
Environment
Production
Version
Self-hosted
@balub commented on GitHub (Apr 18, 2023):
Hey @cristianorevil , before running the
docker compose up -dcan you runpnpm i.@beerkeeper commented on GitHub (May 8, 2023):
Hi, I'm trying to play around with the docker containers as well via the docker-compose command.
I can replicate @cristianorevil 's problem. The backend container restarts for the same reason MODULE_NOT_FOUND.
I'm on Ubuntu 23.04, node v18.13.0, pnpm v8.4.0
@balub when I run
pnpm iin the project directory, I get the following output:I'm not familiar with pnpm in general, so I might have something wrongfully set up to work with pnpm (tried both via the pnpm install script and the package from npm installed globally).
The build itself goes fine during
docker compose build --nocache hoppscotch-backendHope it helps. If you need more information, please let me know!
@balub commented on GitHub (May 9, 2023):
@beerkeeper It seems that EACCES permissions errors have something to do with system permissions may I suggest you run the
pnpm iwithsudoas insudo pnpm iand try again. You can refer to these post and this from npm while we look into it.@beerkeeper commented on GitHub (May 9, 2023):
I can confirm that this does work! Just for anyone else that runs into this issue: You also need to install pnpm globally as the root user. I don't think it is best practice, but you mentioned that it is being looked into 👍🏻
The steps (execute within the root of the project):
sudo npm i -g pnpmsudo pnpm idocker compose up-> I didn't need to rebuild the backend image afterwards@Number16BusShelter commented on GitHub (May 11, 2023):
it seems like using sudo is not a good practice.
And why is it required to do install if this step is done on docker build?
@jackiewu commented on GitHub (May 16, 2023):
my solution is comment the following line at docker-compose.yml, hope this can help you

github.com/hoppscotch/hoppscotch@d6c8400116/docker-compose.yml (L22)@zucchiniEvader commented on GitHub (May 16, 2023):
When I execute
sudo pnpm i, I encounter the following error.Do you know about this issue?@webysther commented on GitHub (May 29, 2023):
#3092
#3093
@forresthopkinsa commented on GitHub (Jul 10, 2023):
Unfortunately, running pnpm as root is not an acceptable solution in most environments. Can we figure out why it's trying to write to
../../../? This is very weird behavior that seems specific to HoppscotchEdit: The EACCES isn't happening because of the
../../../, it's happening because of the target.hoppscotch/packages/hoppscotch-backend/node_moduleswas owned by root for some reason – maybe docker-compose did this? Not sure.chownfixed the problem.@AndrewBastin commented on GitHub (Sep 6, 2023):
Closing this issue due to inactivity. Please do check if the 2023.8.0 release has this issue still and reopen if so.