namshi / roger

A continuous integration and build server for Docker containers
127 stars 26 forks source link

Error sending notifications #56

Open JonathanHolvey opened 5 years ago

JonathanHolvey commented 5 years ago

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 commented 5 years ago

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 }}'