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

Error sending notifications #56

Open
JonathanHolvey opened this issue May 15, 2019 · 1 comment
Open

Error sending notifications #56

JonathanHolvey opened this issue May 15, 2019 · 1 comment

Comments

@JonathanHolvey
Copy link
Contributor

JonathanHolvey commented May 15, 2019

I've got a basic Roger server set up according to the installation section of the readme. I can trigger a build using the build API endpoint pointing to my GitHub repo. The build completes and is pushed to my local Docker registry successfully, however there is an error at the end of the build log:

info: Pushed image of build <build name> to the registry at http://127.0.0.1:5000
info: Finished build <build name> in a few seconds #SWAG
info: Sending notifications for <build name>
error: Error sending notifications for <build name> ("Cannot read property 'push' of undefined")
TypeError: Cannot read property 'push' of undefined
    at /src/src/notifications.js:33:22
    at forOwn (/src/node_modules/lodash/dist/lodash.js:2106:15)
    at Function.forEach (/src/node_modules/lodash/dist/lodash.js:3303:9)
    at Object.notifications.trigger (/src/src/notifications.js:31:5)
    at /src/src/builder.js:209:21
    at _fulfilled (/src/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/src/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/src/node_modules/q/q.js:816:13)
    at /src/node_modules/q/q.js:624:44
    at runSingle (/src/node_modules/q/q.js:137:13)

I have Roger configured with docker-compose and a config.yml file:

version: '3.7'

services:
  build:
    image: namshi/roger
    ports:
      - 8080:8080
    volumes:
      - /tmp/logs:/tmp/roger-builds/logs
      - ./db:/db
      - /var/run/docker.sock:/tmp/docker.sock
      - ./config.yml:/config.yml
auth:
  # Not my actual token
  github: 8f5c8a512f1b7d921a8c1018d2d58fe41423c8e9

My GitHub token has the permissions public_repo and notifications, but GitHub is reporting that it has never been used.

What could be the cause of this error?

@JonathanHolvey
Copy link
Contributor Author

I found that adding a GitHub notification key to config.yaml stops the error.

auth:
  # Not my actual token
  github: 8f5c8a512f1b7d921a8c1018d2d58fe41423c8e9
notifications:
  github:
    token: '{{ auth.github }}'

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

1 participant