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

Error during creating #264

Open
aryoprakarsa opened this issue Jul 20, 2019 · 5 comments
Open

Error during creating #264

aryoprakarsa opened this issue Jul 20, 2019 · 5 comments

Comments

@aryoprakarsa
Copy link

I've an issue during creating statuspage on MacOSX

Traceback (most recent call last): File "/usr/local/bin/statuspage", line 10, in <module> sys.exit(cli()) File "/Library/Python/2.7/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/Library/Python/2.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/Library/Python/2.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Library/Python/2.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Library/Python/2.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/Library/Python/2.7/site-packages/statuspage/statuspage.py", line 73, in update run_update(name=name, token=token, org=org) File "/Library/Python/2.7/site-packages/statuspage/statuspage.py", line 184, in run_update sha = repo.get_git_ref("heads/gh-pages").object.sha File "/Library/Python/2.7/site-packages/github/Repository.py", line 1907, in get_git_ref self.url + prefix + ref File "/Library/Python/2.7/site-packages/github/Requester.py", line 275, in requestJsonAndCheck return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url))) File "/Library/Python/2.7/site-packages/github/Requester.py", line 286, in __check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 409 {u'documentation_url': u'https://developer.github.com/v3/git/refs/#get-a-reference', u'message': u'Git Repository is empty.'}

Anyone could help is there anything can fix this issue ?

@aryoprakarsa
Copy link
Author

UPDATED:

I was execute this command afte delete the existing repo and the result are:

Name: status Systems, eg (Website,API): Website, API Deleting initial labels: 100%|██████████| 9/9 [00:04<00:00, 2.20it/s] Creating status labels: 100%|██████████| 3/3 [00:01<00:00, 1.49it/s] Creating system labels: 100%|██████████| 2/2 [00:01<00:00, 1.96it/s] Traceback (most recent call last): File "/usr/local/bin/statuspage", line 10, in <module> sys.exit(cli()) File "/Library/Python/2.7/site-packages/click/core.py", line 764, in __call__ return self.main(*args, **kwargs) File "/Library/Python/2.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/Library/Python/2.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Library/Python/2.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Library/Python/2.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/Library/Python/2.7/site-packages/statuspage/statuspage.py", line 65, in create run_create(name=name, token=token, systems=systems, org=org, private=private) File "/Library/Python/2.7/site-packages/statuspage/statuspage.py", line 262, in run_create name=name File "/Library/Python/2.7/site-packages/github/Repository.py", line 1651, in create_file input=put_parameters File "/Library/Python/2.7/site-packages/github/Requester.py", line 275, in requestJsonAndCheck return self.__check(*self.requestJson(verb, url, parameters, headers, input, self.__customConnection(url))) File "/Library/Python/2.7/site-packages/github/Requester.py", line 286, in __check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 422 {u'documentation_url': u'https://developer.github.com/v3/repos/contents/#create-or-update-a-file', u'message': u'path cannot start with a slash', u'errors': [{u'field': u'path', u'code': u'invalid', u'resource': u'Commit'}]}

Still no luck

@Chicken-DEV
Copy link

I think I have the same error:

Deleting initial labels: 100%|##########| 9/9 [00:02<00:00,  3.43it/s]
Creating status labels: 100%|##########| 3/3 [00:01<00:00,  2.56it/s]
Creating system labels: 100%|##########| 3/3 [00:00<00:00,  3.10it/s]
Traceback (most recent call last):
  File "/usr/local/bin/statuspage", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/statuspage/statuspage.py", line 65, in create
    run_create(name=name, token=token, systems=systems, org=org, private=private)
  File "/usr/local/lib/python2.7/dist-packages/statuspage/statuspage.py", line 262, in run_create
    name=name
  File "/usr/local/lib/python2.7/dist-packages/github/Repository.py", line 1864, in create_file
    input=put_parameters,
  File "/usr/local/lib/python2.7/dist-packages/github/Requester.py", line 322, in requestJsonAndCheck
    verb, url, parameters, headers, input, self.__customConnection(url)
  File "/usr/local/lib/python2.7/dist-packages/github/Requester.py", line 345, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {"documentation_url": "https://developer.github.com/v3/repos/contents/#create-or-update-a-file", "message": "path cannot start with a slash", "errors": [{"field": "path", "code": "invalid", "resource": "Commit"}]}

@meta-n4vn33t
Copy link

meta-n4vn33t commented Jan 21, 2020

I tried to create status page and have also encountered the same error!

pi@raspberrypi:~ $ statuspage create --token=HIDDEN
Name: mystatuspage
Systems, eg (Website,API): Website, CDN, API
Deleting initial labels: 100%|██████████| 9/9 [00:03<00:00,  2.62it/s]
Creating status labels: 100%|██████████| 3/3 [00:01<00:00,  2.27it/s]
Creating system labels: 100%|██████████| 3/3 [00:01<00:00,  2.27it/s]
Traceback (most recent call last):
  File "/home/pi/.local/bin/statuspage", line 10, in <module>
    sys.exit(cli())
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.local/lib/python2.7/site-packages/statuspage/statuspage.py", l                                                                                                                                   ine 65, in create
    run_create(name=name, token=token, systems=systems, org=org, private=private                                                                                                                                   )
  File "/home/pi/.local/lib/python2.7/site-packages/statuspage/statuspage.py", l                                                                                                                                   ine 262, in run_create
    name=name
  File "/home/pi/.local/lib/python2.7/site-packages/github/Repository.py", line                                                                                                                                    1864, in create_file
    input=put_parameters,
  File "/home/pi/.local/lib/python2.7/site-packages/github/Requester.py", line 3                                                                                                                                   22, in requestJsonAndCheck
    verb, url, parameters, headers, input, self.__customConnection(url)
  File "/home/pi/.local/lib/python2.7/site-packages/github/Requester.py", line 3                                                                                                                                   45, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {"documentation_url": "https://devel                                                                                                                                   oper.github.com/v3/repos/contents/#create-or-update-a-file", "message": "path ca                                                                                                                                   nnot start with a slash", "errors": [{"field": "path", "code": "invalid", "resou                                                                                                                                   rce": "Commit"}]}

mrrsm added a commit to mrrsm/statuspage that referenced this issue Jul 15, 2020
	- Change get_file_contents to get_contents
	- Remove beginning '/' on paths
@mrrsm
Copy link
Contributor

mrrsm commented Jul 15, 2020

Looks like the github api updated and changed some things.

I PR'd my changes which got it working for me.

@meta-n4vn33t
Copy link

meta-n4vn33t commented Jul 16, 2020

@mrrsm great! will try it with your changes and report back.

Update: I moved on to another solution.

chenrui333 pushed a commit that referenced this issue Feb 23, 2022
* Fix create and update github commands #264

	- Change get_file_contents to get_contents
	- Remove beginning '/' on paths

* Fix the unit tests
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

4 participants