fortrabbit / craft-copy

Deployment tools for Craft on fortrabbit
https://www.fortrabbit.com
MIT License
73 stars 8 forks source link

copy/code/down fails on ddev #179

Closed mierla closed 6 months ago

mierla commented 1 year ago

Hi, trying to pull down a copy of my fortrabbit app to a new workstation. I have been using Copy with this app and a different local machine successfully for many months.

On the new machine, I followed the ddev Craft quickstart instructions to get a fresh Craft install, and then this fortrabbit article to get craft-copy set up. Installation and setup complete successfully, and copy/db/down works without incident, but copy/code/down fails with the following:

[ERROR] Ooops.

Error while running git command:
'git' '--git-dir' '/var/www/html/.git' '--work-tree' '/var/www/html' 'pull' 'my-app-name' 'master'

hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: 'my-app-name' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
dgaidula commented 1 year ago

Is this Craft 3 or 4? I use craft copy extensively with DDEV. This looks more like an issue with your repos, can you follow the hints and do a pull of the FR deploy repo? (The hints usually are correct when it comes to git issues.)

mierla commented 1 year ago

Thanks for the reply. This is Craft 4, latest version. Forgive my ignorance: given that this is a brand-new local installation with no customization or anything other than the base Craft install and craft-copy, which hint option should I pick? I'm so skittish about messing up anything on the FR repo...

dgaidula commented 1 year ago

Okay, I reread all the information that you have provided. I think you just didn't provide the proper app name during the setup since the message says 'my-app-name' which is a placeholder.

Check the following on your new local install of craft.

go to this folder: './config/craft-copy'

It will contain yaml files that correspond with each of the FR apps that are connected via craft/copy.

fortrabbit.{stage-name}.yaml

open this file in a text editor and make sure that app: is the name of your FR app and not 'my-app-name' and that the ssh_url is correct as listed in the FR dashboard for this app.

Once those are correct try again.

mierla commented 1 year ago

Thanks, dgaidula. I should've been clearer: the ssh_url is correct in the yaml file, and matches the config on the working workstation. I changed it to 'my-app-name' in the posted error code out of some vague, probably unnecessary desire to keep my customer/client's identity out of the issue report.

Still, copy/db/down works; copy/code/down fails with the same error message as before; copy/volumes/down appears to connect, presents the first volume for y/n confirmation, and then fails with

A B O R T E D

  !! Command exited with non-zero result.

rsync error: unexplained error (code 255) at main.c(1819) [Receiver=3.2.3]
rsync: [Receiver] write error: Broken pipe (32)
dgaidula commented 1 year ago

you can copy/code/up and copy/code/down on the other workstation?

If you know that the other local workstation has updated code, then I would try to copy/code/up from the new workstation.

Then go back to other work station with working code and copy/code/up then go to new workstation and copy/code/down.

I have also had situations where the git deploy repo is permanently corrupted and I just reset it. (Of course don't do this unless you have a good local repo somewhere.)

In my opinion, the deploy repo should not be used as an origin for your code. you should be using private github or bitbucket, etc. as the origin and just use FR as the deploy repo which can be erased/reset at any time.

Good luck. I'll be interested to know if this helps.

mierla commented 1 year ago

You know, that's a really good point: I do have a private, up-to-date github repo for this app. I think I'll do what you're suggesting and use that instead for ongoing work between the two workstations. Thank you!

To answer your other question: I can certainly copy/code/up from the old workstation. I've not tried copy/code/down. I had thought I'd found the problem in a mismatch between the newly installed bare Craft install (4.5.6.1) and the FR Craft install (4.5.6), but updating FR to 4.5.6.1 didn't resolve the error message, so I dunno. You may very well be right and the deploy repo is borked.

erinbit commented 6 months ago

Hi, this definitely looks like some local git setup troubles, and maybe not an issue with craft copy.

Did you manage to resolve this on your own with the help provided here?

erinbit commented 6 months ago

Closing this now as it looks to be resolved. Please write a new reply if you have this issue again.