shopware/development

Issue when installing shopware for the first time

Closed this issue · 3 comments

Athov commented

PHP Version

7.4

Shopware Version

6.4.17.2

Expected behaviour

Running ./psh.phar docker:start, should build and start docker containers.

Actual behaviour

Running ./psh.phar docker:start, throws an error, npm: command not found

Processing triggers for libc-bin (2.28-10+deb10u2) ...
	bash: npm: command not found
	The command '/bin/sh -c sed -ri -e 's!VirtualHost \*:80!VirtualHost \*:8000!g' /opt/docker/etc/httpd/vhost.conf     && echo "Listen 8000" | tee -a /etc/apache2/ports.conf         && curl -sL https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -     && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'         && curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -     && sh -c 'echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list.d/docker.list'         && mkdir -p /usr/share/man/man1     && mkdir -p /opt/nvm && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | PROFILE=/root/.bashrc NVM_DIR=/opt/nvm NODE_VERSION=${IMAGE_NODE_VERSION} bash     && ln -s /opt/nvm/versions/node/v${IMAGE_NODE_VERSION}*/bin/node /usr/bin/node     && ln -s /opt/nvm/versions/node/v${IMAGE_NODE_VERSION}*/bin/npm /usr/bin/npm     && ln -s /opt/nvm/versions/node/v${IMAGE_NODE_VERSION}*/bin/npx /usr/bin/npx     && mkdir -p ${NPM_CONFIG_CACHE}     && apt-install default-mysql-client google-chrome-stable libicu-dev graphviz vim gnupg2 docker-ce=5:18.09.7~3-0~debian-stretch libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb jq         && bash -c 'npm i forever -g'     && chown -R ${USER_ID}:${GROUP_ID} ${NPM_CONFIG_CACHE}         && ln -s /app/psh.phar /bin/psh         && pecl install pcov     && docker-php-ext-enable pcov     && rm -f /usr/local/etc/php/conf.d/00-ioncube.ini     && rm -f /usr/local/etc/php/conf.d/apcu.ini     && rm -f /usr/local/etc/php/conf.d/vips.ini     && rm -f /usr/local/etc/php/conf.d/memcached.ini     && rm -f /usr/local/etc/php/conf.d/mongodb.ini     && rm -f /usr/local/etc/php/conf.d/docker-php-ext-amqp.ini' returned a non-zero code: 127
	
	ERROR: for app_server  (<Service: app_server>, 'Build failed')
	Service 'app_server' failed to build : Build failed
	
Execution aborted, a subcommand failed!

How to reproduce

git clone https://github.com/shopware/development.git

cd development

./psh.phar docker:start

I am experiencing the same issue here.

Athov commented

Update, I pulled the changes and the docker started but when I do ./psh.phar install I get this:

	node:internal/crypto/hash:71
	  this[kHandle] = new _Hash(algorithm, xofLen);
	                  ^
	
	Error: error:0308010C:digital envelope routines::unsupported
	    at new Hash (node:internal/crypto/hash:71:19)
	    at Object.createHash (node:crypto:133:10)
	    at module.exports (/app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/webpack/lib/util/createHash.js:135:53)
	    at NormalModule._initBuildHash (/app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/webpack/lib/NormalModule.js:417:16)
	    at handleParseError (/app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/webpack/lib/NormalModule.js:471:10)
	    at /app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/webpack/lib/NormalModule.js:503:5
	    at /app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/webpack/lib/NormalModule.js:358:12
	    at /app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/loader-runner/lib/LoaderRunner.js:373:3
	    at iterateNormalLoaders (/app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
	    at iterateNormalLoaders (/app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
	    at /app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/loader-runner/lib/LoaderRunner.js:236:3
	    at context.callback (/app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
	    at /app/vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/babel-loader/lib/index.js:59:71 {
	  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
	  library: 'digital envelope routines',
	  reason: 'unsupported',
	  code: 'ERR_OSSL_EVP_UNSUPPORTED'
	}
	
	Node.js v18.12.1
	
Execution aborted, a subcommand failed!

sabba commented

Hello, it seems to be related to webpack and the node version included into the docker container (v18).
Eg: https://stackoverflow.com/questions/69394632/webpack-build-failing-with-err-ossl-evp-unsupported

Downgrading to node v16 (which is the version required by Administration, for example), solves the problem.

To do that I edited this file changing 18 with 16:
https://github.com/shopware/development/blob/trunk/dev-ops/docker/containers/app/Dockerfile#L14

Waiting for a better fix, this should work.