pages-gem: "No GitHub API authentication" error
Before submitting an issue, please be sure to
- Read the contributing instructions
- Update to the latest Gem version (either
gem update github-pages
orbundle update github-pages
)
This issue affects
- The site generated by GitHub Pages
- Building sites locally
What did you do (e.g., steps to reproduce)
Add this into the Gemfile:
source "https://rubygems.org"
gem 'github-pages', group: :jekyll_plugins
Run bundle update
and bundle exec jekyll serve
.
Make a small edit to a file.
When Jekyll auto-rebuilds, an error appears in the Terminal that says “GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.”
What did you expect to happen?
I did not expect that Github Metadata error to appear.
Additional information
When I removed the Gemfile, the error went away. Since this is the only gem outside of Jekyll that I’m using in my project, I suspect the error has something to do with github-pages. That’s why I’m filing an issue here.
I fixed the issue by following the resolution described here. This removed the error from occurring.
I just wanted to report this error in case there’s something with the github-pages gem that is causing it.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 12
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Fixes 'No GitHub API authentication' error per https://github.com/github/pages-gem/issues/399 — committed to expressjs/expressjs.com by crandmck 7 years ago
- Fix jekyll issues https://github.com/github/pages-gem/issues/399 — committed to goxcif/goxcif.github.io by goxcif 7 years ago
- Fix Github API metadata warnings reference https://github.com/github/pages-gem/issues/399#issuecomment-301827749 — committed to joeyquarters/joeyquarters.github.io by joeyquarters 6 years ago
- Fix "no GitHub API authentication" warning when generating the pages locally using the fix suggested in: https://github.com/github/pages-gem/issues/399 — committed to JGCRI/gcam-doc by pralitp 6 years ago
- Error Fix Following suggestions to resolve this [issue](https://github.com/github/pages-gem/issues/399). — committed to Whispres/whispres.github.io by Whispres 6 years ago
- Fix for failed Travis CI build https://github.com/github/pages-gem/issues/399 — committed to stevieoberg/stevieoberg.github.io by stevieoberg 6 years ago
- Added `github: [metadata]` to config https://github.com/github/pages-gem/issues/399 — committed to stevieoberg/stevieoberg.github.io by stevieoberg 6 years ago
- fixes build - see https://github.com/github/pages-gem/issues/399#issuecomment-301827749 — committed to chgst/chgst.github.io by nixilla 6 years ago
- Fix github metadata api error (github/pages-gem/issues/399) — committed to jameswilson/jameswilson.github.io by jameswilson 6 years ago
- Fix github metadata api error (github/pages-gem/issues/399) — committed to jameswilson/jameswilson.github.io by jameswilson 6 years ago
- Fixed buld errors caused by GitHub Metadata GitHub Metadata: Error processing value 'baseurl': ERROR: YOUR SITE COULD NOT BE BUILT: ----------------------------------... — committed to laukstein/lea.laukstein.com by stampli-binyamin 6 years ago
- Fix missing metadata Try to fix: GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data. https://github.com/github/pages-gem/issues/399#i... — committed to dleidert/dleidert.github.io by dleidert 5 years ago
- use github token to prevent warning from jekyll cf https://github.com/github/pages-gem/issues/399#issuecomment-450799841 — committed to adrienjoly/cours-nodejs by adrienjoly 5 years ago
- Add `github: [metadata]` to `_config.yaml` https://github.com/github/pages-gem/issues/399 — committed to squaresLab/squaresLab.github.io by jlacomis 5 years ago
- Try to work around github metadata issue: See https://github.com/github/pages-gem/issues/399 — committed to root-project/web by Axel-Naumann 4 years ago
- 👷🐛 Fix a warning shown by Jekyll and GH API Answer provided by this answer https://github.com/github/pages-gem/issues/399#issuecomment-301827749 — committed to UCL-ARC/hpc-shell by dpshelio 4 years ago
- UCL (#1) * 🏛 Adds details for UCL * 👷⭕ Add CI to build preview of the PR * 👷 Changed orb used to build the page * 👷 removes executor - it may not be needed * 👷 Using a 🧪🐋 * 👷 R... — committed to UCL-ARC/hpc-shell by dpshelio 4 years ago
- 👷⭕ Add CI to build preview of the PR 👷 Changed orb used to build the page 👷 removes executor - it may not be needed 👷 Using a 🧪🐋 👷 Run 🧪 by itself without bundle (also without caching depe... — committed to UCL-ARC/hpc-shell by dpshelio 4 years ago
- _config.yml: fix "GitHub Metadata: No GitHub API authentication" error The error was: > GitHub Metadata: No GitHub API authentication could be found. Some > fields may be missing or have incorrect d... — committed to ElectricRCAircraftGuy/ElectricRCAircraftGuy.github.io by ElectricRCAircraftGuy 4 years ago
- 🏗️🔧 add JEKYLL_GITHUB_TOKEN Refs: https://github.com/github/pages-gem/issues/399 — committed to OpenINF/openinf.github.io by DerekNonGeneric 3 years ago
Fixed my issue (not saying it is yours) by adding…
…to
_config.yml
@asnowfix solution didn’t work for me.
I ended up generating a token and putting it in my env:
Generate token: https://github.com/settings/tokens
Run:
Or you can add to your shell config file:
Then in terminal:
A ton thanks to @asnowfix The fix works very well.
I need to point out, add the code as it is.
[metadata]
will be automatically pulled by the generator.@parkr I think the issue here is that it appears to break Jekyll’s watch functionality.
In the scenario described here, which I’m also hitting, I have the following:
Repro
bundle exec jekyll serve
(which watches for changes and regenerates each time)Expected behavior
The files are still generated on each change and we can ignore the errors.
Actual behavior
The jekyll pipeline is broken. The file changes are not actually processed, because jekyll perceives an error to have happened during generation.
In addition to the warning message, I see the following errors:
Instead, we are required to force-quit jekyll and run
bundle exec jekyll serve
each time.Does this help clarify the issue? If so, it would be awesome to open this up for a second look.
It’s also possible that this may be a separate issue entirely; if so, I’m happy to create a new ticket.
Update: A workaround (sort of?)
The workaround described here and referenced above requires two environment variables, a cacert file download, and seemingly a restart of the PC.
I’ll try this as a workaround and note it in my
README
if it works.Alternatively, is there a way we can disable this gem or functionality locally? I apologize for jumping in with a lack of familiarity on the structure of the project (a project which I appreciate on a daily basis, btw – thank you!)
Hey @tomjohnson1492! This is expected. The jekyll-github-metadata gem is automatically enabled for GitHub Pages builds (including builds using this gem locally). It pulls in information from the GitHub API, but first checks the environment for authentication, which is required for some API calls to return the data we want. It’s a warning, not an error, so you should be good to ignore them locally. 👍
For me, the simple solution was to create a personal access token (I only checked the
public_repo
scope as the repository is public), add it to an.env
file in the repository like this:And then added the dotenv gem to my Gemfile as such:
After a
bundle install
, Jekyll now serves the site warning free withJEKYLL_GITHUB_TOKEN
all set.I have the same problem with the new version of github-pages (136) on jekyll (= 3.4.3). It breaks the common dev flow locally, that is the convenient edit-and-refresh way. So I hope it will be fixed soon.