project-satisfy / satisfy

Satis composer repository manager with a Web UI

Home Page:http://ludofleury.github.io/satisfy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Webhook URL returns 400 error when APP_DEBUG is 0

ihor-sviziev opened this issue · comments

Hi,

I noticed that Satisfy returns a 400 error when APP_MODE=prod and APP_DEBUG=0. When switching APP_DEBUG to 1 - it works fine.
I don't see any logs, so it's hard to understand why it happened.
Any thoughts?

HTTP error code 400 means "Bad request". It is expected to get such response if request is not valid.
With debug mode on you get nice error page with stack trace and other info.

The latest master has monolog logger installed. Please upgrade and check /var/log/* for errors. If there is any, then please report as another issue.

Thx for the fix. Can check it in a week

Hi @ramunasd,
Just now was able to test your change - it works fine. Thank you for the fix.

@ramunasd, just after the upgrade to the latest version, Satisfy stopped automatically adding new repositories using the webhook from GitHub. Can it be related to these changes you did recently?
The error is following:

[2023-01-31T11:30:21.939048+00:00] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "Cannot find specified repository" at /var/www/satisfy/src/Playbloom/Satisfy/Webhook/GithubWebhook.php line 74 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\BadRequestHttpException(code: 0): Cannot find specified repository at /var/www/src/Playbloom/Satisfy/Webhook/GithubWebhook.php:74)\n[previous exception] [object] (InvalidArgumentException(code: 0): Cannot find specified repository at /var/www/src/Playbloom/Satisfy/Webhook/GithubWebhook.php:142)"} []

Please make sure your parameters are correct

I checked, and for some reason, the github.auto_add_repo and github.auto_add_repo_type got lost during the update. So I added them back, restarted the web server, and still the same error and the message.
Could you please point me out what could be wrong?
Here is my parameters.yml file:

# This file is auto-generated during the composer install
parameters:
    secret: "my_own_secret"
    satis_filename: '%kernel.project_dir%/satis.json'
    satis_log_path: '%kernel.project_dir%/var/satis'
    admin.auth: false
    admin.users: {  }
    composer.home: '%kernel.project_dir%/var/composer'
    github.secret: "my_github_secret"
    github.auto_add_repo: true
    github.auto_add_repo_type: "github"

You didn't provider exact error message with stack trace. So I can only guess.

It may be two reasons:

  • You didn't clear the cache and auto-add is still not enabled
  • github payload does not have any of enabled source types(url types), please refer to config/defaults.yml

@ramunasd, interesting, when i'm enabling debug mode - everything works fine, but when I disabling - the auto-add flag isn't getting applied (debugged). Could you please explain of how the parameters.yml file is cached, and how to flush this cache?