https://cerbos.dev logo
Title
i

Ivano

12/19/2022, 11:57 AM
=> [build 5/6] COPY client/ .                                                                                     0.0s
 => ERROR [build 6/6] RUN npm run build                                                                            2.1s
------
 > [build 6/6] RUN npm run build:
#0 0.629
#0 0.629 > build
#0 0.629 > sh build_monaco_workers.sh && parcel build
#0 0.629
: not foundild_monaco_workers.sh: 3:
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
------
failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1
PS C:\Temp\demo-admin-api>
s

Sam Lock (Cerbos)

12/19/2022, 12:35 PM
I’ll have a little dig around and get back to you Ivano!
That log output is a little confusing, I’m not sure what the
not found
error is referring to, but the 5 log-level errors suggest it’s at least found
build_monaco_workers.sh
to run the
parcel build
commands 🤔
Out of curiosity, what happens if you change that script to have the following:
ROOT=$PWD/node_modules/monaco-editor/esm/vs

npx parcel build $ROOT/language/json/json.worker.js --no-source-maps --log-level info
npx parcel build $ROOT/language/css/css.worker.js --no-source-maps --log-level info
npx parcel build $ROOT/language/html/html.worker.js --no-source-maps --log-level info
npx parcel build $ROOT/language/typescript/ts.worker.js --no-source-maps --log-level info
npx parcel build $ROOT/editor/editor.worker.js --no-source-maps --log-level info
i

Ivano

12/19/2022, 1:10 PM
Same result more or less:
=> ERROR [build 6/6] RUN npm run build                                                                            2.7s
------
 > [build 6/6] RUN npm run build:
#0 0.605
#0 0.605 > build
#0 0.605 > sh build_monaco_workers.sh && parcel build
#0 0.605
: not foundild_monaco_workers.sh: 2:
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
' is invalid. Allowed choices are none, error, warn, info, verbose.
#0 2.483 🚨 Build failed.
#0 2.486
/editor/editor.worker.js app/node_modules/monaco-editor/esm/vs
#0 2.487 does not exist
------
failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1
Just some notes about the environment, but I don't think is relevant because all happen inside the container. My OS is windows 10
s

Sam Lock (Cerbos)

12/19/2022, 1:18 PM
Yeah, I went through the same thought process with that one! I wondered if it was related to a loose base image but I tried a few more specific versions and they all worked fine
That final log output suggests some files or directories don’t exist
Just setting up a windows vm so I can try to reproduce locally!
Having a real fight setting up windows virtualisation on my m2 mac, currently losing, but will continue with my efforts. In the meantime, you could attempt to set up via the alternative method - would this be sufficient for the time being?
i

Ivano

12/20/2022, 8:14 AM
Thank you Sam. I'm not used to use Linux or Mac. I've tried manully but not lucky. No commands work
Cerbos:
ivanolx@N00057:/mnt/c/temp/demo-admin-api/cerbos$ ./start.sh
docker: invalid reference format.
See 'docker run --help'.
./start.sh: line 2: -v: command not found
./start.sh: line 3: -v: command not found
./start.sh: line 4: <http://ghcr.io/cerbos/cerbos:latest|ghcr.io/cerbos/cerbos:latest>: No such file or directory
./start.sh: line 5: server: command not found
: No such file or directoryg=/config/conf.yaml
ivanolx@N00057:/mnt/c/temp/demo-admin-api/cerbos$
But this is not a problem. I can run an instace of Cerbos in docker.
PS C:\Temp\demo-admin-api> go run main.go
# <http://github.com/cerbos/cerbos/internal/observability/logging|github.com/cerbos/cerbos/internal/observability/logging>
C:\Users\ivanom\go\pkg\mod\<http://github.com|github.com>\cerbos\cerbos@v0.22.0\internal\observability\logging\logging.go:117:33: undefined: syscall.SIGUSR1
PS C:\Temp\demo-admin-api>
And errors also for the client on build_monaco_workers.sh
s

Sam Lock (Cerbos)

12/20/2022, 9:33 AM
A colleague has just identified an issue which causes the
syscall.SIGUSR1
error, so we can look into! The
build_monaco_workers.sh
script - I wonder if this is a windows compatibility thing. What shell are you running? Do you have access to bash/sh?
E.g. perhaps file locations will be
\
rather than
/
in the various scripts (I could be clutching at straws here). Or things like
$(pwd)
, etc
Final question, are you using Docker for Windows with the WSL2 backend?
i

Ivano

12/20/2022, 9:43 AM
I've tried with powershell, bash, and ubuntu with all combinations of slash . WSL2 is enabled
s

Sam Lock (Cerbos)

12/20/2022, 9:53 AM
Ok, odd. I’ll circle back round to the original docker compose config to see if we can work around the monaco script requirement. It’s an annoying hack that was required to get the editor to work with parcel. Will get back to you 👍
@Ivano, I’ve created a separate branch with some changes that might bypass your issues via the original `docker-compose up`: https://github.com/cerbos/demo-admin-api/tree/fix/remove-monaco-worker-build-script
It bypasses the
sh
script entirely, so if it solves your case I’ll probably raise for PR!
i

Ivano

12/20/2022, 1:19 PM
O yess... It works like a charm !. Thank you very much @Sam Lock (Cerbos)
s

Sam Lock (Cerbos)

12/20/2022, 1:27 PM
Yay! Thanks for persevering 🙌