webhook icon indicating copy to clipboard operation
webhook copied to clipboard

permission denied error

Open leic4u opened this issue 1 year ago • 6 comments

I did chmod a+x checkchan2tgbot.sh, there is also permission denied in logs.

Clip_2024-04-08_00-53-27

leic4u avatar Apr 07 '24 16:04 leic4u

could post your docker compose yaml file and webhook config?

soulteary avatar Apr 07 '24 17:04 soulteary

docker compose file

version: '3'
services:
  webhook:
    container_name: webhook
    image: soulteary/webhook:extend-3.4.5
    environment:
      HOST: "0.0.0.0"
      PORT: 9000
      VERBOSE: true
      HOOKS: "/app/hooks.yml"
    volumes:
      - ./app:/app
    ports:
      - 127.0.0.1:19000:9000
    restart: always

webhook config

- id: checkchan2tgbot
  execute-command: "/app/checkchan2tgbot.sh"
  command-working-directory: "/app"
  include-command-output-in-response: true
  include-command-out-in-response-on-error: true
  response-message: I got the payload!
  response-headers:
  - name: Access-Control-Allow-Origin
    value: "*"
  pass-arguments-to-command:
  - source: payload
    name: payload.id
  - source: payload
    name: payload.url
  - source: payload
    name: payload.value
  - source: payload
    name: payload.html
  - source: payload
    name: payload.link
  parse-parameters-as-json:
  - source: payload
    name: payload.id
  - source: payload
    name: payload.url
  - source: payload
    name: payload.value
  - source: payload
    name: payload.html
  - source: payload
    name: payload.link

leic4u avatar Apr 07 '24 18:04 leic4u

@leic4u

I tried it out, and no exception occurred. I personally guess it's the behavioral difference of Docker under different operating systems.

To solve this issue and avoid similar problems in the future, I made some program improvements. You can replace the program version with 3.5.0 or later versions to resolve such issues.

(No need to manually set the script executable anymore.)

https://github.com/soulteary/webhook/releases

soulteary avatar Apr 08 '24 06:04 soulteary

After redeploying v3.5.0, permission denied still appears

leic4u avatar Apr 08 '24 14:04 leic4u

Even I also did the chmod a+x /app/checkchan2tgbot.sh.

Clip_2024-04-08_22-42-24

leic4u avatar Apr 08 '24 14:04 leic4u

https://github.com/soulteary/webhook/tree/main/example/muti-webhook

You can try this configuration example, and before starting, execute chmod +x trigger.sh, I tested in macOS and Ubuntu environments, no problem. Either before the container starts, set up or go into the container settings.

But in the Ubuntu environment, if permissions are not set before starting, the permissions may not be recognized by SH. I have thought of a solution and will improve it later. @leic4u

soulteary avatar Apr 08 '24 15:04 soulteary

@leic4u try 3.6.0

soulteary avatar Jul 03 '24 04:07 soulteary

I haven't encountered this issue because I used the volumes feature in k8s to set the permissions to 0755 when mounting. I hope this helps you @leic4u

    volumeMounts:
            - mountPath: /etc/webhook/
              name: hooks
...
      volumes:
        - name: hooks
          configMap:
            name: hooks
            defaultMode: 0755

kevin1sMe avatar Jul 03 '24 15:07 kevin1sMe