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

php artisan queue:work --queue=sendportal-message-dispatch this command is not working when run this command in my terminal it appears nothing and i also change QUEUE_CONNECTION=database but still nothing is showing #277

Open
Rudrasingh11 opened this issue Aug 15, 2023 · 10 comments

Comments

@Rudrasingh11
Copy link

No description provided.

@Rudrasingh11 Rudrasingh11 changed the title php artisan queue:work --queue=sendportal-message-dispatch php artisan queue:work --queue=sendportal-webhook-process php artisan queue:work --queue=sendportal-message-dispatch this command is not working when run this command in my terminal it appears nothing and i also change QUEUE_CONNECTION=database but still nothing is showing Aug 15, 2023
@bmenking-wng
Copy link

Just ran into this. When using QUEUE_CONNECTION=database, it appears those queues, sendportal-message-dispatch and sendportal-webhook-process, are not used by the software. I was able to get it working using

php artisan queue:work --queue=default

Hope this helps.

This was referenced Dec 11, 2023
@noehmeier
Copy link

I set in .env the QUEUE_CONNECTION=database.

And i run:

php artisan queue:table
php artisan migrate

and i tried the following commands:

php artisan queue:work --queue=sendportal-message-dispatch
php artisan queue:work --queue=sendportal-webhook-process

php artisan queue:work --queue=default

But nothing happens with any of the queue:work command...

grafik

Any other recommondations how i can run a Campaign and not get stuck in "Queued"?

grafik

@bmenking-wng
Copy link

I set in .env the QUEUE_CONNECTION=database.

And i run:

php artisan queue:table
php artisan migrate

and i tried the following commands:

php artisan queue:work --queue=sendportal-message-dispatch
php artisan queue:work --queue=sendportal-webhook-process

php artisan queue:work --queue=default

But nothing happens with any of the queue:work command...

grafik

Any other recommondations how i can run a Campaign and not get stuck in "Queued"?

grafik

When you "sent" the campaign, did you select "Send Immediately" or "Queue draft" for sending behavior?

The other thing you can do is pull up the database and find the jobs (?) table. Look for a column "queue" and see what the name is. In my instance they are all going in as "default" but maybe yours is different?

@noehmeier
Copy link

Thank you for your fast response @bmenking-wng
I tried both there, "Send automatically" and "Queue draft":
grafik

but they are getting all "Queued" status:
grafik

i have both tables jobs and failed_jobs, but they are always empty:
grafik

Is that the problem, should there be entries in jobs?

@bmenking-wng
Copy link

Thank you for your fast response @bmenking-wng I tried both there, "Send automatically" and "Queue draft": grafik

but they are getting all "Queued" status: grafik

i have both tables jobs and failed_jobs, but they are always empty: grafik

Is that the problem, should there be entries in jobs?

So the issue I ran into was that incoming opens and click notifications from AWS SNS were not getting processed by the queue. I don't think email sending uses the queue, but I could be wrong.

Check to see if the cron job from the docs is running https://sendportal.io/docs/v2/getting-started/configuration-and-setup#additional-configuration

Under the Messages section if you click on the "Draft" tab you may see all the unsent email messages. Enabling that cron job should start pushing those "Send Immediately" messages out to the email provider that is configured.

@noehmeier
Copy link

noehmeier commented Dec 21, 2023

Thank your very much @bmenking-wng for your hint with the cron job. The schedule:run did the job and all Campaigns have been sent out and i see the jobs in the jobs database table.

> php artisan schedule:run
[2023-12-20T23:22:32+00:00] Running scheduled command: Dispatch all campaigns waiting in the queue

I configure this for a friend and i found out he has just a simple webspace with PHP/MySQL and no SSH/cronjob access. I switched back to QUEUE_CONNECTION=sync and it seems like this also needs the cron job. But docs say:

The synchronous queue runs any queued jobs as they are requested, requiring the user to wait until the job has been completed before any further action can be taken.

For me it sounds like it sends the messages directly after saving the Campaign, why it needs then the cron job? Anyway, it looks like Sendportal is then not useable on a simple webspace? Maybe i open a new issue for this question...

@bmenking-wng
Copy link

Thank your very much @bmenking-wng for your hint with the cron job. The schedule:run did the job and all Campaigns have been sent out and i see the jobs in the jobs database table.

> php artisan schedule:run
[2023-12-20T23:22:32+00:00] Running scheduled command: Dispatch all campaigns waiting in the queue

I configure this for a friend and i found out he has just a simple webspace with PHP/MySQL and no SSH/cronjob access. I switched back to QUEUE_CONNECTION=sync and it seems like this also needs the cron job. But docs say:

The synchronous queue runs any queued jobs as they are requested, requiring the user to wait until the job has been completed before any further action can be taken.

For me it sounds like it sends the messages directly after saving the Campaign, why it needs then the cron job? Anyway, it looks like Sendportal is then not useable on a simple webspace? Maybe i open a new issue for this question...

If you cannot setup cron jobs then "sync" is what you would want. Most likely it processes queue jobs each time a page is loaded on the website. Had a project that operated this way and we used an external cron job to load the front page every two minutes so it would process queue jobs.

Another way to do this may be to create an API that kicks off queue jobs. That way an external cron could be used. This may get you in the direction of that solution: https://stackoverflow.com/questions/32124592/laravel-run-queue-work-from-code

@noehmeier
Copy link

Thank you again for your input @bmenking-wng.

Most likely it processes queue jobs each time a page is loaded on the website.

Yes, that is what i expected, too. I asked ChatGPT, it says the same:

[...] If you set QUEUE_CONNECTION=sync, you essentially disable the queue system, and the jobs will be processed synchronously as part of the web request. [...]

But nothing happens, i clicked every page of my Sendportal app, but the Campaigns keep Queued:

grafik

I also checked config/queue.php in my Laravel directory as you noticed in StackOverflow, but it looks also fine for me:

[...]
'default' => env('QUEUE_CONNECTION', 'sync'),
[...]
'connections' => [

        'sync' => [
            'driver' => 'sync',
        ],
[...]
  • \storage\logs\laravel.log is empty
  • i cleared the cache with php artisan cache:clear and php artisan config:clear
  • i set up again the dummy project and just initialized the .env with the basic db connection / app / user settings and one email service... same result (PHP 8.2.12)
  • used in Campaign always: SCHEDULE="Dispatch now" and SENDING BEHAVIOUR="Send automatically"
  • If i call php artisan schedule:run the get dispatched... but that is not what i want?

I have no idea, what else i could do or what it could be? 🤷🏽‍♂️

@deadlyanony
Copy link

deadlyanony commented Dec 24, 2023

I also faced the same issue but found a way.

You need to create a schedule job in cpanel if you are working on hosting the panel
and use this command
your hosting path here/project main directory name/artisan sp:campaigns:dispatch

image

@noehmeier
Copy link

Thank you for your input @deadlyanony. Sadly, at this webspace are no scheduled tasks / cron jobs available. I can just add files over FTP, modifiy database over phpmyadmin or update php.ini settings.

Also i still dont understand why this is necessary if i choose SYNC - should it not send straight after i clicked the save-Campaign-button?

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

No branches or pull requests

4 participants