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

Submission App Error #277

Closed
lea-33 opened this issue Oct 16, 2024 · 7 comments
Closed

Submission App Error #277

lea-33 opened this issue Oct 16, 2024 · 7 comments
Assignees

Comments

@lea-33
Copy link
Collaborator

lea-33 commented Oct 16, 2024

failed to update YAML file and create pull request: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/rest/git/refs#create-a-reference", "status": "404"}

I tried to submit something via the Submission app and got this error.

@haesleinhuepf
Copy link
Member

It would be good to have a complete stack trace of this error - to know where exactly it happens

@lea-33
Copy link
Collaborator Author

lea-33 commented Oct 16, 2024

image

There is no stack trace of the error in the Terminal, I can only see this error in the Submission App.
In the Terminal there is only:

_You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://192.168.31.16:8501

Adding nfdi4bioimage.yml_

@lea-33
Copy link
Collaborator Author

lea-33 commented Oct 16, 2024

I now created a fine-grained token and used this, now I have a different error:

Failed to update YAML file and create pull request: 403 {"message": "Resource not accessible by personal access token", "documentation_url": "https://docs.github.com/rest/git/refs#create-a-reference", "status": "403"}

In the Terminal it now says:
Request POST /repos/NFDI4BIOIMAGE/training/git/refs failed with 403: Forbidden

@SeverusYixin
Copy link
Collaborator

What I found about the 403 and 404 statuses is related to the API token set issue.

Make sure that the GitHub personal access token you are using has the required permissions for the repository: repo.

Make sure that the user associated with the token has write or maintain permissions on the repository: repo.

The "workflow" also requires.

These links may be useful for you:

https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api?apiVersion=2022-11-28

https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api?apiVersion=2022-11-28#404-not-found-for-an-existing-resource

https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28

@haesleinhuepf
Copy link
Member

Also consider commenting out the try and except block here and here. We could then read the entire error message and have a better idea what exactly is going wrong.

@lea-33
Copy link
Collaborator Author

lea-33 commented Oct 18, 2024

@haesleinhuepf I tried several things again. Commenting the block out did not change the fact that I can't see the error messages in the terminal.. I also tried to add some debugging print statements in the code and it seems like it fails at the point where it should update the file (

repo.update_file(file_path, f"Add new entry", new_yaml_content, file_contents.sha, branch=branch_name)
). I also tried creating a test pull request manually and it did not work. Also I can't yet assign to issues so maybe something is not perfectly set with my authorization in the project?

@lea-33
Copy link
Collaborator Author

lea-33 commented Oct 18, 2024

Turned out I just did not have writing access to the repository already. It worked now!! @haesleinhuepf

@lea-33 lea-33 closed this as completed Oct 18, 2024
@lea-33 lea-33 self-assigned this Oct 18, 2024
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