Strange Error when running setup:upgrade after module installation

In my case, I ran php bin/magento setup:static-content:deploy and the error disappeared.


Need to update in Database core_config_data table,

If record (path field value = 'dev/static/sign') exist in core_config_data table

UPDATE core_config_data SET value = 0 WHERE path = 'dev/static/sign'

If record not exist then run below query to Insert record,

INSERT INTO core_config_data VALUES (null, 'default' , 0, 'dev/static/sign', 0);

After that run your command


It seems to have nothing to do with the google module. It can happen after any deployment; especially if you are dealing with Magento in production mode.

Running bin/magento setup:upgrade removes content of the generated directory. This is fine in development mode, because the contents of the generated directory are generated dynamically. But in production mode, the generated directory is neither generated dynamically, nor automatically. This means, it is necessary to trigger the generation of the content of the generated directory manually:

bin/magento setup:static-content:deploy en_GB en_US en_AU

(Hint: All locales of your installation need to be added)

This is the default way how to solve it. But in some cases, you might want to keep the content of your generated directory. Maybe, because its contents did not change during the deployment. Maybe, because you have generated its contents in another environment or by a deployment pipeline, and want to just deploy it to the current server via copying the directory.

You still might need to run bin/magento setup:upgrade in such a case, but you would not want it to remove anything from the generated directory. For this purpose, the smart Magento developers have added the keep-generated flag:

bin/magento setup:upgrade --keep-generated