YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

404 Issue when Updating (Fine grained tokens?)

TONYCRE8 opened this issue · comments

I've taken a look at issues raised before, and haven't found a solution so I'm going to post it here.
I've set up my plugin updater as the documentation provides, but when I go to check for an update I get the following errors:

Could not determine if updates are available for Custom Plugin.
1. GitHub API error. Base URL: "/repos/:user/:repo/releases/latest", HTTP status code: 404. puc-github-http-error
2. GitHub API error. Base URL: "/repos/:user/:repo/tags", HTTP status code: 404. puc-github-http-error
3. GitHub API error. Base URL: "/repos/:user/:repo/branches/main", HTTP status code: 404. puc-github-http-error
4. Could not retrieve version information from the repository. This usually means that the update checker either can't connect to the repository or it's configured incorrectly. puc-no-update-source

I've just checked with our server provider, and there's nothing about the firewall blocking the ip. The repo I'm connecting to is private, but I have generated an adequate key for it. I'm curious if this is because I'm using a fine-grained token and not a generic token. But if I was to use a generic token, I would like to ask how I get this to work with a private organisation's files. With the fine-grained token, I can at least target the specific repos.

Any help would be appreciated, happy to provide context where possible.

I've only done very basic testing with fine-grained tokens, but they seem to work fine with PUC.

Here are some - probably obvious - things to check:

  • Is the repository URL that's passed to buildUpdateChecker correct? An incorrect URL could result in similar errors.
  • Is the token for the right repository?
  • Does the token have read access to code and metadata?
  • Is the token still valid (i.e. not expired)?
  • Install Debug Bar (if not already installed), go to the "PUC (your-plugin-slug)" tab. Does "Authentication enabled" say "Yes"?

Hi, think I found the issue that one of your comments hinted at.

Basically, when I was setting up the token, it seems like it wasn't updating the permissions properly, as it kept defaulting to a general token. Not sure why, but it will default like that unless I give it specific permissions.

Thanks for your help!