The jekyll-github-metadata returns empty owner data

Hi,

I reported this a couple of days ago, but I feel that this board is the preferred way of communication.

I noticed today that site.github.owner.* was returning null on some properties (like bio or login), and after debugging the object I found that all of its values are null.

The following sample code:

{{ site.github.owner | jsonify }}

Returns this data:

{
    "avatar_url": null,
    "bio": null,
    "blog": null,
    "collaborators": null,
    "company": null,
    "created_at": null,
    "description": null,
    "email": null,
    "followers": null,
    "following": null,
    "has_organization_projects": null,
    "has_repository_projects": null,
    "hireable": null,
    "html_url": null,
    "id": null,
    "is_verified": null,
    "location": null,
    "login": null,
    "name": null,
    "node_id": null,
    "public_gists": null,
    "public_repos": null,
    "type": null,
    "updated_at": null
}

Running jekyll with the --verbose flag does not show any error.

Everything else seems to be fine, just the owner object is having issues.

bundle exec jekyll server --verbose
$ bundle exec jekyll server --verbose
  Logging at level: debug
    Jekyll Version: 4.2.0
Configuration file: /home/alfredo/Public/Git/AlfredoRamos.github.io/_config.yml
  Logging at level: debug
    Jekyll Version: 4.2.0
         Requiring: /home/alfredo/Public/Git/AlfredoRamos.github.io/_plugins/social_network_filter.rb
         Requiring: /home/alfredo/Public/Git/AlfredoRamos.github.io/_plugins/archive_pages_generator.rb
         Requiring: /home/alfredo/Public/Git/AlfredoRamos.github.io/_plugins/read_time_filter.rb
         Requiring: jekyll-github-metadata
         Requiring: jekyll-include-cache
         Requiring: jekyll-paginate-v2
         Requiring: jekyll-sitemap
         Requiring: jekyll-target-blank
   GitHub Metadata: Initializing...
            Source: /home/alfredo/Public/Git/AlfredoRamos.github.io
       Destination: /home/alfredo/Public/Git/AlfredoRamos.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
   GitHub Metadata: Generating for AlfredoRamos/AlfredoRamos.github.io
   GitHub Metadata: Calling @client.repository("AlfredoRamos/AlfredoRamos.github.io", {:accept=>"application/vnd.github.drax-preview+json"})
   GitHub Metadata: Calling @client.pages("AlfredoRamos/AlfredoRamos.github.io", {})
   GitHub Metadata: Calling @client.contributors("AlfredoRamos/AlfredoRamos.github.io")
   GitHub Metadata: Calling @client.latest_release("AlfredoRamos/AlfredoRamos.github.io")
   GitHub Metadata: Calling @client.organization("AlfredoRamos")
   GitHub Metadata: Calling @client.organization_public_members("AlfredoRamos")
   GitHub Metadata: Calling @client.list_repos("AlfredoRamos", {:type=>"public", :accept=>"application/vnd.github.mercy-preview+json"})
   GitHub Metadata: Calling @client.releases("AlfredoRamos/AlfredoRamos.github.io")
   GitHub Metadata: Calling @client.organization("AlfredoRamos")

And jekyll doctor says that everything is fine.

bundle exec jekyll doctor --trace
$ bundle exec jekyll doctor --trace
Configuration file: /home/alfredo/Public/Git/AlfredoRamos.github.io/_config.yml
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
  Your test results are in. Everything looks fine.

My setup:

  • Ruby 2.7.2p137
  • Jekyll 4.2.0
  • jekyll-metadata 2.13.0
  • Personal access token with public_repo and read:user* scopes
  • repository key inside my _config.yml
  • JEKYLL_GITHUB_TOKEN inside a .env file

* I added the read:user scope just to test if it might need it, but it didn’t make a difference.

1 Like

Could it be a rate-limiting issue? After a few runs, I start to see rate-limiting messages in site.github, and site.github.owner is all null. For example, site.github.contributors:

"contributors": { "message": "API rate limit exceeded for X.X.X.X. (But here’s the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", "documentation_url": "https://developer.github.com/v3/#rate-limiting" }

Hi,

Thanks for replying.

I’m not sure, at least I do not get those messages for the contributors object, I get the actual list with all the users data.

    "contributors": [
        ...
        {
            "login": "dependabot[bot]",
            ...
            "type": "Bot",
            "site_admin": false,
            "contributions": 6
        }
        ...
    ]

I’m not sure how to debug if I’m being rate limited inside Jekyll without code modification, however using curl, with the same OAuth token I use to deploy my website, seems that I’m far from being rate-limited.

$ curl -H "Authorization: token [redacted]" -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit
{
  "resources": {
    "core": {
      "limit": 5000,
      "used": 0,
      "remaining": 5000,
      "reset": 1609112437
    },
    "search": {
      "limit": 30,
      "used": 0,
      "remaining": 30,
      "reset": 1609108897
    },
    "graphql": {
      "limit": 5000,
      "used": 0,
      "remaining": 5000,
      "reset": 1609112437
    },
    "integration_manifest": {
      "limit": 5000,
      "used": 0,
      "remaining": 5000,
      "reset": 1609112437
    },
    "source_import": {
      "limit": 100,
      "used": 0,
      "remaining": 100,
      "reset": 1609108897
    },
    "code_scanning_upload": {
      "limit": 500,
      "used": 0,
      "remaining": 500,
      "reset": 1609112437
    }
  },
  "rate": {
    "limit": 5000,
    "used": 0,
    "remaining": 5000,
    "reset": 1609112437
  }
}

Even without authentication:

$ curl -i https://api.github.com/users/AlfredoRamos
HTTP/1.1 200 OK
server: GitHub.com
...
X-Ratelimit-Limit: 60
X-Ratelimit-Remaining: 59
X-Ratelimit-Reset: 1609112253
X-Ratelimit-Used: 1
...

I also tried creating another OAauth token, but I get the same result.

I don’t have another personal account to test if it’s just me, however I would be very odd since I don’t use the OAuth token that often.

It was working just fine until a couple of days ago.

So I get it’s working just fine for you?

I don’t know what’s wrong with my setup :confused:

I think I found the issue.

Checking the output of the jekyll build and jekyll server commands, I noticed that it tries to get the information as it was an organization:

GitHub Metadata: Calling @client.organization("AlfredoRamos")

Jekyll::GitHubMetadata::Owner::owner_info() check for the organization data first, then for user data.

The problem is that c.organization(owner_login) does not evaluate to nil, since it returns the following object:

p c.organization(owner_login)
#=> {:message=>"Not Found", :documentation_url=>"https://docs.github.com/rest/reference/orgs#get-an-organization"}

So c.user(owner_login) is not evaluated next.

If I switch the order of those methods, site.github.owner no longer has null values.

My knowledge in Ruby is limited, so I hope someone could fix it in a proper way.

1 Like

Ah, I see. site.github.owner is working for me, but that is because I tested with an Organization’s repo. Testing with a User’s repo produces the all-null bug.

The site.github does have a few other fields about the owner (owner_name, owner_url, etc), but not all the details you’d expect in the owner hash. It looks like the new owner hash was introduced 2 years ago, but has only ever worked for Orgs, not Users.

2 Likes