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

Mutagen sync command indefinite wait fix #100

Merged
merged 2 commits into from
Mar 1, 2020
Merged

Mutagen sync command indefinite wait fix #100

merged 2 commits into from
Mar 1, 2020

Conversation

Lunaetic
Copy link
Contributor

Check the output of 'mutagen sync list' for errors, and exit sync command if found, instead of indefinitely waiting.

…mand if found, instead of indefinitely waiting
if mutagen sync list --label-selector "warden-sync=${WARDEN_ENV_NAME}" \
| grep -i 'Last error' > /dev/null; then
>&2 printf "\033[31\nmmutagen encountered an error during sync.\033[0m"
>&2 printf "\nYou may be able to find out more about this error by running 'mutagen sync list'\n\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be a way to grab this last error, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at capturing the error line and grepping over it, thanks.

@Lunaetic
Copy link
Contributor Author

Forgot to leave testing steps originally. Can be tested by creating a symlink in the sync'd directory with a target outside the sync'd directory and calling warden sync start. It should exit and output the last mutagen error encountered, instead of waiting indefinitely.

@davidalger
Copy link
Collaborator

@Lunaetic Thank you very much for this valuable contribution. Ran a couple tests and it LG2M

$ ln -fsn /tmp/fail webroot/test-fail 
$ warden sync start
Created session sync_zVzJdP7maYOlYUiPJn7xJH2lpeT6jeoJXN2V3cBLzgg                
Waiting for initial synchronization to complete
......
Mutagen encountered an error during sync: alpha scan error: invalid symbolic link (test-fail): target is absolute
$ rm webroot/test-fail 
$ warden sync start
Created session sync_WTh17qqQeP7XVh83MoPaoo1kvZsO05N6iy4OiVjmwp9                
Waiting for initial synchronization to complete
...................
$ 
  • Successfully completes under "normal" conditions — pass
  • Exits with error message from Mutagen on failure — pass

@davidalger davidalger added this to the Warden 0.2.4 milestone Mar 1, 2020
@davidalger davidalger added bug Something isn't working enhancement New feature or request labels Mar 1, 2020
davidalger added a commit that referenced this pull request Mar 1, 2020
@davidalger davidalger merged commit 5157429 into wardenenv:develop Mar 1, 2020
@davidalger davidalger linked an issue Mar 1, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could not start env
3 participants