Composer 7.2.2 Install fails

Your software
My Mautic version is: 7.2.2
My PHP version is: 8.4
My Database type and version is: MariaDB 11.4

Your problem
My problem is: Unable to enter site and complete installer steps / database connection after running composer recommended project.

“mautic The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. after installing”

These errors are showing in the log:
[2026-10-31T19:01:56.363798+00:00] mautic.ERROR: Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template (“The file /mysite.com/mautic/var/sass/app.output.css doesn’t exist, run php bin/console sass:build”)

Tried to run sass:build got error.

Downloaded Mautic 7.2.2 zip and copied over missing /var/sass and /var/dart-sass folders
Ran sass:build and it completed.

Got 504 Gateway Time-out, checked log again:

[2026-10-31T19:20:09.085773+00:00] app.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("These files are missing: /mysite.com/mautic/node_modules/mousetrap/mousetrap.js, /mysite.com/mautic/node_modules/jquery/dist/jquery.js, /mysite.com/mautic/node_modules/jquery-form/src/jquery.form.js,

There is no /mautic/node_modules directory created after running the composer installer, nor does this directory exist in the zip file download either.

It would seem that the installer is missing files/directories that are supposed to be there.

Hi Adam,

The two errors point to an incomplete Composer post-install process rather than a database or Mautic configuration problem.

For the mautic/recommended-project installation, Composer is expected to run several post-install steps:

  1. install the JavaScript dependencies with npm ci;
  2. apply the package patches;
  3. build the Mautic assets, including var/sass/app.output.css;
  4. install the generated assets into the configured web root.

In a clean Composer-based 7.2.2 installation, var/sass/app.output.css and var/dart-sass/sass are generated as part of this process. The node_modules directory is used during the build and does not necessarily need to remain after a successful deployment, but it must be available while the assets are being generated.

This explains the sequence in your logs:

  • the missing var/sass/app.output.css error means the asset build did not finish;
  • copying the var directories from the ZIP can remove that first error, but it does not install the JavaScript dependencies;
  • the later error about missing mousetrap, jquery, and jquery-form files shows that mautic:assets:generate is still trying to read dependencies from node_modules.

Please run the commands from the Composer project root — the directory containing composer.json and bin/console— and make sure that Node.js and npm are installed and available to the same user that runs Composer:

node --version
npm --version
composer --version

If the installation was originally run with --no-scripts, or if one of the post-install steps failed, run:

composer run-script post-install-cmd

Alternatively, the individual steps can be run explicitly:

npm ci --prefer-offline --no-audit
npx patch-package
php bin/console mautic:assets:generate
php bin/console assets:install --symlink --relative docroot/

Do not run these commands from inside docroot; run them from the project root.

Afterwards, verify that the generated files exist:

test -s var/sass/app.output.css
test -x var/dart-sass/sass
find docroot/assets/build -type f | head
test -f docroot/media/css/app.css

The 504 response is also consistent with an asset-generation process timing out. It is not evidence of a database failure by itself.

If the commands still fail, please provide the complete terminal output from composer install or composer run-script post-install-cmd, especially the first npm or asset-generation error. The Mautic application log usually only shows the final missing-file symptom and not the original Composer failure.

If the hosting environment does not provide Node.js/npm or does not allow Composer scripts to run, the recommended approach is to build the Composer installation in a separate build/staging environment and deploy the completed generated assets, or use the official ZIP package. Simply copying only var/sass from the ZIP will not be sufficient because the JavaScript dependencies are also required during asset generation.

I installed node.js and nvm. BTW, in the docs (Installation — Mautic Documentation 0.1 documentation) I do not see any mention of needing them to be installed.

I concluded that it made more sense to just do another clean install rather than fix this one. It installed fine this time!

I let it install a new empty db (v7.2.2), then renamed my old one to the new name (v7.2.1) and ran the following commands:

php bin/console cache:clear
php bin/console mautic:update:find
php bin/console mautic:update:apply
php bin/console mautic:update:apply --finish

My contacts, segments, and emails all look good.

However, it did not bring over my configuration:email settings (and possibly other settings), so I’m assuming that these settings are stored in a file and not in the database. I could recreate them, but what file could I copy over from my previous 7.2.1 installation into my new 7.2.2 installation to bring in those settings?

Thanks

Node.js and NVM are not required for a normal production installation from the official ZIP package. They are mainly needed when building frontend assets from the source repository. The current installation documentation describes ZIP and Composer installation without requiring Node.js, so this prerequisite should be clarified only for source/development workflows. Installation documentation

Mautic configuration is not stored entirely in the database. Email transport settings and other local instance parameters are stored in the local configuration file.

For a current Composer-based Mautic 7 installation, check:

config/local.php

In older or non-Composer layouts, the file may instead be:

app/config/local.php

Copy or merge the relevant configuration from the previous installation, especially the mailer settings. Do not overwrite the new file blindly: verify the database name, database user, password, site URL, paths, and secret_key first. The configuration file contains credentials and encryption-related settings, so keep its permissions restricted.

After changing the configuration, clear the cache:

php bin/console cache:clear

Also remember that plugins, uploaded media, custom themes, and translations are separate from the database and may need to be copied from the old installation if they were not included in the new one. The database migration commands you ran are appropriate only after confirming that the new code is connected to the intended backup database and that a backup is available.