As in the subject. I’ve been doing some local development on my PC running shopware in docker. I’ve set up my /etc/hosts to point my target domain to 127.0.0.1 and I’ve set up the shop license domain in Settings->Account correctly (to my target domain). But I forgot to set my APP_URL unfortunately. I’ve installed and uninstalled a free app in the meantime. I would like to change that APP_URL from localhost to my target domain, but if I do that I can’t reinstall that free app, because it complains:
[Shopware\Core\Framework\App\Exception\AppRegistrationException]
The app url changed. Please resolve how the apps should handle this change.
I had a look at the code and I found this config property that contains the previous APP_URL:
core.app.shopId
So when I run
bin/console system:config:get core.app.shopId
It indeed comes back with:
http://localhost
XXXXXXXXXXXXXXX
Can I simply delete this config value or update it? Will it break more stuff? I have added a lot of data to this install so I’d rather not break it.
I also found in the code this snippet in ShopIdProvider.php
if (EnvironmentHelper::getVariable('APP_URL') !== ($shopId['app_url'] ?? '')) {
if ($this->hasApps()) {
/** @var string $appUrl */
$appUrl = EnvironmentHelper::getVariable('APP_URL');
throw new AppUrlChangeDetectedException($shopId['app_url'], $appUrl);
}
// if the shop does not have any apps we can update the existing shop id value
// with the new APP_URL as no app knows the shop id
$this->systemConfigService->set(ShopIdProvider::SHOP_ID_SYSTEM_CONFIG_KEY, [
'app_url' => EnvironmentHelper::getVariable('APP_URL'),
'value' => $shopId['value'],
]);
}
This appears to suggest my APP_URL should be updateable as long as there are no apps installed, but that is not the case. I had no installed apps when I changed APP_URL, and then I only get the error when I try to install a free app.
Does anyone have any ideas?