Git Product home page Git Product logo

Comments (17)

wq9578 avatar wq9578 commented on June 1, 2024 1

Of course I had started the queue (and I have tested it again now).

The exact instructions were:

  1. Starting the server: php artisan serve
  2. 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.

wq9578 avatar wq9578 commented on June 1, 2024 1

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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024 1

@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.

florisbosch avatar florisbosch commented on June 1, 2024 1

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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024 1

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!

Screen Shot 2023-06-01 at 6 56 08 AM

from laravel-workflow.

wq9578 avatar wq9578 commented on June 1, 2024 1

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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

@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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

@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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

@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.

wq9578 avatar wq9578 commented on June 1, 2024

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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

@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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

@wq9578 This is what I am using:

https://gist.github.com/rmcdaniel/e343a84954481eb069fb243bc078e956

from laravel-workflow.

wq9578 avatar wq9578 commented on June 1, 2024

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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

@wq9578 I tested your workflow locally and it works for me. 😞

Screen Shot 2023-04-18 at 1 05 13 AM

from laravel-workflow.

wq9578 avatar wq9578 commented on June 1, 2024

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.

wq9578 avatar wq9578 commented on June 1, 2024

@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.

rmcdaniel avatar rmcdaniel commented on June 1, 2024

Here's my public email address https://github.com/laravel-workflow/laravel-workflow/blob/master/composer.json#L27

from laravel-workflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.