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

Interesting issue trying to access cloud while in an async job #40

Closed
kirkbushell opened this issue Aug 2, 2023 · 2 comments
Closed

Comments

@kirkbushell
Copy link

Been having good success with the package so far - well done!

However, as part of my async job, I want to copy files from local to S3. As soon as I just check for file existence:

if (!Storage::disk('cloud')->exists($destination)) {

I see this error:

[2023-08-02 13:03:41] local.ERROR: fwrite(): Write of 3360 bytes failed with errno=32 Broken pipe {"exception":"[object] (ErrorException(code: 0): fwrite(): Write of 3360 bytes failed with errno=32 Broken pipe at /Users/.../Work/Mine/...-laravel/vendor/spatie/async/src/Runtime/ChildRuntime.php:42)
[stacktrace]
#0 /Users/.../Work/Mine/tcgengine-laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(254): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'fwrite(): Write...', '/Users/kirkbush...', 42)
#1 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}(8, 'fwrite(): Write...', '/Users/...', 42)
#2 /Users/.../Work/Mine/...-laravel/vendor/spatie/async/src/Runtime/ChildRuntime.php(42): fwrite(Resource id #3, 'Tzo0MToiU3BhdGl...')
#3 {main}
"} 

I'm not actually sure how to debug this, because I cannot log or dive any deeper, unfortunately.

Any ideas?

@kirkbushell
Copy link
Author

Looking further, it actually happens soon as I call:

Storage::disk('cloud')

Which points to the S3 configuration.

@kirkbushell
Copy link
Author

I figured it out. I moved the calls out of the async function and did a test, turns out I didn't have dependencies installed.

I think we need some way of escalating exceptions to the parent process. Currently it only shows the exception capture and flow that you use in the catch block.

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

1 participant