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

Reverb with Self-Signed Certificate and Supervision as Queue Worker #183

Closed
Pixolantis opened this issue May 2, 2024 · 5 comments
Closed
Assignees

Comments

@Pixolantis
Copy link

Pixolantis commented May 2, 2024

Reverb Version

1.0.0-beta9

Laravel Version

11.0.7

PHP Version

8.3.6

Description

My Reverb runs with supervision and have the tls verification disabled:
conf(broadcasting.php

'client_options' => [
    'verify' => false,
],

I run my queue for a test example with ´php artisan queue:work´ or ´queue:listen´. Both works.

With Queues and supervisor I get this error

Pusher error: cURL error 7: Failed to connect to reverb.aaa.test port 443 after 4 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://reverb.my-domain.test/apps/1949

Steps To Reproduce

My supervisor for queue:

[supervisord]
nodaemon=true
loglevel=info
user=laravel

[program:laravel-queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=laravel
numprocs=4
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/queue.log
stopwaitsecs=3600

My dockerfile for supervisor:

...
RUN apk add --update supervisor

ENTRYPOINT ["supervisord", "--nodaemon", "--configuration", "/etc/supervisor/conf.d/queue.conf"]

I don't know if this is a reverb problem or if I have a missconfiguration

@joedixon
Copy link
Collaborator

joedixon commented May 2, 2024

Hey @Pixolantis, what does your Reverb configuration look like? Could you share your reverb.php file and your REVERB_ prefixed environment variables?

@Pixolantis
Copy link
Author

Pixolantis commented May 3, 2024

Hey @joedixon
sure. Thank you.

.env

REVERB_SERVER_HOST=reverb
REVERB_SERVER_PORT=8088
REVERB_APP_ID=215436
REVERB_APP_KEY=3orxjgppvmqnognsh8us
REVERB_APP_SECRET=yryu2rb6wi5u7ct2r09a
REVERB_HOST=reverb.my-domain.test
REVERB_PORT=443
REVERB_SCHEME=https

reverb.php (no changes made)
I have try to set verify_peer but after this, my browser can't connect to reverb

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Default Reverb Server
    |--------------------------------------------------------------------------
    |
    | This option controls the default server used by Reverb to handle
    | incoming messages as well as broadcasting message to all your
    | connected clients. At this time only "reverb" is supported.
    |
    */

    'default' => env('REVERB_SERVER', 'reverb'),

    /*
    |--------------------------------------------------------------------------
    | Reverb Servers
    |--------------------------------------------------------------------------
    |
    | Here you may define details for each of the supported Reverb servers.
    | Each server has its own configuration options that are defined in
    | the array below. You should ensure all the options are present.
    |
    */

    'servers' => [

        'reverb' => [
            'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),
            'port' => env('REVERB_SERVER_PORT', 8080),
            'hostname' => env('REVERB_HOST'),
            'options' => [
                'tls' => [],
            ],
            'max_request_size' => env('REVERB_MAX_REQUEST_SIZE', 10_000),
            'scaling' => [
                'enabled' => env('REVERB_SCALING_ENABLED', false),
                'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
            ],
            'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15),
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Reverb Applications
    |--------------------------------------------------------------------------
    |
    | Here you may define how Reverb applications are managed. If you choose
    | to use the "config" provider, you may define an array of apps which
    | your server will support, including their connection credentials.
    |
    */

    'apps' => [

        'provider' => 'config',

        'apps' => [
            [
                'key' => env('REVERB_APP_KEY'),
                'secret' => env('REVERB_APP_SECRET'),
                'app_id' => env('REVERB_APP_ID'),
                'options' => [
                    'host' => env('REVERB_HOST'),
                    'port' => env('REVERB_PORT', 443),
                    'scheme' => env('REVERB_SCHEME', 'https'),
                    'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
                ],
                'allowed_origins' => ['*'],
                'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60),
                'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10_000),
            ],
        ],

    ],

];

reverb is start with supervision in a separate Container (reverb:8088)
If I stop my queue worker container and run php artisan queue:work in my php Container it works.

@joedixon
Copy link
Collaborator

joedixon commented May 3, 2024

REVERB_SERVER_HOST=reverb looks wrong, that should more likely be REVERB_SERVER_HOST=0.0.0.0 as it should be a valid host on the server on which Reverb can run.

How are you applying SSL to the Reverb server?

@Pixolantis
Copy link
Author

I don‘t think that is wrong. Reverb is working woth queue:work. If it is wrong, I think it was not working wor an artisan command.

reverb is the containername for my reverb host.
I use Traefik to enroll my Dev Environment with SSL

@joedixon
Copy link
Collaborator

joedixon commented May 3, 2024

Hey @Pixolantis. Sorry, but this configuration is outside of my ability to provide assistance. I would recommend asking for help in one of our support channels:

@joedixon joedixon closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants