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

Staticman fails to create pull request when making comments #304

Closed
hendrixjoseph opened this issue Jul 17, 2019 · 7 comments
Closed

Staticman fails to create pull request when making comments #304

hendrixjoseph opened this issue Jul 17, 2019 · 7 comments

Comments

@hendrixjoseph
Copy link

Staticman fails to create a pull request when a comment is submitted. A new branch with the comment file is created, however.

I've upgraded from Staticman v2 to Staticman v3 (as a github app) according to Staticman issue #243. This issue happened to me with both v2 and v3 - see issue #6215.

Theories:

  • Staticman no longer has pull request permission due to the large number of spam PRs
  • Apps in general no longer have pull request permission due to the large number of spam PRs (verified as false with this ImgBot pull request )
  • Something else I'm doing wrong
  • Something else wrong with Staticman

My page's url https://hendrixjoseph.github.io/
A direct link to a comment section https://hendrixjoseph.github.io/may-2019-blog-statistics/#reply-title
My page on GitHub.com https://github.com/hendrixjoseph/hendrixjoseph.github.io
A "mirror" of this issue on my site's GitHub hendrixjoseph/hendrixjoseph.github.io#6218

Staticman JSON Response when submitting a comment:

{
	"success": false,
	"rawError": {
		"name": "HttpError",
		"status": 500,
		"headers": {},
		"request": {
			"method": "PUT",
			"url": "https://api.github.com/repos/hendrixjoseph/hendrixjoseph.github.io/contents/_data/comments/rethinking-the-flag-of-huber-heights-ohio/entry1563390336115.yml",
			"headers": {
				"accept": "application/vnd.github.v3+json",
				"user-agent": "Staticman agent octokit.js/16.8.0 Node.js/11.12.0 (Linux 4.4; x64)",
				"authorization": "token v1.328aa9dc55532b7b693cfe34f8de854c3ffb78c1",
				"content-type": "application/json; charset=utf-8"
			},
			"body": "{\"message\":\"Add Staticman comment from JoeHx at https://hendrixjoseph.github.io/\",\"content\":\"X2lkOiBkYWY3NjFlMC1hOGM1LTExZTktODIzNi00ZjMzZTUzNzI4ZjgKbXNnOiB0dHR0dHR0dGVzdApuYW1lOiBKb2VIeAplbWFpbDogZTU5MWYzYWE3YzhjYmQ3ZGQ5ZTMzODk5NTg5NDllZDMKdXJsOiAnaHR0cHM6Ly9oZW5kcml4am9zZXBoLmdpdGh1Yi5pby8nCmRhdGU6IDE1NjMzOTAzMzYK\",\"branch\":\"staticman_daf761e0-a8c5-11e9-8236-4f33e53728f8\"}",
			"request": {
				"timeout": 5000,
				"validate": {
					"author": {
						"type": "object"
					},
					"author.email": {
						"required": true,
						"type": "string"
					},
					"author.name": {
						"required": true,
						"type": "string"
					},
					"branch": {
						"type": "string"
					},
					"committer": {
						"type": "object"
					},
					"committer.email": {
						"required": true,
						"type": "string"
					},
					"committer.name": {
						"required": true,
						"type": "string"
					},
					"content": {
						"required": true,
						"type": "string"
					},
					"message": {
						"required": true,
						"type": "string"
					},
					"owner": {
						"required": true,
						"type": "string"
					},
					"path": {
						"required": true,
						"type": "string"
					},
					"repo": {
						"required": true,
						"type": "string"
					}
				}
			}
		},
		"_smErrorCode": "GITHUB_WRITING_FILE"
	},
	"errorCode": "GITHUB_WRITING_FILE"
}
@sachin10101998
Copy link

Try sending post requests to https://staticmanlabb.herokuapp.com instead of api.staticman.net. Staticman v3 app's limit has crossed.
Although test if the above link works by sending a collaboration invite to @staticmanaima and accepting it through https://staticmanlabb.herokuapp.com/v2/connect/{{your username}}/{{your repository}} and then posting the comments on the above link.
Let me know if it works.

@hendrixjoseph
Copy link
Author

I'll try again later, but I got the following JSON response:

{
   "success":false,
   "rawError":{
      "_smErrorCode":"ERROR_PROCESSING_ENTRY"
   },
   "errorCode":"ERROR_PROCESSING_ENTRY"
}

@hendrixjoseph
Copy link
Author

I've successfully made the Staticman App create a pull request on my other Github Pages/Jekyll Blog (hendrixjoseph/puppy-snuggles#916)

I think I'm going to contact Github support. Right now I can't even reach my settings page (https://github.com/hendrixjoseph/hendrixjoseph.github.io/settings) but only in that repository.

@VincentTam
Copy link
Contributor

VincentTam commented Jul 19, 2019

sending

I would recommend the v3 URL scheme in merged PR #219, which has been @staticmanlab since the very first day of its service.

@hendrixjoseph
Copy link
Author

I tried sending a request to https://staticmanlabb.herokuapp.com/v3/entry/github/hendrixjoseph/hendrixjoseph.github.io/master/comments and got the same error:

{
   "success":false,
   "rawError":{
      "_smErrorCode":"ERROR_PROCESSING_ENTRY"
   },
   "errorCode":"ERROR_PROCESSING_ENTRY"
}

I also tried sending a request to https://staticman3.herokuapp.com/v3/connect/github/hendrixjoseph/hendrixjoseph.github.io after inviting @staticmanlab (& having it accept) and got the following error:

{
   "success":false,
   "rawError":{
      "message":"network timeout at: https://api.github.com/repos/hendrixjoseph/hendrixjoseph.github.io/contents/_data/comments/july-2019-blog-statistics/entry1563732686721.yml",
      "statusCode":500
   },
   "errorCode":"GITHUB_WRITING_FILE"
}

I think I'm going to see what the response is from GitHub support. I have an idea for a workaround if they aren't able to help me.

@VincentTam
Copy link
Contributor

I also tried sending a request to https://staticman3.herokuapp.com/v3/connect/github/hendrixjoseph/hendrixjoseph.github.io after inviting @staticmanlab (& having it accept) and got the following error:

{
   "success":false,
   "rawError":{
      "message":"network timeout at: https://api.github.com/repos/hendrixjoseph/hendrixjoseph.github.io/contents/_data/comments/july-2019-blog-statistics/entry1563732686721.yml",
      "statusCode":500
   },
   "errorCode":"GITHUB_WRITING_FILE"
}

@hendrixjoseph I've just visited your GH Pages, on which comments has been disabled. As a result, I can't reproduce the error and verify your claim.

@hendrixjoseph
Copy link
Author

I got a response from GitHub support. Basically they said they don't know what's going on and it has to do with the Staticman app.

I made my own Heroku instance (mostly because the public instance isn't working, see issues #307 and #299) and got the same error when trying to comment on /hendrixjoseph/hendrixjoseph.github.io, but not /hendrixjoseph/puppy-snuggles. The latter site works fine.

I created another repo to handle comments - /hendrixjoseph/blog-comments. Staticman works fine there.

Note that GITHUB_WRITING_FILE error occurs in file /staticman/blob/master/lib/GitHub.js (or find it via search).

Anyway, it looks as if Staticman timing out when writing the file and/or making the pull request to my particular repository, maybe because the repository is too big? Issue numbers are over 6,000 at this point.

I'm going to close this issue for now.

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

3 participants