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

Unable to send webhooks because of yaml_column_permitted_classes #2476

Closed
Zdvori opened this issue May 24, 2023 · 16 comments
Closed

Unable to send webhooks because of yaml_column_permitted_classes #2476

Zdvori opened this issue May 24, 2023 · 16 comments
Labels

Comments

@Zdvori
Copy link

Zdvori commented May 24, 2023

Describe the bug

Notification domain return 403 unauthorized.
Webhooks not work.

To Reproduce

  1. Clean install of postal with docker will use ruby version 3.2.0.
  2. add some domain

Expected behaviour

Webhooks will work, notificat

Screenshots

obrazek

Additional information/context

"403 unauthorized " should be solve by adding "config.hosts.clear" into app/config/environments/production.rb

@Zdvori Zdvori added the bug label May 24, 2023
@Zdvori
Copy link
Author

Zdvori commented May 24, 2023

both could be fixed by adding lines to /opt/postal/environments/production.rb

  config.active_record.yaml_column_permitted_classes = [Symbol, Hash, Array, ActiveSupport::HashWithIndifferentAccess]
  config.hosts.clear

@catphish
Copy link
Contributor

Please can you open a separate issue regarding the notification domain issue? Please explain what you mean by notification domain.

@Zdvori
Copy link
Author

Zdvori commented May 25, 2023

Under "Domains" , "[Tracking Domains]" add new domain,.... "click.example.com"

under /opt/postal/config/Caddyfile
i add

click.example.com {
   reverse_proxy 127.0.0.1:5000 {
     header_up X-Postal-Track-Host "1"
   }
}

send test email.... try click to email or display tracking pixel ... fails to 403 unauthorized.

@wehmoen
Copy link

wehmoen commented May 25, 2023

Same issue with our installation. Tracking domains don't seem to work after upgrading to the latest version. I temporarily disabled them.

@Zdvori
Copy link
Author

Zdvori commented May 25, 2023

Same issue with our installation. Tracking domains don't seem to work after upgrading to the latest version. I temporarily disabled them.

temporary could be fixed by adding "config.hosts.clear" into /opt/postal/environments/production.rb
I copy locale copy app/config/environments folder into /opt/postal/environments, add line "config.hosts.clear"

and edit
/opt/postal/install/templates/docker-compose.yml

version: "3.9"
services:
  web:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal web-server
    network_mode: host
    volumes:
      - /opt/postal/config:/config
      - /opt/postal/environments:/opt/postal/app/config/environments

@willpower232
Copy link
Collaborator

@catphish see #2415

@catphish catphish changed the title Postal incompatible with Ruby 3.2.0 Unable to send webhooks because of yaml_column_permitted_classes May 25, 2023
@ashishtiwari1993
Copy link

Open and click webhook is still not triggering. Apart from this all webhooks are working.

@ashishtiwari1993
Copy link

Fixed by adding this in docker-compose.yml for worker service as well

    volumes:
      - /opt/postal/config:/config
      - /opt/postal/environments:/opt/postal/app/config/environments

@alex-pommier
Copy link

alex-pommier commented Jun 19, 2023

I have the same problem. I edited
/opt/postal/install/templates/docker-compose.yml

  GNU nano 4.8                                                                              docker-compose.yml
version: "3.9"
services:
  web:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal web-server
    network_mode: host
    volumes:
      - /opt/postal/config:/config
      - /opt/postal/environments:/opt/postal/app/config/environments

  smtp:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal smtp-server
    network_mode: host
    cap_add:
      - NET_BIND_SERVICE
    volumes:
      - /opt/postal/config:/config

  worker:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal worker
    network_mode: host
    volumes:
      - /opt/postal/config:/config
      - /opt/postal/environments:/opt/postal/app/config/environments

  cron:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal cron
    network_mode: host
    volumes:
      - /opt/postal/config:/config

  requeuer:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal requeuer
    network_mode: host
    volumes:
      - /opt/postal/config:/config

  runner:
    profiles: ["tools"]
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal
    network_mode: host
    volumes:
      - /opt/postal/config:/config

Restarted postal but still tracking domains not working. I also noticed I have no files or folders inside my "environments" directory.

@Bob-emblibrary
Copy link

Same issue with our installation. Tracking domains don't seem to work after upgrading to the latest version. I temporarily disabled them.

temporary could be fixed by adding "config.hosts.clear" into /opt/postal/environments/production.rb I copy locale copy app/config/environments folder into /opt/postal/environments, add line "config.hosts.clear"

and edit /opt/postal/install/templates/docker-compose.yml

version: "3.9"
services:
  web:
    image: ghcr.io/postalserver/postal:2.1.4
    command: postal web-server
    network_mode: host
    volumes:
      - /opt/postal/config:/config
      - /opt/postal/environments:/opt/postal/app/config/environments

Can you document how you did this? I don't think any of us have anything in a 'environments' directory. I can see production.rb under /var/lib/docker/overlay2//merged (or diff)/opt/postal/app/config/environments/production.rb but there are 6 of them when I search.
Thanks, I'd really like to get this working.

@alex-pommier
Copy link

Has there been any update on how to get this fixed?

@shashidhar-katkam
Copy link

Please sort out this. Or any one has any solution to fix this, please share.

@Zdvori
Copy link
Author

Zdvori commented Jun 28, 2023

My solution:

  1. copy environments from github to folder /opt/postal/environments (create new one)
  2. edit /opt/postal/install/templates/docker-compose.yml and add
    - /opt/postal/environments:/opt/postal/app/config/environments
    at least for web and worker
  3. edit /opt/postal/environments/production.rb and add lines:
  config.active_record.yaml_column_permitted_classes = [Symbol, Hash, Array, ActiveSupport::HashWithIndifferentAccess]
  config.hosts.clear

  1. run "postal upgrade"

@alex-pommier
Copy link

Thanks @Zdvori that fixed it for me.

For anyone else with the issue, the files to copy are here: https://github.com/postalserver/postal/tree/main/config/environments

@Jank1310
Copy link

@nicksellen Could you add this fix/patch to your patched postal docker image too?

@nicksellen
Copy link

@nicksellen Could you add this fix/patch to your patched postal docker image too?

The patch I added was already coded, and merged, just not released. I'm in a position to start patching things I don't understand from comment threads. Sorry! It's a good reminder to poke them for a release though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants