cweagans / ddev-mutagen

Set up a ddev project to use mutagen sync instead of osxfs.
10 stars 3 forks source link

Remove jq dependency and sanitize the site name #1

Closed facine closed 3 years ago

facine commented 4 years ago

Thank you very much for your work!

I have been doing tests and I have encountered the following problems:

I have made some changes that I hope may be helpful.

Please tell me if something is not correct.

# ddev mutagen start
rm: cannot remove 'phpstatus.php': No such file or directory
Failed to execute command rm phpstatus.php: exit status 1
rm: cannot remove 'html/docroot/test': No such file or directory
Failed to execute command rm -r html/docroot/test: exit status 1
Error: invalid session name: invalid name character at index 2: '.'
Waiting for initial sync to complete
Error: list failed: unable to locate requested sessions: specification "d8.dev" did not match any sessions
Sutharsan commented 4 years ago

I have not experienced the problems @facine experienced, but it is a matter of time until I run ddev start or ddev stop while not in the project root. So that alone justfies some changes.

But I have experienced a problem with generating .mutagen-sync-name that this PR fixed in an efficient manner. I have tested the modified script and it ran fine while starting/stopping ddev from both the project root and somewhere down the tree.

Problem description

I experienced long waiting time when mutagen is syncing files. With the original mutagen script, the generated .mutagen-sync-name file consisted of two lines:

drupal
null

Problem history

After ddev start, the terminal shows:

Executing post-start hook... 
=== Running task: Exec command 'ddev mutagen start' on the host (erik.home), output below 

And this stays there for many minutes. The size of the project is not very large. Drupal core with 11 contrib modules. Which should not take more than 1 minute to sync.

I stopped waiting after 5+ minutes and tracked it down to the .mutagen-sync-name file. Normally it contains one line, but now the content of the file was as shown above. The presence of this second line ('null') causes the delay.

I have not been able to reproduce the conditions under which this occurs, but it happened 3 times in a row. After some stopping and starting, and running a test script to investigate the output of ddev describe, the .mutagen-sync-name file now contains only one line ('drupal'). The problem did not re-occur.

cweagans commented 3 years ago

This was fixed with #6