Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceeded #136

Closed
robsannaa opened this issue Oct 24, 2020 · 10 comments
Closed

Maximum call stack size exceeded #136

robsannaa opened this issue Oct 24, 2020 · 10 comments

Comments

@robsannaa
Copy link

robsannaa commented Oct 24, 2020

I am trying to execute the command chmod +x scripts/build.sh ./scripts/build.sh, using the default configuration, however, I am always getting this error:

npm notice 
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g npm@7.0.5` to update!
npm notice 
npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-24T13_56_07_518Z-debug.log
ERROR: Service 'frontend' failed to build : The command '/bin/sh -c npm rebuild' returned a non-zero code: 1
Starting fastapi-react-project_postgres_1 ... 
Starting fastapi-react-project_postgres_1 ... error

ERROR: for fastapi-react-project_postgres_1  Cannot start service postgres: driver failed programming external connectivity on endpoint fastapi-react-project_postgres_1 (64ddcd8b9c18461c2873dfbb73f31a713928de7744232e764ec2fe7ed78b2dd1): Bind for 0.0.0.0:5432 failed: port is already allocated

ERROR: for postgres  Cannot start service postgres: driver failed programming external connectivity on endpoint fastapi-react-project_postgres_1 (64ddcd8b9c18461c2873dfbb73f31a713928de7744232e764ec2fe7ed78b2dd1): Bind for 0.0.0.0:5432 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.
Starting fastapi-react-project_postgres_1 ... 
Starting fastapi-react-project_postgres_1 ... error

ERROR: for fastapi-react-project_postgres_1  Cannot start service postgres: driver failed programming external connectivity on endpoint fastapi-react-project_postgres_1 (31ccd7b0ce884e6658231ae13ef1be29c5c34888676df38322930a3cdbcb67ed): Bind for 0.0.0.0:5432 failed: port is already allocated

ERROR: for postgres  Cannot start service postgres: driver failed programming external connectivity on endpoint fastapi-react-project_postgres_1 (31ccd7b0ce884e6658231ae13ef1be29c5c34888676df38322930a3cdbcb67ed): Bind for 0.0.0.0:5432 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Configuration:

  • Docker version 19.03.13, build 4484c46d9d
  • Mac Os Catalina
  • NPM 7.0.3
  • Node v15.0.1

I have found this question, however, I have tried every possible solution without success.

What can be the reason I am getting this?

@JasonHoku
Copy link
Contributor

Your error states the reason right here:

ERROR: for fastapi-react-project_postgres_1 Cannot start service postgres: driver failed programming external connectivity on endpoint fastapi-react-project_postgres_1 (31ccd7b0ce884e6658231ae13ef1be29c5c34888676df38322930a3cdbcb67ed): Bind for 0.0.0.0:5432 failed: port is already allocated

port 5432 cannot open, perhaps another service is running on that port or a firewall is blocking its access?

@robsannaa
Copy link
Author

Thanks @JasonHoku, however, this error is generated further. I have stopped all containers and tried from scratch. I can actually connect to postgre using a SQL IDE, but the error I get is originated in the frontend, not in the backend services:

❯ chmod +x scripts/build.sh
./scripts/build.sh
Building frontend
Step 1/11 : FROM node:latest
 ---> ca36fba5ad66
Step 2/11 : ADD package.json /package.json
 ---> Using cache
 ---> 0ad31658dcc7
Step 3/11 : ENV NODE_PATH=/node_modules
 ---> Using cache
 ---> 896cfd31e188
Step 4/11 : ENV PATH=$PATH:/node_modules/.bin
 ---> Using cache
 ---> 1550e86f7f79
Step 5/11 : RUN npm install
 ---> Running in 97d46fc9c1d2
npm notice 
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g npm@7.0.5` to update!
npm notice 
npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-25T08_57_52_370Z-debug.log
ERROR: Service 'frontend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1
Creating dandalo-insta-wordcloud_backend_run ... done
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Creating dandalo-insta-wordcloud_backend_run ... done
Creating superuser admin@dandalo-insta-wordcloud.com
Superuser created

then:

❯ docker-compose up -d
Building frontend
Step 1/11 : FROM node:latest
 ---> ca36fba5ad66
