Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Spark - Cannot connect to repo

So, I recently made two big changes ... moved my code from bitbucket to github, and set up a pipeline on heroku with a new staging app (original app is now production).

I got a new github token and placed it into the auth.json file as was done with the previous bitbucket repo (it's a private repo). However, when I push to heroku to build the code with composer there, I cannot connect with the laravel spark repo.

Error:

Installing laravel/spark (v3.0.5): Downloading (failed)    Failed to download laravel/spark 
from dist: The "https://api.github.com/repos/laravel/spark/zipball/512af184c15d793c33328ff03313553ea6feacba" 
file could not be downloaded (HTTP/1.1 404 Not Found)

Now trying to download from source

Installing laravel/spark (v3.0.5): Cloning 512af184c1

[RuntimeException] 

Failed to execute git clone --no-checkout 'https://***:***@github.com/laravel/spark.git' '/tmp/build_9916d292e7eb72e0fbe34f47e3d9854c/vendor/laravel/spark' && cd '/tmp/build_9916d292e7eb72e0fbe34f47e3d9854c/vendor/laravel/spark' && git remote add composer 'https://***:***@github.com/laravel/spark.git' && git fetch composer  

remote: Repository not found.

fatal: repository 'https://***:***@github.com/laravel/spark.git/' not found 

What I have tried ...

Setting the github api token on heroku with

heroku config:set GITHUB_API_TOKEN=<token>

Setting the composer github token

composer config -g github-oauth.github.com <token>

I am connected to the Laravel Spark repo on github and when I run composer on my local machine I am not prompted for a spark token. Every other dependency that I have runs fine - I can change the auth.json and that is not the case, so I don't think this is a problem with lack of access to my github.

Does anyone know how Laravel - Spark checks to grant access and how we can check to see where we are going wrong? There should be a checklist of things that can be looked at if access is denied.

Any help is appreciated. Been stuck for almost a week. I really need some way to figure out how to connect to the Spark repo.

(Edit) Spark is a composer satis repo. I can't really find any info on how to prompt this type of repo to tell me why I can't clone it or how best to communicate with it.

(Edit 2) Also tried changing the git config to ensure that it had the right token. This should be overwritten by the files, but I tried it anyway.

git config github.accesstoken <token>

The response from the software providers is to use an alternative method and place the code under my source control so that composer is not trying to load it. I do not wish to do this for a number of reasons. Again, I need a way to clone the satis repo in composer.

Edit 3: I have also tried going to the URL of the repo and attempting to access one of the versions. This displays the same error as when you go to the URL in the error directly (it's the same URL).

{
    "message": "Not Found",
    "documentation_url": "https://developer.github.com/v3/repos/contents/#get-archive-link"
}

This seems to back up the belief that this is not a composer issue, but something to do with a github setting or spark setting.

Edit 4: It occurred to me that my problems started after upgrading to V6 and I am getting denied access to the spark repo containing versions 1-5 and version 6 is separate. I upgraded my spark version to 6 and had access to that repo. I then tried uploaded the code base to heroku that had version 6 but was denied access to the repo there.

I also tried ...

heroku config:set github_oauth=<token>

Edit 5: I noticed that the output from pushing to heroku included the phrase

NOTICE: Using $COMPOSER_GITHUB_OAUTH_TOKEN for GitHub OAuth.

In response, I found an article asserting that the oauth token should be set in the config portion of composer.json as ...

"config": {
  "github-oauth": {
    "github.com": "<token>"
  }
}

I tried it, but it didn't work

like image 918
Joshua Foxworth Avatar asked Nov 26 '22 01:11

Joshua Foxworth


1 Answers

So, it turns out there were several issues. The final big one was that for some reason, I had to delete my api personal token used for github access and create a new one with full privileges for everything. Once that was set up, I had access and was able to reduce the privileges to repo only.

like image 149
Joshua Foxworth Avatar answered Nov 29 '22 04:11

Joshua Foxworth