pantheon-systems / terminus-site-clone-plugin

A Terminus plugin that adds the `site:clone` command to facilitate cloning sites on Pantheon
MIT License
21 stars 11 forks source link

Importing the database resulted in a `400 Bad Request` response: "Bad params\n" #13

Closed Nick-Hope closed 5 years ago

Nick-Hope commented 5 years ago

I am trying to clone a site with the terminus-site-clone-plugin in Ubuntu 18.04 using the command terminus site:clone see-life.dev see-life-web.dev but each time I try it I get this error:

...
 [notice] Finished backing up the database on the see-life.dev environment.
 [notice] Importing the database on see-life-web.dev...
 [error]  Client error: `POST https://terminus.pantheon.io/api/sites/89935d9f-a845-437b-866d-704d6c380d02/environments/dev/workflows` resulted in a `400 Bad Request` response:
"Bad params\n"

I have tried both with Drupal 8 installed and not installed in the target site, and with the mode set to both SFTP and Git.

(p.s. I'm trying to clone the site so I can play around with moving the docroot to /web without messing up the existing site)

ataylorme commented 5 years ago

Hi @Nick-Hope, Thank you for reporting your issue. I will see if I can recreate. What version of Terminus are you using?

I'm trying to clone the site so I can play around with moving the docroot to /web without messing up the existing site

For what its worth I don't think you need the site clone plugin. The web docroot is defined in pantheon.yml, which only applies to the environment it is committed to. This means you can enable the web docroot in a development environment, such as dev or multidev, without affecting the live site.

ataylorme commented 5 years ago

@Nick-Hope this seems to be a larger issue with Terminus and the underlying API request that database import makes. See this issue. Once that is resolved I expect this plugin will start working as expected.

Nick-Hope commented 5 years ago

Thank you @ataylorme. Sorry for missing those other issues.

For what it's worth, I'm running Terminus 1.9.0.

Re. my move to a /web docroot, I haven't pushed anything to the Test or Live environments yet; I only have a Dev environment. I'm just being super-careful because of the work that went into the site so far. Will do a bit of testing on a dummy test site before doing it on our main site.

ataylorme commented 5 years ago

For those following along the upstream fix in Terminus was part of the 2.0 release but the site clone plugin hasn't been updated for Terminus 2 yet, so databases will need to be migrated manually if you run into this.