Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{"success":false} #108

Open
danPixl opened this issue May 30, 2017 · 25 comments
Open

{"success":false} #108

danPixl opened this issue May 30, 2017 · 25 comments

Comments

@danPixl
Copy link

danPixl commented May 30, 2017

Hi! Whenever I try to submit something with Staticman, it fails with just {"success":false}.

staticman.yml: https://github.com/StratofortressDNS/Domain-Requests/blob/master/staticman.yml

Form (site's on custom DNS): https://github.com/StratofortressDNS/tools/blob/master/register.html#L23

@danPixl
Copy link
Author

danPixl commented May 31, 2017

Paging @eduardoboucas

@emileechen
Copy link

I'm having the same issue. Any help would be appreciated!

@matteocrippa
Copy link

Same issue as above, return 200 as status but Json response is

{
    "success": false
}

my POST is this one:

https://api.staticman.net/v1/entry/matteocrippa/r-view.it/gh-pages

params:

fields[message] = 'test'
fields[name] = 'John'
fields[email] = 'testemail@domain.it'
fields[url] = ''
fields[hidden] = ''
options[slug] = 'test'

@eduardoboucas
Copy link
Owner

Sorry for the silence, people. I'm on the last stages of adding a comprehensive test suite to the project, which is quite a big job. As soon as I'm done with that, this is my next priority.

Please bare with me!

@eduardoboucas
Copy link
Owner

@danPixl You seem to have two curly braces closing the placeholder instead of one on this line: https://github.com/StratofortressDNS/Domain-Requests/blob/master/staticman.yml#L14 — can you try correcting that and see if the issue persists?

@eduardoboucas
Copy link
Owner

@emileechen @matteocrippa could you please provide a link for your Staticman config files, so I can have a look?

@emileechen
Copy link

@matteocrippa
Copy link

@eduardoboucas
Copy link
Owner

@emileechen I have just successfully sent an entry via Staticman to your repository. Here's what I used:

URL: http://localhost:8091/v2/entry/emileechen/eots/master/register (POST)
Fields: fields[owner], fields[name] and fields[id], each with a string.

You can see the PR here.

@eduardoboucas
Copy link
Owner

eduardoboucas commented Jul 3, 2017

@matteocrippa I have submitted an entry to your repository as well. See screenshot below for details. Note that you need to use the v1 endpoint since your config is in the old format (i.e. as part of _config.yml instead of in its own staticman.yml file).

screen shot 2017-07-03 at 10 06 56

I did found an issue in the Staticman API that is causing more useful error messages to be omitted, which I will fix shortly.

@eduardoboucas
Copy link
Owner

@danPixl In your particular case, I can see two things wrong:

  1. Your config is using a named property (comments) but the URL you're using to submit data to isn't reflecting that. You can either remove the property from your config, leaving your config properties at root level, or you can append /comments to the api.staticman.net URL.

  2. You seem to be missing a format property from your config, which should be set to json, yml or frontmatter.

Can you give this a try and see if the issue persists?

Thanks!

@eduardoboucas
Copy link
Owner

I'm going to close this, as all instances of the problem seem to come from malformed configuration files or requests. I've also released a new version of the API which will hopefully provide more useful errors in these situations.

If any of you is still experiencing issues after the changes I've suggested, please reopen this issue.

Thanks!

@matteocrippa
Copy link

I tried to fix updating the config file, but now it is stuck on GITHUB_WRITING_FILE as error, any advice? Seems that you can't reach the repo and read/write it according the promise error

@eduardoboucas
Copy link
Owner

@matteocrippa What URL are you using to submit your entries?

@eduardoboucas eduardoboucas reopened this Jul 4, 2017
@SidVal
Copy link

SidVal commented Jul 4, 2017

Hello @eduardoboucas, in my case, I followed the configuration steps and got to this error message.
I leave you my configuration file and the add.html file so you can see it.

The error: https://sidval.github.io/ABAP/add.html

If you can give me some advice, I will thank you.

Regards


Update: now it's working !

@matteocrippa
Copy link

gotcha https://api.staticman.net/v1/entry/matteocrippa/r-view.it/gh-pages, I have to update to https://api.staticman.net/v1/entry/matteocrippa/r-view.it/master

@GonzaloZiadi
Copy link

@eduardoboucas I am getting {"success":false,"errorCode":"ERROR_PROCESSING_ENTRY"}. I tried to follow mmistakes guide and repo (made-mistakes-jekyll). My repo is over at https://github.com/GonzaloZiadi/windespair if you could take a look. It's also live at www.windespair.com if that helps.

@SidVal
Copy link

SidVal commented Jul 25, 2017

@GonzaloZiadi here https://github.com/GonzaloZiadi/windespair/blob/master/staticman.yml#L13 you've got 5 fields, and in the comment form you've got 4 fields. 😐 Please fix that.

@GonzaloZiadi
Copy link

@SidVal
Copy link

SidVal commented Jul 25, 2017

Ah, ok.
I'll try to help you here: https://github.com/GonzaloZiadi/windespair/issues/1

@GonzaloZiadi
Copy link

I was able to fix it by starting over and slowly adding parts back on. Thanks again @SidVal. Code is on my repo. I used the staticman docs and mmistakes post (https://mademistakes.com/articles/improving-jekyll-static-comments/) and then made some changes.
Replies go one level deep.

@pedroprieto
Copy link

Hi guys,

I was trying to use staticman and came across the same problem. I copied the sample config file from the repo and got the same error, {"success":false}.

After changing everything once and again, I finally noticed that my staticman.yml file was not well formatted: the last line, email: md5, was not correctly indented (it appeared at the beginning of the line). That happened when I copied and pasted the code directly from the normal GitHub file view; when I switched to the raw view of the file in GitHub, the copy & paste worked like a charm (the last line was correctly indented).

I hope it helps!!

@bauerjj
Copy link

bauerjj commented Jul 31, 2018

@pedroprieto In addition to the formatting of staticman.yml, I also had to turn off uBlock Origin since I had it configured aggressively and it was blocking the recaptcha api.js from loading.

@VincentTam
Copy link
Contributor

I think this issue can be closed since v1 is obsolete, and everybody here has finally resolved their problem.

@deadlydog
Copy link
Contributor

I recently had this problem, and it was due to ReCaptcha. It turned out that I encrypted my ReCaptcha secret with the public staticman instance, so then obviously my private instance didn't know how to decrypt the value.

The real issue here though is that more details about the error don't get returned back through the web response, so I think that error handling code needs to be updated a bit. For me, getSiteConfig() in this line was failing and throwing an exception, which was getting caught and sent to the sendResponse function in this line. The issue is that the sendResponse only attaches error details if it's a known error, due to the logic of the if statement in this line. So it seems the solution is we want to attach the error details back in the response, even when it's an unknown type of error.

I'm going to take a crack at a PR to fix this, but my javascript skills are 10+ years rusty, so we'll see how it goes. If I'm unable to get to it, at least I've posted the details of what changes are needed for someone else to do it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants