Closed mitchross closed 1 year ago
If you're running on macOS you need to comment out the dev/dri and dev/usb lines for the device and volume mounts.
If you're running an m1 you also need to comment out the ov-converter in Dockerfile
Even when I comment out the usb line in docker compose, the VS code dev container fails to load.
NOTE - This is a issue with the vscode dev container
[2023-01-08T17:26:49.073Z] Dev Containers 0.266.1 in VS Code 1.74.2 (e8a3071ea4344d9d48ef8a4df2c097372b0c5161).
[2023-01-08T17:26:49.072Z] Start: Resolving Remote
[2023-01-08T17:26:49.144Z] Setting up container for folder or workspace: /Users/mitchross/Documents/Programming/frigate
[2023-01-08T17:26:49.153Z] Start: Check Docker is running
[2023-01-08T17:26:49.156Z] Start: Run: docker version --format {{.Server.APIVersion}}
[2023-01-08T17:26:49.408Z] Stop (252 ms): Run: docker version --format {{.Server.APIVersion}}
[2023-01-08T17:26:49.409Z] Server API version: 1.41
[2023-01-08T17:26:49.409Z] Stop (256 ms): Check Docker is running
[2023-01-08T17:26:49.410Z] Start: Run: docker volume ls -q
[2023-01-08T17:26:49.605Z] Stop (195 ms): Run: docker volume ls -q
[2023-01-08T17:26:49.622Z] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/Users/mitchross/Documents/Programming/frigate --filter label=vsch.quality=stable
[2023-01-08T17:26:49.746Z] Stop (124 ms): Run: docker ps -q -a --filter label=vsch.local.folder=/Users/mitchross/Documents/Programming/frigate --filter label=vsch.quality=stable
[2023-01-08T17:26:49.747Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/mitchross/Documents/Programming/frigate
[2023-01-08T17:26:49.860Z] Stop (113 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/Users/mitchross/Documents/Programming/frigate
[2023-01-08T17:26:49.861Z] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/mitchross/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/mitchross/Documents/Programming/frigate --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/mitchross/Documents/Programming/frigate --log-level debug --log-format json --config /Users/mitchross/Documents/Programming/frigate/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-01-08T17:26:50.289Z] (node:94782) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2023-01-08T17:26:50.290Z] (Use Code Helper --trace-deprecation ...
to show where the warning was created)
[2023-01-08T17:26:50.292Z] @devcontainers/cli 0.25.2. Node.js v16.14.2. darwin 22.3.0 x64.
[2023-01-08T17:26:50.292Z] Start: Run: docker buildx version
[2023-01-08T17:26:50.494Z] Stop (202 ms): Run: docker buildx version
[2023-01-08T17:26:50.495Z] github.com/docker/buildx v0.9.1 ed00243a0ce2a0aee75311b06e32d33b44729689
[2023-01-08T17:26:50.496Z]
[2023-01-08T17:26:50.496Z] Start: Resolving Remote
[2023-01-08T17:26:50.503Z] Running the initializeCommand from devcontainer.json...
[2023-01-08T17:26:50.503Z] Start: Run: /bin/sh -c .devcontainer/initialize.sh [2023-01-08T17:26:51.093Z] config/config.yml already exists, skipping initialization [2023-01-08T17:26:51.095Z] Stop (592 ms): Run: /bin/sh -c .devcontainer/initialize.sh [2023-01-08T17:26:51.096Z] [2023-01-08T17:26:51.097Z] Start: Run: docker-compose version --short [2023-01-08T17:26:51.295Z] Stop (198 ms): Run: docker-compose version --short [2023-01-08T17:26:51.295Z] Docker Compose version: 2.13.0 [2023-01-08T17:26:51.296Z] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=frigate --filter label=com.docker.compose.service=devcontainer [2023-01-08T17:26:51.485Z] Stop (189 ms): Run: docker ps -q -a --filter label=com.docker.compose.project=frigate --filter label=com.docker.compose.service=devcontainer [2023-01-08T17:26:51.486Z] Start: Run: docker inspect --type container 0933e41210e1 [2023-01-08T17:26:51.619Z] Stop (133 ms): Run: docker inspect --type container 0933e41210e1 [2023-01-08T17:26:51.622Z] Start: Inspecting container [2023-01-08T17:26:51.623Z] Start: Run: docker inspect --type container 0933e41210e113809006117bee55e91530284d738958fa17a562c8c25f32549b [2023-01-08T17:26:51.781Z] Stop (158 ms): Run: docker inspect --type container 0933e41210e113809006117bee55e91530284d738958fa17a562c8c25f32549b [2023-01-08T17:26:51.781Z] Stop (159 ms): Inspecting container [2023-01-08T17:26:51.782Z] Start: Run in container: /bin/sh [2023-01-08T17:26:51.792Z] Start: Run in container: uname -m [2023-01-08T17:26:51.926Z] Stop (144 ms): Run in container: /bin/sh [2023-01-08T17:26:51.927Z] Shell server terminated (code: 126, signal: null) [2023-01-08T17:26:51.927Z] unable to find user vscode: no matching entries in passwd file [2023-01-08T17:26:51.926Z] Start: Run in container: cat /etc/passwd [2023-01-08T17:26:51.927Z] Stdin closed! [2023-01-08T17:26:51.928Z] Error: An error occurred setting up the container. [2023-01-08T17:26:51.928Z] at loe (/Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1832:2820) [2023-01-08T17:26:51.928Z] at process.processTicksAndRejections (node:internal/process/task_queues:96:5) [2023-01-08T17:26:51.928Z] at async Poe (/Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1899:2301) [2023-01-08T17:26:51.928Z] at async Zf (/Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1899:3278) [2023-01-08T17:26:51.928Z] at async aue (/Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:2020:15276) [2023-01-08T17:26:51.928Z] at async oue (/Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:2020:15030) [2023-01-08T17:26:51.936Z] Stop (2075 ms): Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/mitchross/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/mitchross/Documents/Programming/frigate --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/mitchross/Documents/Programming/frigate --log-level debug --log-format json --config /Users/mitchross/Documents/Programming/frigate/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true [2023-01-08T17:26:51.937Z] Exit code 1 [2023-01-08T17:26:51.942Z] Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/mitchross/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/mitchross/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/mitchross/Documents/Programming/frigate --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/mitchross/Documents/Programming/frigate --log-level debug --log-format json --config /Users/mitchross/Documents/Programming/frigate/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true [2023-01-08T17:26:51.942Z] Exit code 1
There's multiple usb lines and also the dockerfile lines. I run on macOS and commenting those out works as expected
What mac are you running on? I run MacBook Pro M1 Pro 14"
x86 macbook pro .... which lines in docker file specifically? I see quite a bit of usb related items in the docker file and dont want to over comment out and break integrity of the image.
that looks correct as far as comments go. Just remembered you may need to run docker buildx use default
to fix a compatibility issue
also be sure that you are rebuilding the dev container in vscode and not just refreshing the window, refreshing the window will not bring in the new docker compose file
also be sure that you are rebuilding the dev container in vscode and not just refreshing the window, refreshing the window will not bring in the new docker compose file
is there a special command to rebuild dev container in vscode? Or are you just referring to running "Make"..
I'll also try "docker buildx use default" too ....
Yes in the top menu there is the command palette menu which has the option to rebuild container. By the way running make in the CLI won't do anything, the dev container builds the image inside anyway.
Yes in the top menu there is the command palette menu which has the option to rebuild container. By the way running make in the CLI won't do anything, the dev container builds the image inside anyway.
Thanks.. I am following this verbatium.. does it need to be updated maybe?
you are following the stable contributor docs which would be applicable for master. The dev branch has many changes and the contributor docs would be the preview docs https://deploy-preview-4055--frigate-docs.netlify.app/development/contributing
That might explain quite a bit... alright im trying rebuild container from command pallet.. I didnt know that was a thing till now...
ok the combo of
usb comment out, docker buildx use default, and command pallet docker dev container rebuild resolved this. Thanks!
Feel free to create a PR to update the docs.
Yea I think the web docs need updating too. There is no more npm start from what I can tell. Looks like the swtich to vite means we need to run ' npm run dev '
@NickM-27 any tips for starting web local? Im getting CORS issues and 403 issues
npm run dev should do it, then access on localhost:5173
Did you start frigate by running python3 -m frigate
yup
Is it still running (didn't error out)? I've never seen that when frigate is running.
weird, I'd make sure you don't have any firewalls up or anything, never had any issues with that. If you run curl http://localhost:5000/api
what do you get?
@NickM-27
Maybe restart vscode again, seems the nginx service may not the running or else there's some other issue not allowing access to that port.
Maybe restart vscode again, seems the nginx service may not the running or else there's some other issue not allowing access to that port.
Thats after a fresh restart ^
Docker hub shows no ports exposed for the dev container... Is the docker compose supposed to expose ports here? or even the vs code container? Cause they are definately not exposed outside docker.
The ports are all defined here: https://github.com/blakeblackshear/frigate/blob/5b7cd9ce64df6032f97ef7b7f01e1da1fd287aa1/.devcontainer/devcontainer.json#L14
When I look in vscode I can see all the ports in the ports tab next to terminal
it seems 5000 / nginix is the issue? 5001 seems ok?
interesting, not sure why nginx wouldn't be running
Is there a way I can force it up in the container?
You can try running exec nginx
I've gone ahead and done a fresh vscode dev image build and all is still working well for me, just to confirm that the recent nginx changes don't seem to be the issue
I have tried several macs, several linux pcs, and It still fails to builds the vs code container. Would you mind posting step by step process to get frigate dev containers working? Id love to contribute to this project but it just wont work on a single PC regardless of OS. The getting started contribution guide must be missing a step. @NickM-27
What issue are you running into at this point?
Also want to confirm you're following the latest dev docs and not the outdated stable docs https://deploy-preview-4055--frigate-docs.netlify.app/development/contributing
step 1 pull dev branch step 2 comment out nvidia/usb in docker compose step 3 open dev branch in vs code step 4 command P , rebuild container and open step 5. errors out
ive tried on mac os, ubuntu, popOS, wsl2, etc
What errors are you getting? Is it failing to build the dev container? You should be able to see the logs.
Here are the logs https://gist.github.com/mitchross/9c62536d7f8f3c504e878c8793e956fa
So to confirm, you are running on the dev branch correct? Maybe @felipecrs might have an idea, I've not seen the container fail there before
Yup fresh git pull dev branch
~/frigate$ git status On branch dev Your branch is up to date with 'origin/dev'.
Changes not staged for commit:
(use "git add
no changes added to commit (use "git add" and/or "git commit -a")
You have to poll the logs for the frigate container:
docker logs -f frigate-devcontainer
Try to get the logs for when it fails.
Actually, @NickM-27, I think this may be fixed by #5545 (otherwise go2rtc in the devcontainer fails to start, which causes the container to exit).
Oh, I know why that happens
@mitchross yeah, that's the problem. You can try to checkout PR 5545 and try again. It should work.
@felipecrs it is a problem with logic in create_go2rtc_config and will need to be fixed separately
@NickM-27, it's fixed already by:
Ah, beautiful
Will the PR merge any time soon? if it merges today, I can wait to re-test
Describe the problem you are having
Tying to load local VS code dev container to contribute to code base.
Following the contribution guide. Already ran make.
Version
Dev Branch Jan 7 2023
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Other
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
NA
Any other information that may be helpful
Just Local Dev Container in Mac OS.