[Bug]: dev set up with docker compose fails (mac os, python 3.12, node v18) #546

Closed
opened 2026-02-04 20:18:48 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @jaycoolslm on GitHub (Jul 15, 2024).

Where is the problem occurring?

I'm not sure

What browsers are you seeing the problem on?

Other

Current behaviour

I am using a M2 macbook pro and running docker compose -f docker-compose-dev.yml up -d on my machine. Am then met with this error. Looks like something to do with

node-sass
distutils

26.59 .../node_modules/node-sass postinstall: Traceback (most recent call last):
26.59 .../node_modules/node-sass postinstall:   File "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
26.59 .../node_modules/node-sass postinstall:     import gyp  # noqa: E402
26.59 .../node_modules/node-sass postinstall:     ^^^^^^^^^^
26.59 .../node_modules/node-sass postinstall:   File "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
26.59 .../node_modules/node-sass postinstall:     import gyp.input
26.59 .../node_modules/node-sass postinstall:   File "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
26.59 .../node_modules/node-sass postinstall:     from distutils.version import StrictVersion
26.59 .../node_modules/node-sass postinstall: ModuleNotFoundError: No module named 'distutils'
26.59 .../node_modules/node-sass postinstall: gyp ERR! configure error
26.59 .../node_modules/node-sass postinstall: gyp ERR! stack Error: `gyp` failed with exit code: 1
26.59 .../node_modules/node-sass postinstall: gyp ERR! stack     at ChildProcess.onCpExit (/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/configure.js:259:16)
26.59 .../node_modules/node-sass postinstall: gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
26.59 .../node_modules/node-sass postinstall: gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
26.59 .../node_modules/node-sass postinstall: gyp ERR! System Linux 6.6.31-linuxkit
26.59 .../node_modules/node-sass postinstall: gyp ERR! command "/usr/local/bin/node" "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
26.59 .../node_modules/node-sass postinstall: gyp ERR! cwd /app/client/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass
26.59 .../node_modules/node-sass postinstall: gyp ERR! node -v v18.20.4
26.59 .../node_modules/node-sass postinstall: gyp ERR! node-gyp -v v8.4.1
26.59 .../node_modules/node-sass postinstall: gyp ERR! not ok
26.59 .../node_modules/node-sass postinstall: Build failed with error code: 1
26.60 .../node_modules/node-sass postinstall: Failed
26.60  ELIFECYCLE  Command failed with exit code 1.
------
failed to solve: process "/bin/sh -c npm install npm@latest --global   && npm install pnpm --global   && pnpm import   && pnpm install" did not complete successfully: exit code: 1

looks like same error as here https://github.com/plankanban/planka/issues/818

Desired behaviour

In this situation I expect that the the docker containers spin up first time

Steps to reproduce

cloned repo, docker compose -f docker-compose-dev.yml up -d

Other information

No response

