Describe the bug
Connecting to Jetpack & WC Services gives errors and takes some retries when running on GoDaddy managed hosting.
To Reproduce
Create a new site on GoDaddy hosting.




Expected behavior
Smooth(er) connection with Jetpack and WC Services.
Desktop (please complete the following information):
Additional context
tested on xkj.504.myftpupload.com accessible via WC Test credentials, I can provide wp admin credentials if needed, but there are no errors in the log.
@peterfabian thanks for the report.
Looks like there are a couple of bugs that are happening here. The first of which appears related to #3470 - the failures happening on the install and activation of Jetpack/WCS - here is the error log being thrown on the GoDaddy test site:
2020-01-06T20:33:21+00:00 CRITICAL require_once(): Failed opening required '/var/www/wp-content/plugins/jetpack/_inc/lib/class.media.php' (include_path='.:/opt/remi/php72/root/usr/share/pear:/opt/remi/php72/root/usr/share/php:/usr/share/pear:/usr/share/php') in /var/www/wp-content/plugins/jetpack/class.jetpack.php on line 41
This manifests itself on the front-end in the failing API request and the retry being shown:

My theory at this point is the request to install the plugin succeeds but we are attempting to activate the plugin before everything is "fully installed". Like the zip hasn't fully extracted yet which is leading to the error seen above.
If you wait a bit between the plugin install, and the activation step, all seems to work fine - which makes me wonder if we add a sleep on the install step, or perhaps set a timeout in the JS code between the install and activation steps that might be a low-key hack on how to fix this.
The good news is, testing this on GoDaddy leads to the bug happening almost every time - so we might be able to use this test account to test some of these theories.
/cc @joshuatf
The other bug which I hit earlier today too was when the Jetpack connection process fails on the first attempt - so what Peter has in step 6 here. It appears that the calypso logic that retries this connection doesn't properly persist the redirect_uri url parameter, which results in being deposited on the Jetpack screen back in wp-admin. If so, we should open up a bug in calypso accordingly, and look into fixing that problem there.
Spent a good chunk of the day testing this to not much avail. Here's what I found out:
Destination folder already exists. (even though this plugin is deleted and checking via FTP does not show any folders with this name).Thanks for all the research @joshuatf - seems like we are still chasing an elusive, hard to diagnose bug here. So interesting to see though that most of the failures you had were with WCS and not Jetpack - in my testing it was the other way around. I also think the more we re-use a test site, the more likely the destination folder already exists gets hit.
Just confirming with @peterfabian that we can delete the test site and start from scratch. That might be a good option to explore.
Alternatively we have the logging in place so we can get more data around how often this problem is being hit.
Ultimately, while not ideal, we have the following things working in our favor here:
Feel free to delete the site I created (xkj.504.myftpupload.com) and/or create a new one, no problem.
I've been trying to figure out why the Jetpack plugin wasn't installing for a few days now. I found this thread and had a long-winded "but why isn't it working" question.
I'm working with Godaddy shared hosting as well.
But apparently whatever changes y'all made were included in WooCommerce 3.9.3 released yesterday.
I updated WooCommerce and Jetpack installed and is working awesome. Thank you!
Yup, 3.9.3 includes a couple of fixes for the latest Jetpack versions. Glad it fixed your problems!
In all of my recent 4.0 testing I haven't encountered this again, so I'm closing this out.