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

Docker watcher throws TypeError #16

Closed
rasmuslp opened this issue Oct 30, 2020 · 5 comments
Closed

Docker watcher throws TypeError #16

rasmuslp opened this issue Oct 30, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@rasmuslp
Copy link

Greetings,

I'm getting this in my Docker logs of WUD:

TypeError: Cannot read property 'newVersion' of undefined
    at Result.equals (/home/node/app/model/Result.js:15:42)
    at isSameResult (/home/node/app/watchers/providers/docker/Docker.js:42:30)
    at EventEmitter.processImageResult (/home/node/app/watchers/providers/docker/Docker.js:67:20)
    at EventEmitter.emit (events.js:314:20)
    at Object.emitImageResult (/home/node/app/event/index.js:11:18)
    at Docker.watchImage (/home/node/app/watchers/providers/docker/Docker.js:216:15)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 1)

It shows up once for each time WUD checks the default local Docker watcher:

{"cron":"* * * * *","socket":"/var/run/docker.sock","port":2375,"watchbydefault":true}

Let me know if there is any information I can provide to help debug this.

@fmartinou
Copy link
Owner

Hi,

Based on the second issue you've opened, I guess that some containers are detected and some others aren't?
Can you run wud with the env var WUD_LOG_LEVEL=debug and paste the log here?

Thanks

@rasmuslp
Copy link
Author

Actually all showed up, except for the issue described in #17.
However, after I removed the home-assistant container I had running, the error seems to have disappeared.

I'll try to see if I can recreate the issue with debug logs enabled.

This container was the only one that did not have a wud.tag.include label. But it's my impression that these are optional?

I've pasted the current debug logs below. While they don't seem to show the error, they do highlight another peculiarity: What's up with the arch in the logs?

I'm running this on a Raspberry Pi 4, so I would expect something arm, if specified. However, for portainer/portainer-ce:2.0.0, where linux/arm is available, it shows up as amd64.

Logs:

{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"What's up, docker? is starting","time":"2020-10-31T17:05:13.300Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"Init DB (/store/wud.json)","time":"2020-10-31T17:05:13.311Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"DB empty => Create DB Collections","time":"2020-10-31T17:05:13.328Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"Register all components for provider smtp","time":"2020-10-31T17:05:13.435Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"No Registry configured => Init a default one (Docker Hub with default options)","time":"2020-10-31T17:05:13.834Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"Register component hub of type hub with configuration {}","time":"2020-10-31T17:05:15.202Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"Register component local of type docker with configuration {\"cron\":\"* * * * *\",\"socket\":\"/var/run/docker.sock\",\"port\":2375,\"watchbydefault\":true}","time":"2020-10-31T17:05:18.133Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"Schedule runner (* * * * *)","time":"2020-10-31T17:05:18.140Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"HTTP API enabled => Start Http listener on port 3000","time":"2020-10-31T17:05:18.248Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":30,"msg":"HTTP API exposed on port 3000","time":"2020-10-31T17:05:18.320Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/fmartinou/whats-up-docker:3.1.0","time":"2020-10-31T17:05:18.531Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/ryansch/unifi-rpi:5.14.23","time":"2020-10-31T17:05:18.570Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/ryansch/unifi-rpi:6.0.23","time":"2020-10-31T17:05:18.574Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/portainer/portainer-ce:2.0.0","time":"2020-10-31T17:05:18.576Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Image watched for the first time ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"fmartinou/whats-up-docker\",\"version\":\"3.1.0\",\"versionDate\":\"2020-10-02T09:32:16.750345022Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":226511654,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.795Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"No result found ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"fmartinou/whats-up-docker\",\"version\":\"3.1.0\",\"versionDate\":\"2020-10-02T09:32:16.750345022Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":226511654,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.810Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"fmartinou/whats-up-docker\",\"version\":\"3.1.0\",\"versionDate\":\"2020-10-02T09:32:16.750345022Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":226511654,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.811Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Image watched for the first time ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"ryansch/unifi-rpi\",\"version\":\"5.14.23\",\"versionDate\":\"2020-08-25T15:32:20.728640221Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":614756178,\"includeTags\":\"^5.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.826Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"No result found ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"ryansch/unifi-rpi\",\"version\":\"5.14.23\",\"versionDate\":\"2020-08-25T15:32:20.728640221Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":614756178,\"includeTags\":\"^5.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.829Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"ryansch/unifi-rpi\",\"version\":\"5.14.23\",\"versionDate\":\"2020-08-25T15:32:20.728640221Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":614756178,\"includeTags\":\"^5.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.829Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"ryansch/unifi-rpi\",\"version\":\"6.0.23\",\"versionDate\":\"2020-09-18T14:32:04.288271161Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":593048594,\"includeTags\":\"^\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.841Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Image watched for the first time ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"portainer/portainer-ce\",\"version\":\"2.0.0\",\"versionDate\":\"2020-08-31T08:57:54.182287462Z\",\"architecture\":\"amd64\",\"os\":\"linux\",\"size\":163107177,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.910Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"No result found ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"portainer/portainer-ce\",\"version\":\"2.0.0\",\"versionDate\":\"2020-08-31T08:57:54.182287462Z\",\"architecture\":\"amd64\",\"os\":\"linux\",\"size\":163107177,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.912Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"portainer/portainer-ce\",\"version\":\"2.0.0\",\"versionDate\":\"2020-08-31T08:57:54.182287462Z\",\"architecture\":\"amd64\",\"os\":\"linux\",\"size\":163107177,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:05:19.913Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/fmartinou/whats-up-docker:3.1.0","time":"2020-10-31T17:06:00.113Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/ryansch/unifi-rpi:5.14.23","time":"2020-10-31T17:06:00.118Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/ryansch/unifi-rpi:6.0.23","time":"2020-10-31T17:06:00.120Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Check https://registry-1.docker.io/v2/portainer/portainer-ce:2.0.0","time":"2020-10-31T17:06:00.122Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"ryansch/unifi-rpi\",\"version\":\"5.14.23\",\"versionDate\":\"2020-08-25T15:32:20.728640221Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":614756178,\"includeTags\":\"^5.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:06:01.125Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"ryansch/unifi-rpi\",\"version\":\"6.0.23\",\"versionDate\":\"2020-09-18T14:32:04.288271161Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":593048594,\"includeTags\":\"^\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:06:01.137Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"fmartinou/whats-up-docker\",\"version\":\"3.1.0\",\"versionDate\":\"2020-10-02T09:32:16.750345022Z\",\"architecture\":\"arm\",\"os\":\"linux\",\"size\":226511654,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:06:01.268Z","v":0}
{"name":"whats-up-docker","hostname":"d7a94b45d110","pid":1,"level":20,"msg":"Result already processed => No need to trigger ({\"watcher\":\"docker.local\",\"registry\":\"hub\",\"registryUrl\":\"https://registry-1.docker.io/v2\",\"image\":\"portainer/portainer-ce\",\"version\":\"2.0.0\",\"versionDate\":\"2020-08-31T08:57:54.182287462Z\",\"architecture\":\"amd64\",\"os\":\"linux\",\"size\":163107177,\"includeTags\":\"^\\\\d+\\\\.\\\\d+\\\\.\\\\d+$\",\"isSemver\":true})","time":"2020-10-31T17:06:01.352Z","v":0}

@fmartinou
Copy link
Owner

Yes, all labels are optional (incl wud.tag.include).

Regarding the weird arch on portainer, wud gets the values from the docker socket like a simple docker image inspect would do.

If you run docker image inspect --format='{{.Architecture}}' portainer/portainer-ce:2.0.0, what does that return?
arch or amd64?

@rasmuslp
Copy link
Author

Aha, that returns amd64.

@fmartinou
Copy link
Owner

Hi,

With version 3.1.1, the error Cannot read property 'newVersion' of undefined should be gone.

@fmartinou fmartinou self-assigned this Nov 21, 2021
@fmartinou fmartinou added the bug Something isn't working label Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants