Comments (17)
Of course I had started the queue (and I have tested it again now).
The exact instructions were:
- Starting the server:
php artisan serve
- Starting the queue:
php artisan queue:work
I also tried starting the queue first, and starting the queue only (without starting the server).
So what is the next step in debugging?
The library as well as the website are nicely done, as far as I can see, so I would like to use it.
Thanks!
from laravel-workflow.
See the files at https://gist.github.com/wq9578/5e52bfc9e0e5178aa4eb99aca0ebcd71, and for the versions the log file there.
The queue doesn't report anything, even with maximum verbosity: php artisan queue:work -vvv
.
Console:
php artisan test tests/Feature/EmailVerificationWorkflowTest.php
"App\Workflows\Tests\VerifyEmailAddress\VerifyEmailAddressWorkflow::execute([email protected])" // app/Workflows/Tests/VerifyEmailAddress/VerifyEmailAddressWorkflow.php:24
PASS Tests\Feature\EmailVerificationWorkflowTest
✓ it logs the PHP and composer version 0.11s
✓ it logs the composer package versions with ('laravel/framework') 0.01s
✓ it logs the composer package versions with ('doctrine/dbal') 0.01s
✓ it logs the composer package versions with ('pestphp/pest') 0.01s
✓ it logs the composer package versions with ('pestphp/pest-plugin-laravel')
✓ it logs the composer package versions with ('laravel-workflow/laravel-workflow')
✓ it test the email address verification workflow 0.03s
Tests: 7 passed (7 assertions)
Duration: 0.20s
from laravel-workflow.
@wq9578 Do you have some time for a video chat so we can screen share? That would be the fastest way to make progress at this point. The major issue right now is that we aren't getting any error message. So we need to figure out when/where/how it's silently dying in the middle of the workflow.
from laravel-workflow.
Hi @wq9578 & @rmcdaniel,
This issue seems to happen if you work in your local dev environment and have the queue connection set to "sync".
Because the workflow job is running it is not able to start the activity job before the workflow itself is completed.
I've made a pull request with a proposal for a possible solution to use the dispatchNow in the activity.
See #95
from laravel-workflow.
I have updated the documentation. I would recommend database
or redis
queue driver for testing workflows. The sync
driver won't work. If you want to hack it yourself @florisbosch has graciously provided some code for that. But you won't be able to use timers if you go that route. I'm going to close this ticket, assuming changing the driver fixes the issue. If not, please feel free to reopen it. Thanks!
from laravel-workflow.
After migrating the database and updating the QUEUE_CONNECTION as described at https://laravel.com/docs/10.x/queues#driver-prerequisites it seems to work.
Thanks a lot!
from laravel-workflow.
@wq9578 I'm sorry to hear that you're having an issue. I'm wondering, did you make sure to run the queue worker? Check that first and let me know if that wasn't the issue. Thanks!
Laravel Workflow uses Laravel's queued jobs to run workflows and activities in the background. You will need to either run the queue:work Artisan command or use Horizon to run your queue workers. This will process the queued workflows and activities and execute them in the background. Without a running queue worker, workflows and activities will not be executed.
(Source: https://laravel-workflow.com/docs/installation#running-workers)
from laravel-workflow.
@wq9578 Just wanted to cover the basics and also was wishful thinking on my part! 😂
What do you see in the output of php artisan queue:work
? Anything? Also can you try using Log::info
in both places? I think dump
might not work in all cases.
Can you provide the entire workflow and activity classes? You can use https://gist.github.com/ or paste it here.
Also can you tell me what version of the library you are using? What queue driver? What database driver?
How are you starting the workflow and checking the output? Thanks in advance!
from laravel-workflow.
@wq9578 Thanks for the additional details! It looks like you are executing this via a Pest test? Have you tried also making an artisan command to start the workflow that way? I'm going to try all of this myself but I want to narrow down if it's an issue running via Pest. All the tests I have just use vanilla PHPUnit btw. Also can you confirm which queue driver you are using? Is it redis or database or something else?
from laravel-workflow.
I made a PHPUnit test to make sure that it isn't a Pest issue: https://gist.github.com/wq9578/5e52bfc9e0e5178aa4eb99aca0ebcd71#file-emailverificationworkflowphpunittest-php
The result is still the same.
See the updated log here for the database engine version: https://gist.github.com/wq9578/5e52bfc9e0e5178aa4eb99aca0ebcd71#file-laravel-log
from laravel-workflow.
@wq9578 That doesn't make sense because this library is tested with PHPUnit. All the tests run automatically in the GitHub pipeline. If this library didn't work with PHPUnit then the pipeline wouldn't work.
https://github.com/laravel-workflow/laravel-workflow/blob/master/tests/Feature/WorkflowTest.php
Try making a simple artisan command to start your workflow. There's something we're still missing here.
from laravel-workflow.
@wq9578 This is what I am using:
https://gist.github.com/rmcdaniel/e343a84954481eb069fb243bc078e956
from laravel-workflow.
Artisan command: https://gist.github.com/wq9578/5e52bfc9e0e5178aa4eb99aca0ebcd71#file-workflowtest-php
Nothing changed, as expected.
Both the MySQL database and Pest always worked fine and seamlessly with all other features of my current Laravel project.
from laravel-workflow.
@wq9578 I tested your workflow locally and it works for me. 😞
from laravel-workflow.
Tried it with your console command (with minor modifications), didn't work either: https://gist.github.com/wq9578/5e52bfc9e0e5178aa4eb99aca0ebcd71#file-workflow-php
$ php artisan workflow:run
"App\Workflows\Tests\VerifyEmailAddress\VerifyEmailAddressWorkflow::execute([email protected])" // app/Workflows/Tests/VerifyEmailAddress/VerifyEmailAddressWorkflow.php:24
^C
from laravel-workflow.
@rmcdaniel Thanks for your kind offer.
For arranging a video chat appointment, is there any way on GitHub you could tell me your email address privately?
I don't want to share contact details here.
from laravel-workflow.
Here's my public email address https://github.com/laravel-workflow/laravel-workflow/blob/master/composer.json#L27
from laravel-workflow.
Related Issues (20)
- Workflow stuck at waiting status HOT 2
- The attribute [code] either does not exist or was not retrieved for model HOT 6
- Support MongoDB HOT 8
- No publishable resources for tag [migrations]. HOT 1
- Workflows stuck in waiting when running multiple horizon processes HOT 8
- Duplicated query while running jobs HOT 7
- Error("Call to undefined method React\Promise\Promise::valid()") HOT 2
- Call to a member function valid() on null {"exception":"[object] (Error(code: 0) HOT 10
- workflow run on browser HOT 1
- Can we leverage with Rabbit MQ and Kakfa
- Signals not received due to different queue name prefix HOT 4
- Errors in WithoutOverlappingMiddleware HOT 4
- Race condition when starting a workflow within a database transaction HOT 2
- Any reason why the ActivityCompleted and ActivityFailed events don't include the workflowId? HOT 1
- Argument #1 ($storedWorkflow) must be of type Workflow\Models\StoredWorkflow, int given HOT 2
- Serialization of models returned from Activities HOT 1
- Default Queue Not Respected HOT 3
- Cannot use finally method of Laravel Batch Job inside an Activity HOT 7
- Exception("Activity timed out.") HOT 3
- Querying a workflow DOES advance child's execution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-workflow.