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

Pantheon aliases disappear when paliases fails #187

Open
cboyden-ucb opened this issue Oct 10, 2014 · 6 comments
Open

Pantheon aliases disappear when paliases fails #187

cboyden-ucb opened this issue Oct 10, 2014 · 6 comments

Comments

@cboyden-ucb
Copy link

Sometimes when running drush paliases, I get this error:

$ drush paliases
Unable to fetch the aliases. Try again?

When that happens, the pantheon.aliases.drushrc.php is truncated:

$ ll pantheon.aliases.drushrc.php
-rw-------@  1 cboyden  staff     0 Oct 10 12:41 pantheon.aliases.drushrc.php

So all of the aliases disappear.

@joshkoenig
Copy link
Contributor

That's unexpected. If it's not able to fetch the aliases nothing should be written:

https://github.com/pantheon-systems/terminus/blob/master/terminus.drush.inc#L3628

However, we might be able to guard against that further by not initializing any file handler until aliases are successfully fetched.

This would require verifying alias writability differently here:

https://github.com/pantheon-systems/terminus/blob/master/terminus.drush.inc#L3593

@cboyden-ucb
Copy link
Author

paliases has been failing more often than not lately, and it still truncates the file every time.

@labboy0276
Copy link

I can confirm this is happening as well:

vagrant@kala:/etc/drush$ drush ta
Unable to fetch the aliases. Try again?                                                                                               [error]
vagrant@kala:/etc/drush$ ls -la
total 40
drwxrwxrwx  2 root    root     4096 Nov 20 16:38 .
drwxr-xr-x 90 root    root     4096 Nov 20 16:31 ..
-rwxrwxrwx  1 root    vagrant 15621 Oct 12 23:41 drushrc.php
-rw-rw-r--  1 vagrant vagrant  9968 Nov 20 11:58 kalastack.aliases.drushrc.php
-rw-r-----  1 vagrant vagrant     0 Nov 20 16:37 pantheon.aliases.drushrc.php
-rw-rw-r--  1 vagrant vagrant    47 Nov 20 16:38 terminatur.aliases.drushrc.php

@joshkoenig
Copy link
Contributor

Hey guys,

We can try escalating this to guard against the file being wiped by a failed request. Sorry for the trouble.

@ghost
Copy link

ghost commented Dec 17, 2014

I am experiencing the same issue. I also had trouble getting aliases in the past and the only thing that helps is waiting. Just now I had to try for almost an hour.

@mikevanwinkle
Copy link
Contributor

I think the answer here is probably to write to a temporary resource first and then mv to the destination after the fclose.

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

4 participants