Cannot clone github packages through composer on Ubuntu VPS (With Composer), OAuth problems?

Viewed 21

I have been following this tutorial to set up a Laravel project on a VPS running Ubuntu 22.04.1. After a lot of troubleshooting previous issues (seems like there's trouble at every step), I am now stuck on installing the project's PHP dependencies through Composer install. For context, I have created a bare git repo on the VPS, pushed my code from the local repo to the VPS, which then put it in the correct folder (/srv/questifyer). Whenever I push code, I run a script to install any new dependencies with composer install.

But when running composer install, either through pushing code or by running it in the command line directly (in the folder where my composer.json is, I get the following errors for most, if not all my dependencies:

 - Downloading symfony/console (v6.0.9)
    Failed to download symfony/console from dist: The "https://api.github.com/repos/symfony/console/zipball/9b190bc7a19d19add1dbb3382721973836e59b50" file could not be written to /srv/questifyer/vendor/composer/tmp-55595ff651708c1f557c741cd2431999: Failed to open stream: Permission denied
    Now trying to download from source
  - Syncing symfony/console (v6.0.9) into cache

The first time I ran it, it made me add a Github OAuth token, which I did. When I check Composer's auth.json, the key is there, correctly. But running composer diagnose gives me the following information:

Checking composer.json: WARNING
require.guzzlehttp/guzzle : exact version constraints (7.4.5) should be avoided if the package follows semantic versioning
Checking platform settings: OK
Checking git settings: OK git version 2.34.1
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: FAIL
[Composer\Downloader\TransportException] curl error 7 while downloading https://api.github.com/: Couldn't connect to server
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: You are not running the latest snapshot version, run `composer self-update` to update (2.4.1 => 9a69c12a0799d5a974f5ec5d2e78be3495b0b06c)
Composer version: 2.4.1
PHP version: 8.1.2
PHP binary path: /usr/bin/php8.1
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
cURL version: 7.81.0 libz 1.2.11 ssl OpenSSL/3.0.2
zip: extension present, unzip present, 7-Zip not available

Specifically the 'Checking github.com oauth access: FAIL' raises questions. Googling hasn't given me any clear answers. What should my next step be? I assume I need to get oauth working correctly, but I'm not sure how. I've tried multiple tokens, including one with all of the permissions. I also tried adding the token to composer.json (which I later removed), but it keeps saying it failed.

0 Answers
Related