cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 48 forks source link

Server error 500 when downloading after changing domain name #195

Closed slam-campup closed 1 year ago

slam-campup commented 1 year ago

We change the domain name of our satispress server from plugins.domain_a.com to plugins.domain_b.com. Now composer install and composer update throw errors.

I've removed the lock file thinking something might have changed regarding the shasums, but that didn't help. Composer update results in the error. I have confirmed all the zip files are in the satispress directory on the server.

The "https://plugins.domain_b.org/satispress/advanced-ads-tracking/2.3.7" file could not be downloaded (HTTP/2 500 )

curl -I on that file returns

url -I https://plugins.campaignupgrade.org/satispress/advanced-ads-tracking/2.3.7
HTTP/2 401
server: nginx
date: Thu, 03 Nov 2022 23:55:13 GMT
content-type: text/html; charset=UTF-8
www-authenticate: Basic realm="SatisPress"
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0
strict-transport-security: max-age=31536000; includeSubDomains

When trying to access the download file URL, WordPress front end displays:

There has been a critical error on this website.

Finally, debug log reports this error:

[04-Nov-2022 00:24:44 UTC] PHP Fatal error: Uncaught TypeError: preg_replace(): Argument #3 ($subject) must be of type array|string, bool given in /sites/plugins.doamin_b.org/files/wp-content/plugins/satispress/src/Provider/RequestHandler.php:149

Stack trace:

#0 /sites/plugins.doamin_b.org/files/wp-content/plugins/satispress/src/Provider/RequestHandler.php(149): preg_replace()

#1 /sites/plugins.doamin_b.org/files/wp-content/plugins/satispress/src/Provider/RequestHandler.php(162): SatisPress\Provider\RequestHandler->send_header()

#2 /sites/plugins.doamin_b.org/files/wp-content/plugins/satispress/src/Provider/RequestHandler.php(102): SatisPress\Provider\RequestHandler->send_headers()

#3 /sites/plugins.doamin_b.org/files/wp-includes/class-wp-hook.php(308): SatisPress\Provider\RequestHandler->dispatch()

#4 /sites/plugins.doamin_b.org/files/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()

#5 /sites/plugins.doamin_b.org/files/wp-includes/plugin.php(565): WP_Hook->do_action()

#6 /sites/plugins.doamin_b.org/files/wp-includes/class-wp.php(399): do_action_ref_array()

#7 /sites/plugins.doamin_b.org/files/wp-includes/class-wp.php(780): WP->parse_request()

#8 /sites/plugins.doamin_b.org/files/wp-includes/functions.php(1332): WP->main()

#9 /sites/plugins.doamin_b.org/files/wp-blog-header.php(16): wp()

#10 /sites/plugins.doamin_b.org/files/index.php(17): require('...')

#11 {main}

thrown in /sites/plugins.doamin_b.org/files/wp-content/plugins/satispress/src/Provider/RequestHandler.php on line 149
slam-campup commented 1 year ago

Solved!

Updated to 1.04 using wp plugin install --activate https://github.com/cedaro/satispress/releases/download/v1.0.4/satispress-1.0.4.zip

Deleted lock file.

Ran composer install

bradyvercher commented 1 year ago

@slam-campup Thanks for the update!