Code Studio

FAQs and troubleshooting

Common error messages

Composer memory limit error - Build Code

Description

Build stageJobError messageCategoryResponsibility
Build DrupalBuild CodeFatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/ Composer/DependencyResolver/Solver.php on line 201.ApplicationCustomer

Potential cause

The application uses an older version of the Acquia CMS project template, which causes a Composer memory limit error.

Solution

Confirm that your application meets the following best practices:

  • From composer.json, remove the lines that point to the old Acquia CMS project template. Acquia CMS utilizes the Acquia Drupal recommended project.
  • Commit composer.lock.
  • Use Composer 2.
  • Analyze the delta between a working composer.lock and the failing composer.lock.

Missing Test Drupal job error

Description

Build stageJobError messageCategoryResponsibility
Test DrupalTest Drupal'Create artifact from branch' job needs 'Test Drupal' job, but 'Test Drupal' is not in any previous stage.ApplicationCustomer

Potential cause

The Acquia Auto DevOps template is copied incorrectly in the entire codebase.

Solution

Remove everything in the file and add any necessary customization back in the before_script and after_script parameters.


$rector_bin process error

Description

Build stageJobError messageCategoryResponsibility
Automatic UpdatesDeprecated Code UpdateCommand [$rector_bin process ${ACQUIA_CUSTOM_CODE_DIRS} --ansi] exited with code [1]ApplicationCustomer

Potential cause

The existing Drupal code is deprecated.

Solution

Identify the files with deprecated Drupal code and update the code.


PHPStan error

Description

Build stageJobError messageCategoryResponsibility
Test DrupalPHP StanCommand ["$CI_PROJECT_DIR"/vendor/bin/phpstan] exited with code [1]ApplicationCustomer

Potential cause

The existing code does not follow the proper coding standards.

Solution

Identify the files with code standards errors and update the code.


PHP version error - Build Code

Description

Build stageJobError messageCategoryResponsibility
Build CodeBuild Code

Your lock file does not contain a compatible set of packages. Please run composer update.

symfony/string vx.x.x requires php >=8.2 -> your php version (8.1) does not satisfy that requirement.

ApplicationCustomer

Potential cause

The PHP version of the project is not set correctly.

Solution

Add the PHP_VERSION environment variable to your project through the UI, and set its value to the PHP version that your project uses. This value accepts major and minor versions only, for example, 8.2. For more information, see Modifying environment variables.

Note

Setting the PHP_VERSION variable in the .gitlab-ci.yml file might not work as expected. Acquia recommends you to set variable values through the Code Studio UI.

The composer.json file in your project, Cloud IDE, Code Studio, and Cloud Platform must use the same PHP version.


PHPUnit error

Description

Build stageJobError messageCategoryResponsibility
Test DrupalTest DrupalClass "Behat\Mink\Element\TraversableElement" not foundApplicationCustomer

Potential cause

Certain packages are missing from your project.

Solution

If your application runs on the current Drupal version, add the core-dev package to your project:

composer require --dev drupal/core-dev                                                                  

Yarn not found error

Description

Build stageJobError messageCategoryResponsibility
Test DrupalTest DrupalYarn not foundApplicationCustomer

Solution

You can use yarn by adding the following lines in the .gitlab-ci.yml file:

Test Drupal:
  before_script:
    - eval $YARN_PACKAGE
    - eval $YARN_PATH

Error in opening a required file

Description

Build stageJobError messageCategoryResponsibility
Test DrupalTest DrupalError: Failed opening required '/var/www/site-php/<APP>/<APP>-settings.inc'ApplicationCustomer

Solution

You must update the if statement in the Cloud Platform database settings as follows:

  1. In the settings.php file of your project, locate a statement similar to the erroneous statement. For example:

    if (file_exists('/var/www/site-php')) {
        require('/var/www/site-php/<APP>/<APP>-settings.inc');                                                                                                                                               }
  2. Update the if statement to specify the complete path to the file:

    if (file_exists('/var/www/site-php/<APP>/<APP>-settings.inc')) { 

Scheduled job rector errors

Description

 

This error is usually a result of an older version of rector being added in your project. Code Studio attempts to add the latest version of rector during the Pipeline. However, it uses your version if that is included in your project’s composer.lock file.

Build stageJobError messageCategoryResponsibility
Test DrupalTest DrupalUndefined constant Rector\Core\Configuration\Option::IMPORT_DOC_BLOCKSApplicationCustomer

Resolution 1:

  1. Run composer remove palantirnet/drupal-rector.
  2. Delete the rector.php file from the root of your project, allowing Code Studio to handle the rector going forward.

Resolution 2:

  1. Run composer update palantirnet/drupal-rector -W to upgrade your rector package to the latest rector version.
  2. Remove the rector.php file from the root of your project.
  3. Run cp vendor/palantirnet/drupal-rector/rector.php to recopy the rector.php file.

Description

Build stageJobError messageCategoryResponsibility
Test DrupalTest DrupalSymfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator::__construct(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\ContainerBuilder, RectorPrefix202208\Symfony\Component\DependencyInjection\ContainerBuilder given, called in /home/codestudio/.config/composer/vendor/rector/rector/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php on line 67ApplicationCustomer

This error indicates that your project’s rector.php file needs to be recreated. Newer versions of rector altered the configuration syntax, resulting in your rector.php file no longer being valid.

Resolution:

  1. Remove the rector.php file at the root of your project.
  2. Run cp vendor/palantirnet/drupal-rector/rector.php to recopy the rector.php file to your project.

How do I enable Code Studio for my Acquia subscription?

For information about enabling Code Studio for your subscription, see Enabling a Code Studio subscription.

Can the owner of a subscription enable Code Studio?

Yes, the owner of a subscription can enable Code Studio.

Can I disable Code Studio from the Cloud Platform user interface?

No, you cannot disable Code Studio from the Cloud Platform user interface. To disable your Code Studio subscription, contact Acquia Support.

What versions of Drupal does Code Studio support?

Code Studio supports the current Drupal version.

What versions of Node.js does Code Studio support?

Code Studio supports Node.js versions 18 and 20.

Why am I seeing a lot of SAST jobs in my Pipeline?

Acquia recommends you to not commit contributed dependencies to your repository. Example code for Drupal projects:

git rm -r --cached vendor docroot/core docroot/libraries docroot/modules/contrib docroot/themes/contrib docroot/profiles/contrib node_modules

Add these to your .gitignore. For an example, see acquia/drupal-recommended-project.

How do I install private packages through Composer?

Composer provides multiple mechanisms for downloading private packages. Acquia recommends that you store authentication credentials in a project auth.json. For more information, see Authentication in auth.json per project.

This works in Code Studio CI/CD jobs.

I cannot sudo and add packages, move binaries, etc. Why?

This is a security restriction on application containers running in the Acquia Kubernetes service.

  • If you’re downloading a binary, such as composer.phar or acli.phar (which Acquia has already done for you), you can place it in '$HOME/bin'. The bin folder in the CI user’s home directory is already added to $PATH. It works as long as your binary has an execute permissions set.
  • To download a package through `apt` or similar, create a Support ticket.

CDE already exists. What can I do?

Error message:

CDE environment with name CDE-xxxx already exists                                                                                

Resolution 1:

If a merge request cannot be declined/merged immediately for some reason, one way is to stop the CDE environment:

  1. Log in to Code Studio.
  2. Navigate to Environments.
  3. Determine the respective environment with the same feature branch name, and stop the environment.
  4. Wait for a few minutes for the current pipeline to succeed, and to delete the existing CDE with the same name.
  5. Make some minor changes to the current feature’s merge request to re-initiate the pipeline with the CDE creation job.

Resolution 2:

  1. Rename the existing CD environment that is pointing to the same source branch from Acquia Cloud.
  2. Make some minor changes to the current feature’s merge request to re-initiate the pipeline with CDE creation job.

Is there a limit to the number of projects I can have in Code Studio?

No. You can have unlimited projects in Code Studio. However, the Code Studio Auto DevOps pipeline requires your Code Studio project to be linked to an Acquia Cloud application. You can link only one Code Studio project to a given Cloud application.

Does Code Studio work with Cloud IDE?

Yes. For instructions on how to set up Code Studio with Cloud IDE, see Setting up a Code Studio project.

For more information, see the following tutorials on dev.acquia.com:

Can I use an existing application with Code Studio?

Yes. Code Studio is compatible with existing applications running Acquia CMS, and the current Drupal version or the current Node.js version.

Can I use a third-party repository with Code Studio?

Yes. You can use a third-party repository with Code Studio. For instructions on how to integrate your private repository with Code Studio, see Configuring repository mirroring in Code Studio.

Does Code Studio work with Jira?

You can integrate Code Studio with Jira Issues and Jira Development Panel. For more information about setting up the integration, see Integrating Code Studio with Jira.

Can you integrate a Veracode Static analysis with the Code Studio Auto DevOps pipeline

Yes. You can integrate a Veracode Static analysis by customizing the standard template for the Drupal Auto DevOps pipeline or by customizing the node template for the Node.js Auto DevOps pipeline.

To customize the Auto DevOps pipeline in Code Studio, see Adding a before_script or after_script to a Code Studio job.

For more information about implementing Veracode Static analysis as part of the pipeline, see GitLab Pipeline Scan Examples.

How many users can I add to Code Studio?

With Code Studio entitlements, seats are equivalent to users. The number of seats within your Code Studio subscription is equal to the number of users you can add to your Code Studio instance.

For more questions about Code Studio entitlements, contact your Acquia account team.

Why can I not manage certain seats in Code Studio?

If you assign seats through the Code Studio user interface, you might encounter an error while managing such seats. Acquia recommends that you assign seats through the Cloud Platform user interface.

Can I use Code Studio with non-Drupal applications?

Code Studio is compatible with Drupal and Node.js applications.

Can I use Code Studio with a Node.js application?

Yes. Code Studio is compatible with Drupal or Node.js applications.

Can I customize Code Studio builds?

Yes. You can customize Code Studio builds. For instructions, see Customizing a default Code Studio pipeline.

What is a build minute in Code Studio?

A build minute is one minute of execution time of a single Code Studio job. Build minutes are the sum of the durations of every job that you execute using Code Studio, including the jobs that run concurrently. For example, if you ran five jobs with each job using ten build minutes, then you used fifty build minutes.

Is there a limit to the build minutes for Code Studio?

Yes. Build time is limited to 10k minutes per group per year. 

Can I use my own container image in a Code Studio job?

No. With the Auto DevOps pipeline, Acquia maintains the container images used in Code Studio jobs. You can customize jobs, but the base images are selected by Acquia as secure, vetted options that remove overhead for our users.

Can I disable Auto DevOps?

Yes, you can disable Auto DevOps.

Note

Disabling Auto DevOps removes the Acquia-optimized steps needed to build, test, and deploy Drupal applications to Acquia Cloud.

To disable Auto DevOps:

  1. In the left navigation pane, click Settings > CI/CD.
  2. Expand the Auto DevOps section.
  3. Clear the Default to Auto DevOps pipeline checkbox.

Does Code Studio work with Acquia Site Factory?

Yes. The continuous integration (CI) feature of Code Studio is compatible with Acquia Site Factory. However, the continuous delivery (CD) feature of Code Studio is not compatible with Acquia Site Factory.

For more information, see the Code Studio product support scope.

Can I use my own GitLab license with Code Studio?

No. External licenses for Gitlab cannot be used with Acquia Code Studio.

How do I enable or execute PHPUnit tests in the Test Drupal stage?

Ensure that the ACQUIA_TASKS_PHPUNIT and ACQUIA_TASKS_SETUP_DRUPAL environment variables are set to true.

Do Code Studio runners use specific IP addresses that I can allowlist?

Yes. To obtain a list of IP addresses, contact Acquia Support.

Can Code Studio integrate with SonarCube?

Yes, Code Studio can integrate with SonarCube. For more information, see Gitlab integration.

How do I enable code coverage in PHPUnit?

Code Studio does not support PHPUnit code coverage.

How do I specify the root directory or output directory for my Node.js project?

  • To specify the root directory, add the directory path to the extra.acquia.root_directory section in the package.json file of the root directory.
  • To specify the output directory, add the directory path to the extra.acquia.output_directory section in the package.json file of the root directory. For example:
"extra": {       
             "acquia": {
               "root_directory": "front-end/",
               "output_directory": "assets/"
             }
            }

The default root directory is <project_root>/, and the default output directory is <project_root>/.next/.

Can I turn off the Test stage or Deploy stage in my Node.js Auto DevOps pipeline?

Yes, you can turn off these stages in your Node.js Auto DevOps pipeline:

  • To turn off the Test stage, add the NODE_JOBS_TEST environment variable in Code Studio and set it to false. This setting also disables all jobs in the Test stage. For more information, see Adding environment variables. To disable certain tasks in the Test stage, see Environment variables to enable or disable a CI/CD job.
  • To turn off the Deploy stage, add the NODE_JOBS_DEPLOY environment variable in Code Studio and set it to false. This setting also disables all jobs in the Deploy stage. For more information, see Adding environment variables.

Which package managers does Code Studio support for Node.js Auto DevOps?

Node Package Manager (NPM) is the only supported package manager in Code Studio. However, you can choose to use a before_script or after_script to modify the default pipeline and install packages using yarn.

Why are certain files in my Node.js Auto DevOps pipeline being excluded from the build artifact?

Code Studio excludes files with the following naming patterns as they are not required for build artifacts:

  • .hg
  • .git
  • .gitmodules
  • .svn
  • .cache
  • .eslintrc
  • .now
  • .vercel
  • .npmignore
  • .dockerignore
  • .gitignore
  • .*.swp
  • .DS_Store
  • .wafpicke-*
  • .lock-wscript
  • .env.local
  • .env.*.local
  • .venv
  • npm-debug.log
  • config.gypi
  • node_modules
  • __pycache__
  • venv
  • CVS

If a mandatory file is missing from a build artifact, rename the file to ensure that the name does not contain any of the preceding naming patterns.

Project setup - 401 Unauthorized error

Description

Build stageJobError messageCategoryResponsibility
N/AN/A401 UnauthorizedApplicationCustomer

Potential cause

If you see an unauthorized error during acli cs:wizard --gitlab-host-name=code.acquia.com, it is likely that you do not have the required role in Code Studio.

Solution

Ensure that a user with the role Owner or Maintainer role in Code Studio runs the project setup. For information about roles and permissions, visit User roles and permissions.

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Acquia Help

Filter by product:

Code Studio common questions