Staticman: Getting MISSING_CONFIG_FIELDS

Created on 21 Nov 2017  路  7Comments  路  Source: eduardoboucas/staticman

I'm getting a MISSING_CONFIG_FIELDS error and I can't spot the reason. I've seen all similar issues and I don't have duplicates in my config files, the files are well named, the required fields are present in "staticman.yml"... I don't know what I am missing.

Every time I try to post a comment I get "{success: false, data: ["allowedFields", "branch", "format", "path"], errorCode: "MISSING_CONFIG_FIELDS"}" as a response.

The error is replicable in http://lisandroct.com/blog/2017/11/14/hello-world.html and you can peek the source code at https://github.com/lisandroct/lisandroct.github.io.

Thank you in advance!

needs docs

Most helpful comment

I was having the same issue. It was because I wasn't putting comments at the end of the form POST url.

For @binarymist example. Instead of:

/v2/entry/binarymist/BinaryMistBlog/master/

It is:

/v2/entry/binarymist/BinaryMistBlog/master/comments

All 7 comments

I've finally managed to get it working! My "_config.yml" file was missing the "baseurl" value.

It would be very helpful for newcomers to document this kind of things since Staticman is way more strict with the _config file than Jekyll itself is.

Thank you!

Sorry for the frustration, I'll do my best to improve error reporting and documentation. I'll keep the issue open until I do.

Thanks for the feedback!

I'm getting the same error (with hugo), but baseurl is present. Files are at https://github.com/binarymist/BinaryMistBlog/ on master

Post request

From burp:

POST /v2/entry/binarymist/BinaryMistBlog/master/ HTTP/1.1

fields%5Bname%5D=kim&fields%5Bemail%5D=k%40c&fields%5Burl%5D=http%3A%2F%2Fkims-website&fields%5Bcomment%5D=test+comment

Decoded

fields[name]=kim&fields[email]=k@c&fields[url]=http://kims-website&fields[comment]=test comment

Post response

{
"success": false,
"data": [
"allowedFields",
"branch",
"format",
"path"
],
"rawError": {
"_smErrorCode": "MISSING_CONFIG_FIELDS",
"data": [
"allowedFields",
"branch",
"format",
"path"
]
},
"errorCode": "MISSING_CONFIG_FIELDS"
}

As you can see all these fields are present:

Form submission here: https://github.com/binarymist/BinaryMistBlog/blob/2565430482c8f92d06d266fdf534361ce2bc785c/layouts/partials/comments.html#L39

Template values comming from: https://github.com/binarymist/BinaryMistBlog/blob/master/config.toml#L172

What am I missing?
Any tips would be more than welcome.
Thanks.

I've added

  <input type="hidden" name="options[slug]" value="{{ .Source.BaseFileName }}">

To the post

options%5Bslug%5D=the-cloud-shared-responsibility-model&fields%5Bname%5D=kim&fields%5Bemail%5D=k%40c&fields%5Burl%5D=http%3A%2F%2Fkims-website&fields%5Bcomment%5D=test+comment

but getting the same error.
What is staticman looking for that I'm not giving it?

According to the sample and your website I should have everything I need in the staticman.yml

Hold fire, I may have it working...

Looks like the "optional" property at the end of the API URL needs to exist if it's in the staticman.yml, my mistake was that all examples show a comments: section, I didn't click that that was referenced by the "optional" property in the API URL. I read all the docs, but I think it needs to be made a little more obvious.

I'd be happy to update docs and sub PR. If you'd like that @eduardoboucas please let me know where the docs are, the only ones I found quickly was for docker.
Thanks.

I was having the same issue. It was because I wasn't putting comments at the end of the form POST url.

For @binarymist example. Instead of:

/v2/entry/binarymist/BinaryMistBlog/master/

It is:

/v2/entry/binarymist/BinaryMistBlog/master/comments

Awesome! Had been fighting this for hours now. :-)

@joejag You saved my neck. Thanks man!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jkbecker picture jkbecker  路  5Comments

taxilly picture taxilly  路  15Comments

ex-punctis picture ex-punctis  路  8Comments

PaulieScanlon picture PaulieScanlon  路  3Comments

onwingslikeeagles picture onwingslikeeagles  路  15Comments