Deploy failed because of Composer dependencies

Hello everyone, i have an issue to install Elementor Pro as a guide here [Composer | Elementor Developers](https://elementor doc)

This is part of my composer.json

...
"repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org",
      "only": ["wpackagist-plugin/*", "wpackagist-theme/*"]
    },
    {
      "type": "composer",
      "url": "https://composer.elementor.com",
      "only": ["elementor/elementor-pro"]
    },
    {
      "type": "vcs",
      "url": "https://github.com/***/***.git"
    },
...
 "require": {
    "php": ">=8.0",
    "composer/installers": "^2.2",
    "ffraenz/private-composer-installer": "*",
    "elementor/elementor-pro": "^3.23",
...

I have created auth.json file where i have this

{
  "http-basic": {
    "composer.elementor.com": {
      "username": "token",
      "password": "***"
    }
  },
  "github-oauth": {
    "github.com": "github_pat_***"
  }
}

when I use composer update locally it will install everything correctly but then when i do deploy to remote environment i get the following error
"Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Package operations: 63 installs, 0 updates, 0 removals - Downloading elementor/elementor-pro (3.23.1)…

Has anybody experience anything like it. For example in another project when I have WPMU this works perfectly fine.

also see this in the error message
*Git.php line 473:\n \n Failed to execute git clone --mirror – ‘git@github.com:elementor/elementor \n -pro.git’ ‘/home/web/.cache/composer/vcs/git-github.com-elementor-elementor \n -pro.git/’ \n \n Cloning into bare repository ‘/home/web/.cache/composer/vcs/git-github.com- \n elementor-elementor-pro.git’… \n ERROR: Repository not found. \n fatal: Could not read from remote repository. \n \n Please make sure you have the correct access rights \n and the repository exists. *

Update: ok so IMO the issue lays in this declaration:

"repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org",
      "only": ["wpackagist-plugin/*", "wpackagist-theme/*"]
    },
    {
      "type": "composer",
      "url": "https://composer.elementor.com",
      "only": ["elementor/elementor-pro"]
    },

because when I install elementor-pro from my private repo it’s going through. It’s probably because it’s trying to get it from git@github.com:elementor/elementor-pro.git instead of https://composer.elementor.com

Have you contacted Elementor support about your issue yet?

No Ben, do you think this issue lies on their site?

Since it’s a paid product and they support installing their plugin via Composer it’s definitely worth a shot asking them

I don’t understand this part of your topic:

Where is the actual error?

It’d be helpful if you formatted your messages better, it would make this topic significantly easier to read.

what i meant is that i had no issue installing all of it locally via composer update. I only get this error when i run trellis deploy staging. the log is very long as I install quite few private plugins but let me extract some info

  1. Failed to download {repo} from dist: The \"https://api.github.com/repos/***\" file could not be downloaded (HTTP/2 404 ):\n{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip\",\"status\":\"404\"}\n Now trying to download from source\n - Syncing *** (dev-main) into cache\n

  2. Git.php line 473:\n \n Failed to execute git clone --mirror -- 'git@github.com:elementor/elementor \n -pro.git' '/home/web/.cache/composer/vcs/git-github.com-elementor-elementor \n -pro.git/' \n \n Cloning into bare repository '/home/web/.cache/composer/vcs/git-github.com- \n elementor-elementor-pro.git'... \n ERROR: Repository not found. \n fatal: Could not read from remote repository. \n \n Please make sure you have the correct access rights \n and the repository exists. \n

You said “I created auth.json” … does that mean you manually created it? Did you add composer credentials to group_vars/staging/vault.yml?

2 Likes

Thank you, that was the issue. I didn’t know that i had to add credentials to the vault, as I haven’t had to do it for github-oauth. I also do not store auth.json in the repo.

composer_authentications:
      - { hostname: example.com, username: COMPOSER_HTTP_USERNAME, password: COMPOSER_HTTP_USERNAME }
1 Like