shopware / docker

Running Shopware in Docker for Production
MIT License
32 stars 10 forks source link

Git required by shopware v6.6.4.0 ? #94

Closed panakour closed 2 weeks ago

panakour commented 1 month ago

After upgrading to the latest version v6.6.4.0, the following error occurs when executing the command console plugin:update:all: https://github.com/shopware/docker/blob/c89dd1d351bf8d1c96fc98c64f12bfd3eb83495f/fpm/rootfs/usr/local/shopware/setup_6.6.x#L23

init-1        | + php '-derror_reporting=E_ALL' bin/console plugin:update:all --skip-asset-build                                  
init-1        | 11:34:31 CRITICAL  [console] Error thrown while running command "plugin:update:all --skip-asset-build". Message: "The command "'git' 'branch' '-a' '--no-color' '--no-abbrev' 
'-v'" failed.\n\nWorking directory: /var/www/html\n\nError: proc_open(): posix_spawn() failed: No such file or directory" ["exception" => Symfony\Component\Process\Exception\ProcessStartFail
edException { …},"command" => "plugin:update:all --skip-asset-build","message" => """  The command "'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'" failed.\n  \n  Working directory: /va
r/www/html\n  \n  Error: proc_open(): posix_spawn() failed: No such file or directory  """]                                                                                                   
init-1        |                                                                                                                                                                               
init-1        | In Process.php line 371:                                                                                                                                                      
init-1        |                                                                                                                                                                               
init-1        |   [Symfony\Component\Process\Exception\ProcessStartFailedException]                                                                                                           
init-1        |   The command "'git' 'branch' '-a' '--no-color' '--no-abbrev' '-v'" failed.                                                                                                   
init-1        |                                                                                                                                                                               
init-1        |   Working directory: /var/www/html                                                                                                                                            
init-1        |                                                                                                                                                                               
init-1        |   Error: proc_open(): posix_spawn() failed: No such file or directory        
einz-loggik commented 1 month ago

Had the same Problem. You can install git when building the container, this should solve the error. But i would also be very interested to know why git is required now.

dallyger commented 1 month ago

This is due to them migrating to Symfony Flex / replacing their updater mechanism / better composer support.

This was announced in one of Shopwares ADRs: https://developer.shopware.com/docs/resources/references/adr/2022-11-09-composer-based-web-updater.html#consequences

aritas1 commented 3 weeks ago

having the same issue, adding git to the final base-image manually works for me.

maybe we can move on with the PR?

FROM base-image

USER root
RUN apk upgrade --no-cache && apk add --no-cache git
USER www-data

COPY --from=build --chown=www-data /src /var/www/html
shyim commented 3 weeks ago

It sounds for me like a regression in the latest update. Git should be never required in the environment we drive in this repository (all plugins are required already). I think something in PluginLifecycle changed here 🤔

I would like to debug this the next days.

You could maybe do this

https://developer.shopware.com/docs/guides/hosting/installation-updates/extension-managment.html#configuring-extension-manager-to-read-only-in-admin

and this: https://developer.shopware.com/docs/guides/hosting/installation-updates/cluster-setup.html

This should definitively block all Composer operations and should not call git

shyim commented 2 weeks ago

Seems like fixed after this https://github.com/shopware/docker/pull/99