Step 2/11 : ADD package.json /package.json
 ---> Using cache
 ---> 0ad31658dcc7
Step 3/11 : ENV NODE_PATH=/node_modules
 ---> Using cache
 ---> 896cfd31e188
Step 4/11 : ENV PATH=$PATH:/node_modules/.bin
 ---> Using cache
 ---> 1550e86f7f79
Step 5/11 : RUN npm install
 ---> Running in 70f26ead488d
npm notice 
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g npm@7.0.5` to update!
npm notice 
npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-25T08_59_13_818Z-debug.log
ERROR: Service 'frontend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1

@pigeonflight
Copy link

I can confirm that I'm getting the same issue:

Step 5/12 : RUN npm install -g npm@7.0.5
 ---> Running in 9501a907a35c
npm notice 
npm notice New patch version of npm available! 7.0.3 -> 7.0.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.5>
npm notice Run `npm install -g npm@7.0.5` to update!
npm notice 
npm ERR! code EXDEV
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -18
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-25T17_36_33_620Z-debug.log

@robsannaa
Copy link
Author

Hi @pigeonflight, I have also got the same error when trying to update npm with the suggested command npm install -g npm@7.0.5

@pigeonflight
Copy link

pigeonflight commented Oct 25, 2020

@robertosannazzaro
I found a solution that works for me:

Edit frontend/Dockerfile
and change the image from node:latest to node:14.
I think the issue is being caused by a newer version of the node image.

@pigeonflight
Copy link

pigeonflight commented Oct 25, 2020

@Buuntu I recommend that the node image for frontend/Dockerfile be pinned to node:14 for now.
Unless, of course, you have a better solution.

@robsannaa
Copy link
Author

@pigeonflight thanks, I have managed to run it!
However, maybe something better can be done: using node:14 leads to a lot of warnings:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"14.14.0","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN connected-react-router@6.8.0 requires a peer of immutable@^3.8.1 || ^4.0.0-rc.1 but none is installed. You must install peer dependencies yourself.
npm WARN connected-react-router@6.8.0 requires a peer of seamless-immutable@^7.1.3 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@18.2.0 requires a peer of eslint-plugin-import@^2.21.2 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@18.2.0 requires a peer of eslint-plugin-jsx-a11y@^6.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb@18.2.0 requires a peer of eslint-plugin-react@^7.20.0 but none is installed. You must install peer dependencies yourself.
npm WARN @testing-library/user-event@12.1.10 requires a peer of @testing-library/dom@>=7.21.4 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@14.2.0 requires a peer of eslint-plugin-import@^2.21.2 but none is installed. You must install peer dependencies yourself.

I'm not an expert with npm and node, but I'm trying to give my two cents.

@pigeonflight
Copy link

pigeonflight commented Oct 25, 2020

@robertosannazzaro just some "drive-by" debugging. Still on the learning curve myself.
My intuition is that this should be pinned as closely as possible to the most recent LTS release which is 12.19.0 at the moment.
So maybe node:12 in the Dockerfile.

@Buuntu
Copy link
Owner

Buuntu commented Oct 27, 2020

@robertosannazzaro just some "drive-by" debugging. Still on the learning curve myself.
My intuition is that this should be pinned as closely as possible to the most recent LTS release which is 12.19.0 at the moment.
So maybe node:12 in the Dockerfile.

I would accept a PR for this @pigeonflight

RobbertH added a commit to RobbertH/fastapi-react that referenced this issue Nov 1, 2020
Buuntu pushed a commit that referenced this issue Nov 2, 2020
@Buuntu Buuntu closed this as completed Nov 2, 2020
@Buuntu
Copy link
Owner

Buuntu commented Nov 2, 2020

Fixed in #149

bowingman added a commit to bowingman/fastapi-react that referenced this issue Sep 25, 2022
fun-loving-otter added a commit to fun-loving-otter/fun-fastapi that referenced this issue Jul 17, 2023
coolkei added a commit to coolkei/fast_api_react that referenced this issue Feb 4, 2024
greatuber added a commit to greatuber/FastAPI that referenced this issue Apr 5, 2024
sabugaa0128 added a commit to sabugaa0128/FastAPI that referenced this issue Apr 5, 2024
HecateAkke added a commit to HecateAkke/fastapi that referenced this issue Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants