-1

running composer install with the Drupal 8 recommended setup fails when installing coder with authentication message or similar. Does somebody else have this behavior?

Workaround was to run composer install --no-dev and running composer install afterwards, but this doesn't install Coder. Colleagues told me they have similar problems with different libraries.

Here is my composer.json

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 8 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.2",
        "drupal/core-composer-scaffold": "^8.8",
        "drupal/core-project-message": "^8.8",
        "drupal/core-recommended": "^8.8"
    },
    "require-dev": {
        "drupal/core-dev": "^8.8"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/libraries/{$name}": ["type:drupal-library"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/contrib/{$name}": ["type:drupal-drush"],
            "web/modules/custom/{$name}": ["type:drupal-custom-module"],
            "web/themes/custom/{$name}": ["type:drupal-custom-theme"]
        },
        "drupal-core-project-message": {
            "include-keys": ["homepage", "support"],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",

                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}

Here the Error-Message while running composer install inside the container

:/var/www/html/web$ composer install
No composer.json in current directory, do you want to use the one at /var/www/html? [Y,n]? y
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 9 installs, 0 updates, 0 removals
  - Installing drupal/coder (8.3.6): Cloning 4337ddf58d from cache
    4337ddf58d28dbdee4e1367bf71ee13393ab9820 is gone (history was rewritten?)


  [RuntimeException]                                                                                                                              
  Failed to execute git checkout '4337ddf58d28dbdee4e1367bf71ee13393ab9820' -- && git reset --hard '4337ddf58d28dbdee4e1367bf71ee13393ab9820' --  

  fatal: failed to read object 4337ddf58d28dbdee4e1367bf71ee13393ab9820: Operation not permitted                                                  


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--i
gnore-platform-reqs] [--] [<packages>]...

And here when running composer install locally inside the source dir:

λ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 9 installs, 0 updates, 0 removals
  - Installing drupal/coder (8.3.6):     Authentication required (git.drupalcode.org):
      Username:

I started by installing D8 like described here https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies This initially worked and we commited the codebase (mostly composer.json & composer.lock) into our git-lab, but after checkout to a different folder and runing composer install with the composer.json & composer.lock fails as described above.

3
  • 3
    We probably need more information to help you out. Just composer install isn't much of an information when we don't know how the composer.json to it looks like. Also please don't add error messages in screenshots. Please paste the output in and highlight it as blockquote. Screenshots are difficult to read, especially on mobile and you can't type-search for the text in them. So, please edit your question and try to make your problem reproducible. What do we need to have or do to run into the same error? What happens when you create a new project from scratch? What different libraries? – leymannx Mar 23 '20 at 9:12
  • thanks for your input. Have been disturbed while editing. Added some more infos in between. – macbert Mar 23 '20 at 13:39
  • 1
    Okay, I just did an checkout on my mac which isn't behind company proxy and runs without problems. So maybe there is just something messed up on that side what was changed recently – macbert Mar 23 '20 at 15:03
0

I am not sure yet why, but running composer install --no-cache fixes that issue for me. Maybe someone could shine some more light on whats going on there.

uid1000@drupal-web:/var/www/html/web$ composer install --no-cache
No composer.json in current directory, do you want to use the one at /var/www/html? [Y,n]? y
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 9 installs, 0 updates, 0 removals
  - Installing drupal/coder (8.3.6): Cloning 4337ddf58d
  - Installing seld/phar-utils (1.0.1): Downloading (100%)
  - Installing seld/jsonlint (1.7.1): Downloading (100%)
  - Installing composer/composer (1.9.1): Downloading (100%)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.