Git-updater: This repository has not connected to the API or was unable to connect.

Created on 14 Jan 2021  路  17Comments  路  Source: afragen/git-updater

I used github-updater plugin for all my customers and all of them working well.
But today I installed it for my new client and when installing theme from Gitlab I got forbidden error.
And when I install theme manually and I try to set access token for updating it I got this error on title of a small red circle after theme name:
This repository has not connected to the API or was unable to connect.
I think that maybe its because of web hosting probably some extensions not activate on it
I want to ask you which extensions should be active on web server for using this plugin?

All 17 comments

There are no special extensions required. That type of error is usually an authentication error. Make sure you have entered the token correctly. You might want to check the setting to bypassed WP-Cron in the GHU settings and install Query Monitor to see what the HTTP error is.

Hello Andy,
I'm having the same issue for a theme that used to update without any problem since last update.
I set GHU to bypass WP-Cron and installed Query Monitor, here's the error:

Method: GET

URL: https://api.github.com/repos/paperplanefactory/spazioquaranta/contents/style.css
?ref=master

Status: 404 Not Found
HTTP API Transport: curl
DNS Resolution Time: 0.0378
Connection Time: 0.0606
Transfer Start Time (TTFB): 0.2967
Response Size: 117 B
Response Content Type: application/json; charset=utf-8
IP Address: 140.82.121.6

Caller: Fragen\G\API->api()
wp-content/plugins/github-updater/src/GitHub_Updater/API.php:199
Fragen\G\API->get_remote_api_info()
wp-content/plugins/github-updater/src/GitHub_Updater/Traits/API_Common.php:128
Fragen\G\A\GitHub_API->get_remote_info()
wp-content/plugins/github-updater/src/GitHub_Updater/API/GitHub_API.php:60
Fragen\G\Base->get_remote_repo_meta()
wp-content/plugins/github-updater/src/GitHub_Updater/Base.php:298
Fragen\G\Theme->get_remote_theme_meta()
wp-content/plugins/github-updater/src/GitHub_Updater/Theme.php:248
Fragen\G\Base->get_meta_themes()
wp-content/plugins/github-updater/src/GitHub_Updater/Base.php:189
Fragen\G\Base->load()
wp-content/plugins/github-updater/src/GitHub_Updater/Base.php:173
do_action('init')
wp-includes/plugin.php:484

Component: Plugin: github-updater

Timeout: 5

Time: 0.2969

I test that for Github repository and the problem still not fixed.

404 errors on GitHub are almost always authentication issues if it's a private plugin.

You might try creating a new personal access token and ensure it has all the correct scopes. https://docs.github.com/en/developers/apps/scopes-for-oauth-apps
https://docs.github.com/en/rest/overview/troubleshooting#404-error-for-an-existing-repository

It's the same for private themes? I just created a personal access token with all the correct scopes but it still gives me the same error

Without access to the repository I have no further way to seeing what the issue is, but a 404 error from GitHub is an authentication issue.

Make sure you have an access token with the correct scopes and that it is saved correctly in GitHub Updater Settings.

I know... but is it ok that look for style.css in "contents" folder? There's no such folder in my repo.
https://api.github.com/repos/paperplanefactory/spazioquaranta/contents/style.css
And, if you need, I can add you as collaborator.

@paperplanefactory the API URL isn't the same as the file structure.
Adding me as a collaborator should be enough.

@paperplanefactory So here's the issue. You have changed your default branch from master to main. Now you need to add the Primary Branch: main header to the style.css file.

Thank you!

@halftonestudio if you could somehow give me access to the repository it would help to figure it out.

@afragen hft-wene repository access added for you.

@halftonestudio same issue. I see that you added the Primary Branch: main to the style.css file. Also you only need a single GitHub Theme URI header.

@halftonestudio Seems to be working now that the Primary Branch header has been added.

I did that but the problem still not fixed. @afragen

PS: I rename the main branch to master in github and the porblem fixed.
thanks dear @afragen

@halftonestudio The Primary Branch header needs to be in the installed version and in the remote repository. It worked for me because I installed the version that already had the additional header.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

klihelp picture klihelp  路  4Comments

wormeyman picture wormeyman  路  5Comments

blachawk picture blachawk  路  12Comments

franzarmas picture franzarmas  路  8Comments

PthPndr picture PthPndr  路  11Comments