-
Notifications
You must be signed in to change notification settings - Fork 2
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
Snapshots WP CLI commands are not executed at all #59
Comments
A potential solution is to execute all the
Did we choose to launch the Edit: Also switching |
I can confirm @kmgalanakis's report, as I had similar problems where I couldn't pull or download snapshots. In fact, in my case, using
It looks like on Windows, the So, my temporary workaround to have snapshots work was to modify
to that:
and with some refactoring to make sure that in the event of undefined values no warnings would return (but the result is the same):
Then, running the command with the
And the same goes for pull:
To be honest, I'm not sure why I had to pass the |
The reason you have to use the Apart from that, I am still unable to run any wp-cli command from within the package if I keep I don't know if it's only my environment but for me, the snapshot pulling is failing in so many places and I don't know if I should spend more time on that at the moment. |
I create a Windows VM and installed everything from scratch (Windows, Git, LocalWP, Snapshots). I also followed @gsarig suggestion to adjust the snapshots directory. Now when I try to run
I don't know what is that "specified path" that cannot be found. The tar-related error is only relevant because the actual snapshot archive hasn't been downloaded. Apart from that, what I mentioned in this comment is still relevant to me. Any idea how I could figure out what this path that cannot be found is? |
I'm not 100% on this as I don't have a Windows system to test, but it could be related to paths and how we use them in the codebase. I think there are a couple of issues: The initial issue shows this error:
This is likely to do with an unquoted path being passed as an argument, which means that the space in The second issue I'm seeing is in the comment above:
This seems to be happening whilst the snapshot is downloading. Tracing the code back through how that works, leads me to believe it could be related to snapshots/includes/classes/SnapshotsDirectory.php Lines 232 to 236 in 806a319
One of the things making me think this could be the issue is this line:
Notice we have mixed forward and backslashes. The other issue it could be, is the one flagged by @gsarig, where we're using
WP-CLI does contain an @kmgalanakis, to help us narrow down the issue, could you try running the pull command again, but this time with the
I'm hopeful that this will give us more insight into what's happening in those failing internal WP-CLI functions. |
@darylldoyle @kmgalanakis A few additional findings... I installed it on a new WSL2 instance (Debian), following these instructions. It seems to work almost fine (at least with the caveats mentioned in the topic). When I tried to run
Hoping that it was just an issue with the double slash, I edited
Given that this is now tested on Debian, even if it's WSL2 and not "real" Linux, I wonder if this is a Windows specific problem, or if it happens on Linux as well. |
@darylldoyle @kmgalanakis I managed to make it work on WSL2, as it only needed me to install It isn't pretty and it doesn't update the hosts file automatically like the Windows version, but on the other hand, installing everything else (git, php, node etc) on Linux is not the pain that it is on Windows. I pulled a snapshot and pushed one as well, with no issues at all. In fact, despite its flaws, I think that I will stick to this setup as the Linux terminal is more familiar and faster than CMD. Here are the steps that I took, for anyone who would like to try it out (I hope I'm not forgetting something):
To
You can find the socket here: |
Hello @darylldoyle. Apparently, the errors I was getting with launching any WP-CLI command via I've created a PR which I believe fixes all the Windows-related issues. I've tested it on a Windows VM, where I tried everything from scratch, documenting the process every step of the way. @gsarig In my VM I only used LocalWP, Git, Grep and Gzip for Windows. All apps were installed as normal Windows apps (not via WSL). All the CLI interaction was done with the LocalWP shell. Even though unit tests are passing, I would really like the branch to also be tested in Linux and MacOS machines. |
Describe the bug
I was trying to download a snapshot via the LocalWP shell in Windows and even though I was getting no errors, the snapshot was never downloaded.
Debugging the code, I realized that the WP CLI commands are not executed and this is the output I get for the failed snapshot download WP CLI command (
wp snapshots download f3e0b62aa868982e1e53776fa769a5ab --quiet --repository=10up --include_db --include_files
)Steps to Reproduce
wp snapshots pull f3e0b62aa868982e1e53776fa769a5ab
Screenshots, screen recording, code snippet
Environment information
WordPress information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: