Staticman: GITHUB_READING_FILE

Created on 7 Aug 2017  路  16Comments  路  Source: eduardoboucas/staticman

Hello, can someone tell me what's GITHUB_READING_FILE's error about? .

The final result it is:
{"success":false,"errorCode":"GITHUB_READING_FILE"}

Most helpful comment

It means that staticman can't get infos from your repository or read the staticman file. I bangged my head against the wall for a whole afternoon with this error, only to find out that I named my staticman file staticman.yaml instead of staticman.yml...

So check if the repository name you give to staticman is correct and that your staticman configuration file is properly named in your repository root.

All 16 comments

It means that staticman can't get infos from your repository or read the staticman file. I bangged my head against the wall for a whole afternoon with this error, only to find out that I named my staticman file staticman.yaml instead of staticman.yml...

So check if the repository name you give to staticman is correct and that your staticman configuration file is properly named in your repository root.

Think i'm stumbled on same weird error as @SidVal . Definitely have properly named staticman.yml config file. Not sure what this can mean. Looking at the code doesn't say much really

https://github.com/eduardoboucas/staticman/blob/018166e23b31d41f6ea2139db53e11bbd0c6ff56/lib/GitHub.js#L72

Repository name i gave staticman is definitely correct.

My repo is private as i'm trying to configure commenting system with staticman. Does it make any difference ? @eduardoboucas

Does staticman works with private repos ? Anynone else had this error and worked it out ?

Update: I'm actually using same exact code from @eduardoboucas 's https://github.com/eduardoboucas/eduardoboucas.github.io just changed relevant repo information and still have this error. Have no idea what is going on. Any advise ?

Ok somehow i got this working, still not sure what was wrong though. Nothing changed whatsoever in my files. This error seems little erratical...

I'm getting the same issue.
Now I'm also getting MISSING_CONFIG_FIELDS but they are in my staticman.yml file

@mdxprograms, tell us your url's repo to check :+1:

It turned out that I wasn't adding the right data endpoint. For example: mdxprograms/myrepo/articles

I was leaving off the articles portion.

Hello, same issue here.

This is the url I'm trying to hit: https://api.staticman.net/v2/entry/luciano-fiandesio/fiandes.io/master/comments

fields[message] = demo
fields[email] = [email protected]
fields[name] = John Doe
options[slug] = test-123

This is the result:

HTTP/1.1 500 Internal Server Error
Date: Fri, 22 Sep 2017 15:58:13 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 51
Connection: close
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Etag: W/"33-i4+RJ7x588v8656SUbVUL0OJ1k4"
Via: 1.1 vegur
Server: cloudflare-nginx
CF-RAY: 3a2676e358f42d7d-TXL

{"success":false,"errorCode":"GITHUB_READING_FILE"}

Anything else I can try to debug the problem?

@luciano-fiandesio You're trying to use the v2 endpoint, which requires a staticman.yml config file, and yet you're still using a _config.yml file for Staticman config. Check here for a sample config file compatible with v2 endpoints.

@eduardoboucas no, I'm not. I'm using a staticman.yml file.

comments:
  allowedFields          : ['name', 'email', 'replying_to', 'url', origin', 'slug', 'message']
#  requiredFields         : ['name', 'email', 'origin', 'slug', 'message']
  requiredFields         : ['name', 'email', 'message']
  allowedOrigins         : ["localhost", "fiandes.io", "www.fiandes.io", "lucianofiandesio.com", "www.lucianofiandesio.com"]
  branch                 : "master"
  commitMessage          : "New comment. QUICK, go LOOK!"
  filename               : comment-{@timestamp}
  name                   : "Fiandes . io"
  format                 : "yaml"
  moderation             : true
  path                   : "_data/comments/{options.slug}" # "_data/comments/{options.slug}" (default)
  # with Mailgun, which you can get for free at http://mailgun.com.
  # https://mademistakes.com/articles/improving-jekyll-static-comments/
  notifications:
    enabled: false
    #fromAddress: "Thank You <[email protected]>"
    # To encrypt those, you can use the following endpoint: https://api.staticman.net/v2/encrypt/{TEXT TO BE ENCRYPTED}
    # Mailgun API key (encrypted)
    #apiKey: "co8CkQak02QXbz8qXRwGouCJ5Rxr50pmMjpNaEFgfOgrvi3vqWoPsi9tjTl/9VIG6j3FD6WbsLeevZLf6dRazdUED0/FR8kpi7METcef+cYuIcxu7Df2rnUGpyAIEGqRBNhJeMo+KS4kNqxup4vCWDnJyoM3QyUqTjv4qZdMVLM="
    # Mailgun domain (encrypted)
    #domain: "Ssoke2LtfZ62Sy3TFmStaOLcvFUzLAiUeHm+UxTuSSvPu/1b/Cgf3F2l1xopzWpBgAK4lRa7C+BMLXNEmYAH5aKQibe8TXt9yf3b9a5GUcKkh3kjcpODZvMMAAtaKf6D5POrPwcGi4lfXWFyGSuN1op5KSjYi4gAGJ0SONLJnY0="
  transforms:
    email                : "md5"
  reCaptcha:
    enabled: false
  #  siteKey: "6Lfj9ysUAAAAAOWg3kjG9nsoDgJpZBo7PhxAMh1c"
  #  secret: "jlq9b/ZJ74mENEygF6jhYrTs/YUQVZoeMKl9giynbSXBmU5spAj1ETwwzaMOzsRqLukAEvAku5v5Af7O++2n2NGeSLQNOixSJfqCDrNMk3Ob6A4aRN11CQT5qFRlJxyVGmia8tZzqEyd1mrbZpd+AVsIh2sC5jhdrx+zgogCLkk="
  generatedFields:
    date:
      type               : "date"
      options:
        format           : "timestamp-seconds" # "iso8601" (default), "timestamp-seconds", "timestamp-milliseconds"

@luciano-fiandesio I don't see that file in your repo, though (https://github.com/luciano-fiandesio/fiandes.io), and so won't Staticman.

@eduardoboucas the file is in a branch that is not committed yet, I'm testing from my local machine. The master branch doesn't have comments enabled.
I'm looking at your code, and it would be great if you could log the actual error:

https://github.com/eduardoboucas/staticman/blob/018166e23b31d41f6ea2139db53e11bbd0c6ff56/lib/GitHub.js#L72

If I have time later, I'll send you a push request.

If the file is in your local machine, Staticman won't be able to read it. It looks at your repo in whatever branch you tell it to (in your case, master).

Same issue here, I already checked the staticman.yml file and all configurations of the Minimal Mistakes theme and the error persists. My repository is https://github.com/Bira-oliverio/bira.xyz

same problem,
staticman.yml: https://hastebin.com/azicototav.bash
i have a comments folder in my _data folder in my project root

hosted on gh pages

edit: the api 500's on https://api.staticman.net/v2/entry/Wqrld/wqrld.github.io/master/comments
i have also mode a comments folder in my project root but that also didnt seem to have helped

i am using minimal mistakes

edit seem to have found it, repo was accidently names .gitup.io instead of github.io

I am using github pages in a docs folder. So staticman.yml is in the docs folder too, and the staticman API on heroku cannot find the file...

Can I configure staticman on heroku to use the docs folder?

Can I configure staticman on heroku to use the docs folder?

I think you (@gkappler) should open this issue such a new it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taxilly picture taxilly  路  15Comments

BloggerBust picture BloggerBust  路  6Comments

jkbecker picture jkbecker  路  5Comments

lisandroct picture lisandroct  路  7Comments

joeczar picture joeczar  路  3Comments