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

GitHub Action Workflow fails due to denied permission #7

Closed
oellers opened this issue Apr 4, 2023 · 2 comments · Fixed by #8
Closed

GitHub Action Workflow fails due to denied permission #7

oellers opened this issue Apr 4, 2023 · 2 comments · Fixed by #8

Comments

@oellers
Copy link

oellers commented Apr 4, 2023

Setup
docker image used in workflow: skohub/skohub-vocabs-docker:latest
workflow file example: main.yml
github action: job error

Error (job failed in stage)

name: build public dir with docker image
run: docker run [...]
> gatsby build --prefix-paths
>> `Error:EACCES: permission denied, mkdir '/app/public/static'`

Possibile reason

  • The user/uid or group permissions within the docker does not match the previous action steps (mkdir public <-> volume mount)

Possible solutions

  • add (adduser/addgroup) and/or set user in docker?
  • chown/chmod/chgrp

✔️ Tested workaround

  • changed the folder permissions to be less restrictive in main.yml
- run: mkdir public
- run: chmod -R 777 public
- run: mkdir data
- run: chmod -R 777 data

⚠️ Issue with build (probably unrelated / separate issue?)

  • The github pages did not include an "index.html" with a successful build using the workaround. The gh-pages branch contained only index.de.html and index.en.html. Besides the root, also the generation of concrete concept-index.html is affected, e.g. in a gh-pages: "vocabs/w3id.org/comein/vocabs/medienkompetenzrahmenNRW/" the file 52990101.de.html was generated but 52990101.html was not.
@sroertgen
Copy link
Contributor

Hey Manuel,

you are totally right.
The user in the docker container is a node user with UID 1000. Therefore it is not allowed to interfere with root-created folders.

I added your suggestions to the workflow file and everything seems fine now.

Regarding the issue with the file extensions:

This is indeed they way it is supposed to work. The earlier versions, where this docker image also provided an .html without language tags was a hacky workaround. In order to align this docker image with the official skohub-vocabs image I removed this hack.

I also have to admit that I'm not totally happy with this. The reason for the language based extension is that skohub-vocabs is supposed to run with an apache webserver. The apache will automatically fetch the right language based on your browser settings.

So the suggested workaround for you would be to add .de.html to your index page when linking from it.

If this somehow is not suitable, feel free to open a ticket in the skohub-vocabs repo, so I have a reason to work on it.

Thanks!

I will close this issue for now, feel free to reopen, if the issue remains.

@sroertgen sroertgen linked a pull request Apr 4, 2023 that will close this issue
@oellers
Copy link
Author

oellers commented Apr 4, 2023

Thanks Steffen for clarifying the underlying issue.

I think a major drawback could be, that the id of concepts cannot be used as an URI directly (which previously was the case), so it might be an idea for another ticket to deal with that issue (e.g. htaccess-wise with defaulting to first/one language?)

Example:

I know that the concept ids main purpose is unique identification but from a users perspective some of them look like URIs where users might expect meaningful content.

I will open an issue where the relevance of that could be discussed.

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

Successfully merging a pull request may close this issue.

2 participants