Originally created by @jaycoolslm on GitHub (Jul 15, 2024). ### Where is the problem occurring? I'm not sure ### What browsers are you seeing the problem on? Other ### Current behaviour I am using a M2 macbook pro and running `docker compose -f docker-compose-dev.yml up -d` on my machine. Am then met with this error. Looks like something to do with `node-sass` `distutils` ``` 26.59 .../node_modules/node-sass postinstall: Traceback (most recent call last): 26.59 .../node_modules/node-sass postinstall: File "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module> 26.59 .../node_modules/node-sass postinstall: import gyp # noqa: E402 26.59 .../node_modules/node-sass postinstall: ^^^^^^^^^^ 26.59 .../node_modules/node-sass postinstall: File "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module> 26.59 .../node_modules/node-sass postinstall: import gyp.input 26.59 .../node_modules/node-sass postinstall: File "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module> 26.59 .../node_modules/node-sass postinstall: from distutils.version import StrictVersion 26.59 .../node_modules/node-sass postinstall: ModuleNotFoundError: No module named 'distutils' 26.59 .../node_modules/node-sass postinstall: gyp ERR! configure error 26.59 .../node_modules/node-sass postinstall: gyp ERR! stack Error: `gyp` failed with exit code: 1 26.59 .../node_modules/node-sass postinstall: gyp ERR! stack at ChildProcess.onCpExit (/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/lib/configure.js:259:16) 26.59 .../node_modules/node-sass postinstall: gyp ERR! stack at ChildProcess.emit (node:events:517:28) 26.59 .../node_modules/node-sass postinstall: gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12) 26.59 .../node_modules/node-sass postinstall: gyp ERR! System Linux 6.6.31-linuxkit 26.59 .../node_modules/node-sass postinstall: gyp ERR! command "/usr/local/bin/node" "/app/client/node_modules/.pnpm/node-gyp@8.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" 26.59 .../node_modules/node-sass postinstall: gyp ERR! cwd /app/client/node_modules/.pnpm/node-sass@9.0.0/node_modules/node-sass 26.59 .../node_modules/node-sass postinstall: gyp ERR! node -v v18.20.4 26.59 .../node_modules/node-sass postinstall: gyp ERR! node-gyp -v v8.4.1 26.59 .../node_modules/node-sass postinstall: gyp ERR! not ok 26.59 .../node_modules/node-sass postinstall: Build failed with error code: 1 26.60 .../node_modules/node-sass postinstall: Failed 26.60  ELIFECYCLE  Command failed with exit code 1. ------ failed to solve: process "/bin/sh -c npm install npm@latest --global && npm install pnpm --global && pnpm import && pnpm install" did not complete successfully: exit code: 1 ``` looks like same error as here https://github.com/plankanban/planka/issues/818 ### Desired behaviour In this situation I expect that the the docker containers spin up first time ### Steps to reproduce cloned repo, `docker compose -f docker-compose-dev.yml up -d` ### Other information _No response_
Author
Owner

@meltyshev commented on GitHub (Jul 15, 2024):

Hi! Thanks for reporting this. I used to run into the same problem all the time before. We'll try to test the dev version when we get some time.

@meltyshev commented on GitHub (Jul 15, 2024): Hi! Thanks for reporting this. I used to run into the same problem all the time before. We'll try to test the dev version when we get some time.
Author
Owner

@lebaudantoine commented on GitHub (Jul 15, 2024):

Adding platform: linux/amd64 made it work on my side.
I have added it on every service.
ex:

services:
  server:
    platform: linux/amd64
    build:
      context: ./server
      dockerfile: ../config/development/Dockerfile.server
      ....

I am on MacOS v13, and use https://orbstack.dev/ to run my docker set-up.

@lebaudantoine commented on GitHub (Jul 15, 2024): Adding `platform: linux/amd64` made it work on my side. I have added it on every service. ex: ``` services: server: platform: linux/amd64 build: context: ./server dockerfile: ../config/development/Dockerfile.server .... ``` I am on MacOS v13, and use https://orbstack.dev/ to run my docker set-up.
Author
Owner

@jaycoolslm commented on GitHub (Jul 16, 2024):

Thanks @lebaudantoine will try this out... but off experience I imagine this is the fix... usually is when running docker on ARM chips XD so much for containerisation being operable on all OS haha

@jaycoolslm commented on GitHub (Jul 16, 2024): Thanks @lebaudantoine will try this out... but off experience I imagine this is the fix... usually is when running docker on ARM chips XD so much for containerisation being operable on all OS haha
Author
Owner

@jaycoolslm commented on GitHub (Jul 25, 2024):

Yup this worked (ish)... its actually only needed for the client container though. Server container is okay - client container has deps on node-sass

@jaycoolslm commented on GitHub (Jul 25, 2024): Yup this worked (ish)... its actually only needed for the client container though. Server container is okay - client container has deps on node-sass
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#546