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

Do some better erroring if you can't launch the mysql binary #11135

Merged
merged 1 commit into from
May 18, 2022

Conversation

uberbrady
Copy link
Collaborator

When an error happens during php artisan snipeit:restore, we give a rather generic error message.

This tries to:

  1. Set the standard-out and standard-error to non-blocking - so we can read as much or as little from those streams as is available, without blocking the rest of the process.
  2. We now wrap most of the process of reading from the .sql dump file around a try/catch . And if we have a failure to write to the pipe to mysql - either with a return of false from fwrite(), or via an exception - then we dump stdout and stderr to the logs, and to the console.

This should hopefully make it easier for us to troubleshoot when restores fail due to systems level issues. (Problems we've run into, in the wild - being unable to execute the mysql binary, and missing libraries that are necessary to run mysql).

@uberbrady uberbrady requested a review from snipe as a code owner May 18, 2022 00:12
@snipe snipe merged commit 11db243 into snipe:develop May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants