Skip to content

No operation when app run in docker container #831

Open
@neatcoder

Description

@neatcoder

Problem Description

When running safe-settings app in my docker container, the app is not performing any actions but rather acknowledges any request and returns 200. Inspected the files in the container, they are identical to the project on my drive and that works fine when run npm start while the docker container does not seem to perform any operation for the same event.

Logs when trying to update settings in the admin repo for a test repository. As you can see, no logs of operation but simple 200s.

probot-1  | WARN (probot): "repository_ruleset" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)
probot-1  | INFO (server): Running Probot v13.4.5 (Node.js: v20.19.2)
probot-1  | INFO (server): Forwarding https://smee.io/<REDACTED> to http://localhost:3000/api/github/webhooks
probot-1  | (node:25) [UNDICI-EHPA] Warning: EnvHttpProxyAgent is experimental, expect them to change at any time.
probot-1  | (Use `node --trace-warnings ...` to show where the warning was created)
probot-1  | INFO (server): Listening on http://localhost:3000
probot-1  | INFO (server): Connected
probot-1  | DEBUG (octokit): GitHub request: GET https://api.github.com/app/installations?per_page=100 - 200
probot-1  | DEBUG (probot): installations: <REDACTED>
probot-1  | DEBUG (github): GitHub request: GET https://api.github.com/app - 200
probot-1  | DEBUG (probot): Validated the app is configured properly = {<REDACTED>}
probot-1  | INFO (probot): POST /api/github/webhooks 200 - 13ms
probot-1  | INFO (server): POST http://localhost:3000/api/github/webhooks - 200

docker-compose.yml:

version: '3.4'

services:
  probot:
    image: safe-settings-test:latest
    build: .
    environment:
      NODE_ENV: development
      APP_ID: ${APP_ID}
      GH_ORG: ${GH_ORG}
      WEBHOOK_PROXY_URL: ${WEBHOOK_PROXY_URL}
      PRIVATE_KEY: ${PRIVATE_KEY}
      WEBHOOK_SECRET: ${WEBHOOK_SECRET}
      LOG_LEVEL: ${LOG_LEVEL}
    ports:
      - 3000:3000

Please note, I am using multi-stage docker build to build from safe-settings image on ghcr.io

dockerfile.dev:

FROM  ghcr.io/github/safe-settings:2.1.17 AS safe-settings
COPY . .

FROM node:20-alpine
WORKDIR /opt/safe-settings

## These files are copied separately to allow updates
## to the image to be as small as possible
COPY --from=safe-settings /opt/safe-settings/lib lib
COPY --from=safe-settings /opt/safe-settings/package.json package.json
COPY --from=safe-settings /opt/safe-settings/index.js index.js

COPY .npmrc \
          ./

RUN npm install

RUN chown -R node:node /opt/safe-settings

EXPOSE 3000

USER node

CMD ["npm", "start"]

Command to build:
docker buildx bake dev --progress=plain --no-cache --set dev.tags=safe-settings-test

Command to run:
docker compose --env-file .env up

I am on a Windows machine with WSL2 enabled for docker. I am also behind Zscaler VPN. Although I have tested for network issues and docker looks fine, I thought this information might be useful for any debugging.

What is the expected behavior

It should run and execute the setting change in test repo with some more logs in DEBUG mode on why it failed to execute any logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions