This repository contains the production template that enables you to build, package and deploy Shopware 6 to production shops.
Please refer to the documentation for instructions on how to use this template.
Shopware 6 production template
Home Page: https://shopware.com
This repository contains the production template that enables you to build, package and deploy Shopware 6 to production shops.
Please refer to the documentation for instructions on how to use this template.
I know this worked in an older version, so it is probably a regression but with 6.3.5.0 it is not possible to call system:setup without providing APP_URL
as env variable which does not make sense as that command is supposed to initialize those variables.
What works though is APP_URL=http://localhost bin/console system:setup
but that seems unnecessary complicated. It then asks for the hostname again, so this is kind of weird.
Normally we do live deployments by executing composer install --no-dev
because dev-dependencies are usually only libraries which are necessary for development. But as
Line 24 in f074309
composer install --no-dev
the script outputs Class 'Symfony\Component\Stopwatch\Stopwatch' not found
and also shopware is not accessible anymore afterwards when calling the main frontend page in the browser:
[2020-12-07 15:00:14] php.CRITICAL: Uncaught Error: Class 'Symfony\Component\Stopwatch\Stopwatch' not found {"exception":"[object] (Error(code: 0): Class 'Symfony\\Component\\Stopwatch\\Stopwatch' not found at /var/www/clients/client1/web5/web/var/cache/prod_h6432a14500eab110fc61b224ee38144a/ContainerSY7WmwQ/srcShopware_Production_KernelProdContainer.php:12914)"} []
[2020-12-07 15:00:20] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\ClassNotFoundError: "Attempted to load class "Stopwatch" from namespace "Symfony\Component\Stopwatch". Did you forget a "use" statement for another namespace?" at /var/www/clients/client1/web5/web/var/cache/prod_h6432a14500eab110fc61b224ee38144a/ContainerSY7WmwQ/srcShopware_Production_KernelProdContainer.php line 12914 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\ClassNotFoundError(code: 0): Attempted to load class \"Stopwatch\" from namespace \"Symfony\\Component\\Stopwatch\".\nDid you forget a \"use\" statement for another namespace? at /var/www/clients/client1/web5/web/var/cache/prod_h6432a14500eab110fc61b224ee38144a/ContainerSY7WmwQ/srcShopware_Production_KernelProdContainer.php:12914)"} []
[2020-12-07 15:00:20] php.CRITICAL: Uncaught Error: Argument 2 passed to Shopware\Core\System\SalesChannel\Context\SalesChannelContextService::get() must be of the type string, null given, called in /var/www/clients/client1/web5/web/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php on line 297 {"exception":"[object] (TypeError(code: 0): Argument 2 passed to Shopware\\Core\\System\\SalesChannel\\Context\\SalesChannelContextService::get() must be of the type string, null given, called in /var/www/clients/client1/web5/web/vendor/shopware/storefront/Framework/Routing/StorefrontSubscriber.php on line 297 at /var/www/clients/client1/web5/web/vendor/shopware/core/System/SalesChannel/Context/SalesChannelContextService.php:65)"} []
So it seems to me that some dependencies which are currently in require-dev
are actually necessary not only for development but also for running a shopware application.
I would like to use the provided Dockerfile to build the current state of our Shopware system with a custom theme and some custom blocks to be easily deployable.
The problem is that the bin/console assets:install
requires a working database connection.
Step 13/16 : RUN bin/console assets:install && rm -Rf var/cache && touch install.lock && mkdir -p var/cache
---> Running in fdb1d49afc28
In AbstractMySQLDriver.php line 93:
An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddr
esses: getaddrinfo failed: Name does not resolve
This is highly unusual, as Dockerfiles should work without such dependencies. Is there any way to work around this issue and make the command work without a database?
After cloning the repo and installing dependencies when running bin/console system:setup
env variable is missing:
In EnvVarProcessor.php line 171:
Environment variable not found: "APP_URL".
Hi
If you install the SW6 from the production repo from GitHub, through the CLI in dev mode, and try to set AWS S3 as file storage, the storefront does not build path to the style sheet correctly
instead of myawsbucket.com/theme/.../all.css
it does /theme/.../all.css
It works for images and other assets, and the css is there in the bucket
Any ideas?
UPDATE:
It seems that is known bug, is going to be updated on next release
https://issues.shopware.com/issues/NEXT-6651
Regarding Top Sellers -widely sold items- i was wondering if such a feature is expected to be developed in Shopware 6, as in Shopware 5 (slider block showing Top Sellers, and sorting products in category pages based on the total amount of sold items).
Since this is the "production" template no composer dev-dependencies should be needed
currently after running
composer install --no-dev
there are multiple errors because of refernced dev-components - e.g.
php.CRITICAL: Uncaught Error: Class 'Symfony\Component\Stopwatch\Stopwatch' not found
While using composer together with the production template i stumbled upon some issues:
Some of the plugins we use require shopware/platform. As this package replaces core, storefront, administation and elasticsearch these are never downloaded.
system:install
seems clever enough to check both paths (platform and core) for the schema.sql. the web based installer is not and throws an error.bin/console
as it only checks for the version of shopware/core although it has been replaced by the platform package. This can be fixed by catching the exception and use the platform version instead.Is it not intended to use the platform package in a production-template-based project or am i overlooking something here?
Any help would be much appreciated.
When updating a Shopware System, the SystemUpdateFinishCommand is called as post-install-cmd.
This subsequently calls the database:migrate Command, but not the database:migrate-destructive.
But then this Migration is not executed: shopware/vendor/shopware/core/Migration/Migration1566293076AddAutoIncrement.php which leads to the following error:
> [ ! -f install.lock ] || bin/console system:update:finish
Run Post Update
Get collection from directories
migrate Migrations
0/87 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0%
4/87 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░] 4%
9/87 [==░░░░░░░░░░░░░░░░░░░░░░░░░░] 10%
15/87 [====░░░░░░░░░░░░░░░░░░░░░░░░] 17%
18/87 [=====░░░░░░░░░░░░░░░░░░░░░░░] 20%
27/87 [========░░░░░░░░░░░░░░░░░░░░] 31%
32/87 [==========░░░░░░░░░░░░░░░░░░] 36%
35/87 [===========░░░░░░░░░░░░░░░░░] 40%
40/87 [============░░░░░░░░░░░░░░░░] 45%
44/87 [==============░░░░░░░░░░░░░░] 50%
48/87 [===============░░░░░░░░░░░░░] 55%
51/87 [================░░░░░░░░░░░░] 58%
53/87 [=================░░░░░░░░░░░] 60%
58/87 [==================░░░░░░░░░░] 66%
61/87 [===================░░░░░░░░░] 70%
66/87 [=====================░░░░░░░] 75%
70/87 [======================░░░░░░] 80%
73/87 [=======================░░░░░] 83%
79/87 [=========================░░░] 90%
87/87 [============================] 100%
---------- ----------------------
Action Number of migrations
---------- ----------------------
Migrated 87 out of 87
---------- ----------------------
all migrations executed
cleared the shopware cache
In AbstractMySQLDriver.php line 60:
An exception occurred while executing 'SELECT `category`.`id` as `category.
id`, `category`.`version_id` as `category.versionId`, `category`.`parent_id
` as `category.parentId`, `category`.`parent_version_id` as `category.paren
tVersionId`, `category`.`after_category_id` as `category.afterCategoryId`,
`category`.`after_category_version_id` as `category.afterCategoryVersionId`
, `category`.`media_id` as `category.mediaId`, `category`.`display_nested_p
roducts` as `category.displayNestedProducts`, `category`.`auto_increment` a
s `category.autoIncrement`, `category`.`level` as `category.level`, `catego
ry`.`path` as `category.path`, `category`.`child_count` as `category.childC
ount`, `category`.`type` as `category.type`, `category`.`visible` as `categ
ory.visible`, `category`.`active` as `category.active`, `category`.`cms_pag
e_id` as `category.cmsPageId`, `category`.`created_at` as `category.created
At`, `category`.`updated_at` as `category.updatedAt`, `category.translation
`.`name` as `category.translation.name`, `category.translation`.`name` as `
category.name`, `category.translation`.`breadcrumb` as `category.translatio
n.breadcrumb`, `category.translation`.`breadcrumb` as `category.breadcrumb`
, `category.translation`.`slot_config` as `category.translation.slotConfig`
, `category.translation`.`slot_config` as `category.slotConfig`, `category.
translation`.`external_link` as `category.translation.externalLink`, `categ
ory.translation`.`external_link` as `category.externalLink`, `category.tran
slation`.`description` as `category.translation.description`, `category.tra
nslation`.`description` as `category.description`, `category.translation`.`
meta_title` as `category.translation.metaTitle`, `category.translation`.`me
ta_title` as `category.metaTitle`, `category.translation`.`meta_description
` as `category.translation.metaDescription`, `category.translation`.`meta_d
escription` as `category.metaDescription`, `category.translation`.`keywords
` as `category.translation.keywords`, `category.translation`.`keywords` as
`category.keywords`, `category.translation`.`custom_fields` as `category.tr
anslation.customFields`, `category.translation`.`custom_fields` as `categor
y.customFields`, `category.translation`.`created_at` as `category.translati
on.createdAt`, `category.translation`.`updated_at` as `category.translation
.updatedAt`, `category.translation`.`category_id` as `category.translation.
categoryId`, `category.translation`.`language_id` as `category.translation.
languageId`, `category.translation`.`category_version_id` as `category.tran
slation.categoryVersionId` FROM `category` LEFT JOIN `category_translation`
`category.translation` ON `category.translation`.`category_id` = `category
`.`id` AND `category.translation`.`language_id` = ? AND `category.translati
on`.`category_version_id` = `category`.`version_id` WHERE (`category`.`vers
ion_id` = ?) AND (`category`.`id` IN (?, ?, ?, ?, ?, ?, ?))' with params ["
\x2f\xbb\x5f\xe2\xe2\x9a\x4d\x70\xaa\x58\x54\xce\x7c\xe3\xe2\x0b", "\x0f\xa
9\x1c\xe3\xe9\x6a\x4b\xc2\xbe\x4b\xd9\xce\x75\x2c\x34\x25", "\x26\x23\x0e\x
fc\x8c\x0a\x48\x32\xbf\x0a\xd9\x14\x34\x68\x81\x8c", "\xb8\x26\xb4\xcc\xb1\
xac\x4b\x2e\x85\x0c\x02\x90\x23\x80\x3d\x79", "\xc1\x5f\x40\xe7\x20\x27\x40
\x24\xa9\x12\x3d\x52\x0c\x1c\x8f\xa3", "\x70\x55\xd7\x96\x32\x97\x4c\x02\xa
0\x76\x76\x53\x8b\xf0\x67\xf6", "\xb0\x47\x8d\x41\x40\xcd\x41\xeb\x85\xb8\x
fc\x51\x35\x47\x3f\x72", "\x07\xb1\xdf\x38\xe0\x3c\x46\x6a\x80\x57\x72\x72\
x7c\x08\x49\x35", "\xfe\x28\x34\x10\x79\x73\x48\xbf\xad\xff\xc7\xdd\x59\x13
\x84\xa5"]:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category.auto_incre
ment' in 'field list'
In PDOStatement.php line 123:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category.auto_incre
ment' in 'field list'
In PDOStatement.php line 121:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category.auto_incre
ment' in 'field list'
system:update:finish [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
Script [ ! -f install.lock ] || bin/console system:update:finish handling the post-install-cmd event returned with error code 1
Is there a timeframe when the docker image is not experimental anymore?
I've been trying to set shop ware via docker up and I can get to the login screen but even when creating a new user via the cli I just cannot login.
Something went wrong requesting "".
Shopware is supposed to run behind Traefik, but when deleting all the data and retrying the setup via the web installation wizard I get to put in admin user etc, and then there is an error showing. The Error says
Slim Application Error
The application could not run because of the following error:
Details
Type: Shopware\Recovery\Common\HttpClient\ClientException
Code: 7
Message: Failed to connect to changedwebsite.com port 80: Connection refused
File: /sw6/vendor/shopware/recovery/Common/src/HttpClient/CurlClient.php
Line: 97
Trace
#0 /sw6/vendor/shopware/recovery/Common/src/HttpClient/CurlClient.php(35): Shopware\Recovery\Common\HttpClient\CurlClient->call('http://dev.dogg...', 'POST', Array, '{"grant_type":"...')
#1 /sw6/vendor/shopware/recovery/Install/src/app.php(514): Shopware\Recovery\Common\HttpClient\CurlClient->post('http://dev.dogg...', '{"grant_type":"...', Array)
#2 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#3 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#4 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Object(Closure), Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#6 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#7 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#8 /sw6/vendor/shopware/recovery/Install/src/app.php(158): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#9 [internal function]: Closure->{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#10 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#11 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#12 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\App))
#13 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#14 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#15 /sw6/vendor/shopware/recovery/Common/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#16 /sw6/vendor/shopware/recovery/Install/index.php(51): Slim\App->run()
#17 /sw6/public/recovery/install/index.php(6): require_once('/sw6/vendor/sho...')
#18 {main}
According to a commit PHP8 support was added in the 6.4
branch but according to the composer.json
it only works with >= 7.4.0
and < 8
: https://github.com/shopware/production/blob/6.4/composer.json#L47
please add the corresponding || ^8.0
. You probably did not notice due to: https://github.com/shopware/production/issues
When using the webpack dev server for the administration, the server starts up fine, the login page is shown but I'm never able to login: it makes the request for the token, but then just reloads the login screen.
The proxy of the webpack dev server is working fine, if I do the request for the token using curl or fetch (in the browser), I can see the token in the response.
We are currently trying to setup a new shop at a hoster that has binary logging active for the database.
The system:install command fails with the following error:
ERROR [app] Migration: "Shopware\Core\Migration\Migration1580218617RefactorShippingMethodPrice" failed: "An exception occurred while executing 'CREATE TRIGGER shipping_method_price_new_price_update BEFORE UPDATE ON shipping_method_price ...... SQLSTATE[HY000]: General error: 1419 You do not have the SUPER privilege and binary logging is enabled
Previously we could get around this by disabling BLUE_GREEN_DEPLOYMENT in the .env file.
A little while ago, a change was made to the system:install command enforcing BLUE_GREEN_DEPLOYMENT:
Is there some workaround for setups where binary logging is active?
Hi,
unfortunately the custom / plugin folder is missing in the template and the configuration for it in composer.json.
Probably just a .gitkeep is missing here.
It would also be great if you already provided a distinction between store- and project-specific plugins.
Hi all!
I was planning to contribute a helm chart to all for Shopware 6 (you can see an initial draft here). But I hit a stone: there's no public Docker image available at Docker Hub. I can see there's already a Dockerfile, so, is it possible to deploy setup a pipeline to deploy it as well?
I already built my project using composer install and docker build in one of my build pipelines, but I used a private Docker registry to keep the image, would be really great to have the official image published publicly. I could do it, but as Shopware already have a space there, I thought this step is probably trivial.
Let me know how I can help.
In the .env.dist file the ElasticSearch environment variables still contain the string "SES", which was changed to "ES" quite some time ago:
shopware/development@e7e55b8#diff-5d6aaa818bfced97dd2a2418a00d6af3
There is a reason why var/plugins.json
is part of the files to commit. I don't get it yet as I have a problem with. Hopefully you can explain why it should be commited. Everytime the plugins.json is generated it starts to contain absolute paths:
{
"Framework": {
"basePath": "vendor\/shopware\/core\/Framework\/",
"views": [
"Resources\/views"
],
"technicalName": "framework",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"System": {
"basePath": "vendor\/shopware\/core\/System\/",
"views": [
"Resources\/views"
],
"technicalName": "system",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"Content": {
"basePath": "vendor\/shopware\/core\/Content\/",
"views": [
"Resources\/views"
],
"technicalName": "content",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"Checkout": {
"basePath": "vendor\/shopware\/core\/Checkout\/",
"views": [
"Resources\/views"
],
"technicalName": "checkout",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"Profiling": {
"basePath": "vendor\/shopware\/core\/Profiling\/",
"views": [
"Resources\/views"
],
"technicalName": "profiling",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"Administration": {
"basePath": "vendor\/shopware\/administration\/",
"views": [
"Resources\/views"
],
"technicalName": "administration",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"Storefront": {
"basePath": "vendor\/shopware\/storefront\/",
"views": [
"Resources\/views"
],
"technicalName": "storefront",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": "Resources\/app\/administration\/src\/main.js",
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": "Resources\/app\/storefront\/src\/main.js",
"webpack": null,
"styleFiles": [
"\/Users\/joshua\/Code\/production\/vendor\/shopware\/storefront\/Resources\/app\/storefront\/src\/scss\/base.scss",
"@Plugins"
]
}
},
"Elasticsearch": {
"basePath": "vendor\/shopware\/elasticsearch\/",
"views": [
"Resources\/views"
],
"technicalName": "elasticsearch",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": null,
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": null,
"webpack": null,
"styleFiles": []
}
},
"Foobar": {
"basePath": "vendor\/foobar\/foobar\/src\/",
"views": [
"Resources\/views"
],
"technicalName": "foobar-foobar",
"administration": {
"path": "Resources\/app\/administration\/src",
"entryFilePath": "Resources\/app\/administration\/src\/main.js",
"webpack": null
},
"storefront": {
"path": "Resources\/app\/storefront\/src",
"entryFilePath": "Resources\/app\/storefront\/src\/main.js",
"webpack": null,
"styleFiles": [
"@Storefront",
"\/Users\/joshua\/Code\/production\/custom\/static-plugins\/FooBar\/src\/Resources\/app\/storefront\/src\/style\/base.scss"
]
}
}
}
There is never a reason to commit content with absolute paths. My choice: ignore this file. Other choice is make the path relative but I am not sure yet whether the absoluteness is needed.
Description
I installed regarding https://github.com/shopware/production#setup-and-install (folder sw61)
But at the end, I got redirected to recovery/install cause the install.lock hasn't been created.
After creating this file manually, shop was accessible.
Hi, this is more of a question.
I am trying to transfer media to another server/instance of shopware. I was thinking that copying media folder would be enough. If I inspect the same href on image:
a) current instance media/e0/a7/27/1606814803/01n_bg.jpg
b) new instance (with imported db from current instance) media/2c/d8/20/1606814803/01n_bg.jpg
I see that ids are the same, though uri structure differs.
Is this expected? Any help would be appreciated how to successfully transfer images.
Hello Delevoper team,
When I run the <rootdir>/bin/build-administration.sh or <rootdir>/bin/build-shopware.sh script, I always get this error " Definition file does not exists". See the error message below.
I have not found a solution to fix the error. Is this a general problem?
At first glance it seems to me that it is in the file
<rootdir>/vendor/shopware/storefront/Resources/app/storefront/node_modules/@shopware-ag/webpack-plugin-injector/index.js
The environment variable
const projectRoot = process.env.PROJECT_ROOT || '';
not handed over. It is always empty.
`<rootdir>/vendor/shopware/administration/Resources/app/administration/node_modules/@shopware-ag/webpack-plugin-injector/index.js:128
throw new Error('Definition file does not exists');
^
Error: Definition file does not exists
at WebpackPluginInjector.getPluginDefinitionContent (<rootdir>/vendor/shopware/administration/Resources/app/administration/node_modules/@shopware-ag/webpack-plugin-injector/index.js:128:19)
at new WebpackPluginInjector (<rootdir>/vendor/shopware/administration/Resources/app/administration/node_modules/@shopware-ag/webpack-plugin-injector/index.js:81:28)
at Object. (<rootdir>/vendor/shopware/administration/Resources/app/administration/build/webpack.prod.conf.js:67:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (<rootdir>/vendor/shopware/administration/Resources/app/administration/build/build.js:11:23)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)`
Describe the bug
"post-install-cmd" in the composer.json calls the system:update:finish
command. In this command there is the function installAssets
witch calls the assert:install
with a --no-cleanup
flag.
But in the AssetInstallCommand there is no --no-cleanup
option, this causes a error described below.
To Reproduce
Steps to reproduce the behavior:
Actual behavior
Error assets:install has no "--no-cleanup" option
Expected behavior
dependence installed and [OK] Successfully copied all bundle files
Environment
Additional context
all migrations executed
cleared the shopware cache
14:07:54 ERROR [console] Error thrown while running command "system:update:finish". Message: "The "--no-cleanup" option does not exist." ["exception" => Symfony\Component\Console\Exception\InvalidOptionException { …},"command" => "system:update:finish","message" => "The "--no-cleanup" option does not exist."]
The "--no-cleanup" option does not exist.
system:update:finish [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
``
I got this error if i try to change the password for a user:
vendors-node.js?15858533151360952:1 DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
at Object.insertBefore (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1014489)
at https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1033052
at A (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1033340)
at https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1032863
at A (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1033340)
at s.__patch__ (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1034477)
at s.e._update (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1007941)
at s.i (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1041709)
at mn.get (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1000267)
at mn.run (https://shop.baeckerei-classen.de/bundles/administration/static/js/vendors-node.js?15858533151360952:1:1001151)
When executing system:update:finish
e.g. due to a composer require
the command fails when it tries to execute migrations for identifier
Shopware\\
which makes sense as this is a namespace and not an identifier.
Shouldn't it just execute all migrations for all identifiers instead? And if not, wouldn't I at least need to add additional custom plugins there later on? For shopware it would instead be core
, Framework
, StoreFront
, etc.?
Currently it is not possible to get the production template working with a replacement theme active.
/var/www/shopware6/public/bundles/storefront/assets will not be copied if the standard theme is not active. This leads to not having the maintenance.svg, missing basic fonts, missing icons etc. pp.
Reproduction
--> no assets
-> assets are available
The maintenance SVG is not the worst part here, but the missing font is forcing a weird reload and makes the site seem slow/buggy.
I have been wondering about this for some time:
dist
or src
folder or doesn't it matter? I know that without either theme:compile and/or asset:install (did not check which of those two it was) it is not placed reachable with just a plugin update.It would be really helpful if this is explained in more details. Maybe in theme developer section of the documentation and also here.
From what I determined so far it seems that:
Not sure though if that is correct.
Resources/public/administration/*
files are included in the git repository/plugin, then a plugin update/install is enough to activate the administration changes.Is that correct in regards to admin? If so, please add a documentation too.
I really like that you defined what each command etc. does but it would be even more helpful to know when I have to execute which command.
Also keep in mind automated deployments which like to build their assets on the fly and in which case you should also document if various files can be excluded from the repository like pre-compiled JS assets and what is the correct order etc. of steps to have everything working nicely.
I think I found out the order but I am not sure if I need all of those steps or if I could skip some etc.
While executing bin/build-js.sh
i got the error readlink: illegal option -- f
on macOS 10.14.
That resulted in an npm error because the project root path was wrong.
Error Log
The full error log
This error was related to readlink on macOS:
https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
I solved the problem with brew install coreutils
and then changed the following line to
export PROJECT_ROOT="${PROJECT_ROOT:-"$(dirname $(dirname $(greadlink -f "$0")))"}"
e.g changed readlink
to greadlink
.
Now the npm installation runs without problems.
I get the SQLSTATE error after system:setup on "macOS Catalina v.10.15.5".
My selection:
Then error appears.
[ERROR] An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory
If I press no on "Retry?"
I get:
In AbstractMySQLDriver.php line 93: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 31: SQLSTATE[HY000] [2002] No such file or directory
In PDOConnection.php line 27: SQLSTATE[HY000] [2002] No such file or directory
My PHP (7.4.9) looks fine, my PHP extensions as well, just like the necessary changes on php.ini (memory_limit, etc.).
I'm currently using Docker with "shopware/platform", so I'm planning on using docker for "shopware/production" as well. Do you recommend me to use MAMP for this?
Does anyone have/had this issue? Would love to make it work ><
Hi Shopware contributors,
I am deploying Shopware 6 in a Kubernetes cluster, and for that I am using the provided Dockerfile to create the Docker image. When I was running a load test to check if my autoscaling rules were ok, I saw a growing % of response errors, and a warning in the logs saying:
WARNING: [pool www] server reached pm.max_children setting (5), consider raising it.
I ran docker-compose locally, checked the php-fpm.d folder and I found 2 files with configurations for the same pool named [www]: www.conf and php-fpm.conf.
The Dockerfile copies the php-fpm.conf from the repo to the Docker image:
COPY config/etc /etc
But looks like Nginx install the www.conf file as well, and php-fpm pickups one.
I solved this issues renaming the file from php-fpm.conf to www.conf, so it overrides the existing file. I can provide a PR. What are your thoughts about it?
With 6.3.0.0 the assets:install command executed in system:update:finish via composer.json fails:
Error thrown while running command "system:update:finish". Message: "The "--no-cleanup" option does not exist." ["exception" => Symfony\Component\Console\Exception\InvalidOptionException { …},"command" => "system:update:finish","message" => "The "--no-cleanup" option does not exist."]
The "--no-cleanup" option does not exist.
system:update:finish [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
Script [ ! -f install.lock ] || bin/console system:update:finish handling the post-install-cmd event returned with error code 1
the command has been refactored and it looks like this option flag was removed.
I tried to set up shopware with docker-compose but without success and a lot of pain.
Is a How to / documentation planned for this? Unfortunately I couldn't find anything.
Description
I'd like to get some more options on default install-command with basic-setup
.
For us it's important to specify defaultLanguage, cause it is German instead of English.
Problem 1
- Installation request for shopware/core v6.1.5 -> satisfiable by shopware/core[v6.1.5].
- shopware/core v6.1.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
Problem 2
- shopware/core v6.1.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- shopware/storefront v6.1.5 requires shopware/core * -> satisfiable by shopware/core[v6.1.5].
- Installation request for shopware/storefront v6.1.5 -> satisfiable by shopware/storefront[v6.1.5].
If I understand correctly, bin/build-js.sh
starts the javascript build process powered by npm and webpack.
The script fails if you don't have var/plugins.json
committed to VCS (it is gitignored by default). The file contains a list of activated plugins. It is generated by bin/console bundle:dump
which requires an active database connection to retrieve a list of activated plugins.
I think the build process should not rely on the activation state of plugins. It should build JS for every plugin in the project.
I assume this is comparable to the https://github.com/shopware/composer-project for 5. I expect to develop in this to a certain point. Watch commands would be really nice. I already have one for the storefront that somehow works on the commandline as it reacts to file changes but there is no reload. Maybe a dev server is needed.
#!/bin/bash
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
export PROJECT_ROOT="${PROJECT_ROOT:-"$(dirname $CWD)"}"
STOREFRONT_ROOT="${STOREFRONT_ROOT:-"${PROJECT_ROOT}/vendor/shopware/storefront"}"
# build storefront
"${CWD}/console" bundle:dump
npm --prefix ${STOREFRONT_ROOT}/Resources/app/storefront clean-install
node ${STOREFRONT_ROOT}/Resources/app/storefront/copy-to-vendor.js
source ${PROJECT_ROOT}/.env
PROJECT_ROOT=${PROJECT_ROOT} npm --prefix ${STOREFRONT_ROOT}/Resources/app/storefront/ run watch
But I don't get it running that the storefront automatically updating the style from a theme plugin.
What are your thoughts on watch commands?
After composer install and without setting up the system via
bin/console system:setup
my browser gets redirected to
/recovery/install/index.php
which responds with a Slim Application Error:
Details
Type: TypeError
Message: trim() expects parameter 1 to be string, bool given
File: /shopware/shopware/vendor/shopware/recovery/Install/src/ContainerProvider.php
Line: 46
Line 46 of /vendor/shopware/recovery/Install/src/ContainerProvider.php
return trim(file_get_contents(SW_PATH . '/public/recovery/install/data/version'));
requests a file /public/recovery/install/data/version
which is not present after install
after
bin/console system:setup
file is not present either and error persists
Get always this error on installation (following readme)
PHP Fatal error: Uncaught OutOfBoundsException: Required package "shopware/platform" is not installed: cannot detect its version in /home/erik/projects/ks/shopware/vendor/ocramius/package-versions/src/PackageVersions/FallbackVersions.php:44
Messages like
[NOTE] You may want to clear the cache after activating plugin(s). To do so run either the
cache:clear
command or./psh.phar cache
are super confusing as production does not ship psh.phar
Hey,
there is an error in the composer.lock file.
I always get this error:
require(/var/www/html/vendor/composer/../shopware/core/Flag/feature_next6000.php): failed to open stream: No such file or directory in /var/www/html/vendor/composer/autoload_real.php on line 66
After some debugging i found that this file i metioned in the composer.lock file:
https://github.com/shopware/production/blob/release/6.2.0-RC1/composer.lock#L4114
But the file "feature_next6000.php" is not in shopware/core:
https://github.com/shopware/core/tree/master/Flag
Best regards,
Leon
Many hosting provider ships multiple PHP Versions on the server.
For example profihost:
php -v Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with the ionCube PHP Loader + ionCube24 v10.3.9, Copyright (c) 2002-2019, by ionCube Ltd. with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
There are also another PHP Version under different path:
/usr/local/php7.1/bin/php
/usr/local/php7.2/bin/php
/usr/local/php7.3/bin/php
If i ran composer install inside of the shopware directory with the custom PHP version it fails:
/usr/local/php7.3/bin/php composer.phar install
There is no PHP-executable before bin/console, so default 7.0 is used.
"pre-install-cmd": [ "[ ! -f vendor\/autoload.php ] || bin\/console system:update:prepare" ]
The solution could be:
Hi,
we've been trying to evaluate Shopware v6.2 stable using Docker on our brand new server running Ubuntu 18.04.4 LTS and have trouble with the media gallery image upload. We've gone and changed the settings in config/etc/php7/conf.d/php.ini to allow for larger file uploads:
memory_limit = 512M
post_max_size = 64M
upload_max_filesize = 48M
PHP's phpinfo() reflects the changes to the php.ini.
The upload of a 1280 by 720 pixels PNG graphic with a size of 2M fails. The admin center does not give a visual feedback as to wether the upload is in progress. After 20 or so seconds, when refreshing the page, a blank file is visible:
Selecting the blank file yields a "not found" error message:
Inspecting the logs yields a "HTTP 413 - Payload too large" error:
2020/06/04 19:17:03 [error] 17#17: *17 client intended to send too large body: 2177729 bytes, client: {ClientIP}, server: _, request: "POST /api/v1/_action/media/1b37c21746694df9b2c0fed3a95563d4/upload?extension=png&fileName=2.0+concept HTTP/1.1", host: "{ServerURL}", referrer: "{ServerURL}/admin"
{ClientIP} - - [04/Jun/2020:19:17:03 +0000] "POST /api/v1/_action/media/1b37c21746694df9b2c0fed3a95563d4/upload?extension=png&fileName=2.0+concept HTTP/1.1" 413 585 "{ServerURL}/admin" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" "-" 0.386 - . -
Any clue as to what's happening here?
When using composer update
(no matter whether a dependency is updated) the compiled js and css does no more nclude custom js and css of plugins and/or themes.
This is very annoying to theme:compile
every time I use composer
to update anything.
Just wondering why the documentation does not use composer create-project
instead of git clone
that is how one usually sets up composer based projects after all and it works fine, e.g.:
composer create-project shopware/production shopware6-demo "^6.2" --stability="RC"
I don't think it is a good idea to override the PHP version in the composer.json
using config.platform
: https://github.com/shopware/production/blob/6.4/composer.json#L8
This way, the composer installation will succeed with PHP 7.2 which otherwise would immediately fail as PHP 7.4 is required. Also it might install wrong dependencies (at least without a lock file).
In the past I used composer to upgred minor versions. For example, from 6.3.0.1 to 6.3.0.2.
I did it by executing this command:
composer update shopware/*
At the end I got this error:
all migrations executed
cleared the shopware cache
05:42:22 ERROR [console] Error thrown while running command "system:update:finish". Message: "Too few arguments to function Shopware\Storefront\Theme\StorefrontPluginConfiguration\StorefrontPluginConfigurationFactory::__construct(), 0 passed in /var/www/html/var/cache/prod_h5ee38337f46d70fb9e60ac69262f8b3e/ContainerON2CpeB/srcShopware_Production_KernelProdContainer.php on line 7276 and exactly 1 expected" ["exception" => ArgumentCountError { …},"command" => "system:update:finish","message" => "Too few arguments to function Shopware\Storefront\Theme\StorefrontPluginConfiguration\StorefrontPluginConfigurationFactory::__construct(), 0 passed in /var/www/html/var/cache/prod_h5ee38337f46d70fb9e60ac69262f8b3e/ContainerON2CpeB/srcShopware_Production_KernelProdContainer.php on line 7276 and exactly 1 expected"]
In StorefrontPluginConfigurationFactory.php line 19:
Too few arguments to function Shopware\Storefront\Theme\StorefrontPluginCon
figuration\StorefrontPluginConfigurationFactory::__construct(), 0 passed in
/var/www/html/var/cache/prod_h5ee38337f46d70fb9e60ac69262f8b3e/ContainerON
2CpeB/srcShopware_Production_KernelProdContainer.php on line 7276 and exact
ly 1 expected
I tried to upgrade using the backend and has worked as expected.
Am I doing something wrong with Composer?
Is Composer a valid method to keep the platform up-to-date?
I'll appreciate some directions.
Why was the PR #24 closed. Being able to set the default language using the CLI is an a requirement as after the setup one should not change the default language at all.
It looks that there was a few changes to the database migration system in 6.2.
It is possible that someone have forgot to change the system:update:finish command?
This
'identifier' => 'Shopware\\',
maybe should be
'identifier' => 'core',
?
Using the production template when upgrading from 6.3.1.0
to the 6.3.4.1
using composer install
and also through the browser, I get the following error in both ways -
ERROR [app] Migration: "Shopware\Core\Migration\Migration1595422169AddProductSorting" failed: "An exception occurred while executing 'INSERT INTO product_sorting (id, url_key, priority, active, locked, fields, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)' with params ["\xf3\xc5\x0c\x47\x10\x31\x49\x9d\xb6\xde\xf6\x69\x73\x4f\x0d\xa4", "score", 0, 1, 1, "[{\"field\":\"_score\",\"order\":\"desc\",\"priority\":1,\"naturalSorting\":0}]", "2021-01-15 12:53:17.445"]:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'score' for key 'product_sorting.uniq.product_sorting.url_key'"
And this is what is being thrown in my terminal. I've followed instruction word by word
[ ! -f vendor/autoload.php ] || bin/console system:update:prepare
'[' is not recognized as an internal or external command,
operable program or batch file.
'bin' is not recognized as an internal or external command,
operable program or batch file.
Script [ ! -f vendor/autoload.php ] || bin/console system:update:prepare handling the pre-install-cmd event returned with error code 1
Hi,
during installation via
bin/console system:setup
and entering "127.0.0.1" for database and "http://somefancyurl.tld/subfolder" i got the error
malformed parameter "url"
Runnin the web based installer via browser results in perfect running shop (after building admin and storefront).
I got this twice on different servers and different urls.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.