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

Permission denied error on update_repo #1098

Open
jseager7 opened this issue Aug 29, 2024 · 1 comment
Open

Permission denied error on update_repo #1098

jseager7 opened this issue Aug 29, 2024 · 1 comment

Comments

@jseager7
Copy link
Contributor

I recently tried to run sh run.sh make update_repo but got a permission denied error when the script tried to remove files on the second run (see console output below).

I'm not sure if the script has completed successfully so I don't want to merge these changes until I know that's the case. If all I need to do is delete these files manually, then that's fine.

Note that I'm running Docker in rootless mode, which might be part of the problem.

I ran the update_repo command twice following the instructions given here:

Now run the update command TWICE (the first time it may fail, as the update command needs to update itself).

Here's the output from the first run:

sh ../scripts/update_repo.sh
This (experimental) update script will create a new repo according to your config file. It will:
(1) overwrite your repositories Makefile, ODK sparql queries (your custom queries wont be touched) and docker wrapper (run.sh).
(2) and add missing files, if any.
INFO:root:  Copying: /tools/templates/CONTRIBUTING.md.jinja2 -> target/phipo/CONTRIBUTING.md.jinja2
INFO:root:  Copying: /tools/templates/README.md.jinja2 -> target/phipo/README.md.jinja2
INFO:root:  Copying: /tools/templates/_dynamic_files.jinja2 -> target/phipo/_dynamic_files.jinja2
INFO:root:  Copying: /tools/templates/CODE_OF_CONDUCT.md -> target/phipo/CODE_OF_CONDUCT.md
INFO:root:  Copying: /tools/templates/.gitignore.jinja2 -> target/phipo/.gitignore.jinja2
INFO:root:  Copying: /tools/templates/issue_template.md.jinja2 -> target/phipo/issue_template.md.jinja2
INFO:root:Applying templates
INFO:root:  Compiling: /tools/templates/CONTRIBUTING.md.jinja2 -> target/phipo/CONTRIBUTING.md
INFO:root:  Compiling: /tools/templates/README.md.jinja2 -> target/phipo/README.md
INFO:root:  Unpacking: target/phipo/_dynamic_files
INFO:root:  Unpacking into: target/phipo/src/ontology/phipo-edit.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/phipo-idranges.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/phipo.Makefile
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/ido_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/go_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/ro_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/chebi_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/pato_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/so_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/cl_import.owl
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/ido_terms.txt
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/go_terms.txt
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/ro_terms.txt
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/chebi_terms.txt
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/pato_terms.txt
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/so_terms.txt
INFO:root:  Unpacking into: target/phipo/src/ontology/imports/cl_terms.txt
INFO:root:  Unpacking into: target/phipo/src/metadata/README.md
INFO:root:  Unpacking into: target/phipo/src/metadata/phipo.md
INFO:root:  Unpacking into: target/phipo/src/metadata/phipo.yml
INFO:root:  Unpacking into: target/phipo/src/patterns/definitions.owl
INFO:root:  Unpacking into: target/phipo/src/patterns/pattern.owl
INFO:root:  Unpacking into: target/phipo/src/patterns/README.md
INFO:root:  Unpacking into: target/phipo/src/patterns/data/default/example.tsv
INFO:root:  Unpacking into: target/phipo/src/patterns/dosdp-patterns/example.yaml
INFO:root:  Unpacking into: target/phipo/src/patterns/dosdp-patterns/external.txt
INFO:root:  Unpacking into: target/phipo/src/patterns/data/default/README.md
INFO:root:  Unpacking into: target/phipo/src/sparql/phipo_terms.sparql
INFO:root:  Unpacking into: target/phipo/src/sparql/owldef-self-reference-violation.sparql
INFO:root:  Unpacking into: target/phipo/src/sparql/iri-range-violation.sparql
INFO:root:  Unpacking into: target/phipo/src/sparql/label-with-iri-violation.sparql
INFO:root:  Unpacking into: target/phipo/src/sparql/multiple-replaced_by-violation.sparql
INFO:root:  Unpacking into: target/phipo/src/sparql/dc-properties-violation.sparql
INFO:root:  Unpacking into: target/phipo/.github/workflows/qc.yml
INFO:root:  Compiling: /tools/templates/.gitignore.jinja2 -> target/phipo/.gitignore
INFO:root:  Compiling: /tools/templates/issue_template.md.jinja2 -> target/phipo/issue_template.md
INFO:root:Applying templates
INFO:root:  Copying: /tools/templates/src/scripts/update_repo.sh.jinja2 -> target/phipo/src/scripts/update_repo.sh.jinja2
INFO:root:  Copying: /tools/templates/src/scripts/run-command.sh -> target/phipo/src/scripts/run-command.sh
INFO:root:  Copying: /tools/templates/src/scripts/validate_id_ranges.sc -> target/phipo/src/scripts/validate_id_ranges.sc
INFO:root:Applying templates
INFO:root:  Compiling: /tools/templates/src/scripts/update_repo.sh.jinja2 -> target/phipo/src/scripts/update_repo.sh
INFO:root:  Copying: /tools/templates/src/sparql/labels.sparql -> target/phipo/src/sparql/labels.sparql
INFO:root:  Copying: /tools/templates/src/sparql/README.md.jinja2 -> target/phipo/src/sparql/README.md.jinja2
INFO:root:  Copying: /tools/templates/src/sparql/class-count-by-prefix.sparql -> target/phipo/src/sparql/class-count-by-prefix.sparql
INFO:root:  Copying: /tools/templates/src/sparql/inject-synonymtype-declaration.ru.jinja2 -> target/phipo/src/sparql/inject-synonymtype-declaration.ru.jinja2
INFO:root:  Copying: /tools/templates/src/sparql/preprocess-module.ru -> target/phipo/src/sparql/preprocess-module.ru
INFO:root:  Copying: /tools/templates/src/sparql/basic-report.sparql -> target/phipo/src/sparql/basic-report.sparql
INFO:root:  Copying: /tools/templates/src/sparql/obsoletes.sparql -> target/phipo/src/sparql/obsoletes.sparql
INFO:root:  Copying: /tools/templates/src/sparql/terms.sparql -> target/phipo/src/sparql/terms.sparql
INFO:root:  Copying: /tools/templates/src/sparql/synonyms.sparql -> target/phipo/src/sparql/synonyms.sparql
INFO:root:  Copying: /tools/templates/src/sparql/edges.sparql -> target/phipo/src/sparql/edges.sparql
INFO:root:  Copying: /tools/templates/src/sparql/simple-seed.sparql -> target/phipo/src/sparql/simple-seed.sparql
INFO:root:  Copying: /tools/templates/src/sparql/postprocess-module.ru -> target/phipo/src/sparql/postprocess-module.ru
INFO:root:  Copying: /tools/templates/src/sparql/xrefs.sparql -> target/phipo/src/sparql/xrefs.sparql
INFO:root:  Copying: /tools/templates/src/sparql/inject-subset-declaration.ru.jinja2 -> target/phipo/src/sparql/inject-subset-declaration.ru.jinja2
INFO:root:  Copying: /tools/templates/src/sparql/subsets-labeled.sparql -> target/phipo/src/sparql/subsets-labeled.sparql
INFO:root:Applying templates
INFO:root:  Compiling: /tools/templates/src/sparql/README.md.jinja2 -> target/phipo/src/sparql/README.md
INFO:root:  Compiling: /tools/templates/src/sparql/inject-synonymtype-declaration.ru.jinja2 -> target/phipo/src/sparql/inject-synonymtype-declaration.ru
INFO:root:  Compiling: /tools/templates/src/sparql/inject-subset-declaration.ru.jinja2 -> target/phipo/src/sparql/inject-subset-declaration.ru
INFO:root:  Copying: /tools/templates/src/ontology/catalog-v001.xml.jinja2 -> target/phipo/src/ontology/catalog-v001.xml.jinja2
INFO:root:  Copying: /tools/templates/src/ontology/run.bat.jinja2 -> target/phipo/src/ontology/run.bat.jinja2
INFO:root:  Copying: /tools/templates/src/ontology/run.sh.jinja2 -> target/phipo/src/ontology/run.sh.jinja2
INFO:root:  Copying: /tools/templates/src/ontology/Makefile.jinja2 -> target/phipo/src/ontology/Makefile.jinja2
INFO:root:  Copying: /tools/templates/src/ontology/README-editors.md.jinja2 -> target/phipo/src/ontology/README-editors.md.jinja2
INFO:root:Applying templates
INFO:root:  Compiling: /tools/templates/src/ontology/catalog-v001.xml.jinja2 -> target/phipo/src/ontology/catalog-v001.xml
INFO:root:  Compiling: /tools/templates/src/ontology/run.bat.jinja2 -> target/phipo/src/ontology/run.bat
INFO:root:  Compiling: /tools/templates/src/ontology/run.sh.jinja2 -> target/phipo/src/ontology/run.sh
INFO:root:  Compiling: /tools/templates/src/ontology/Makefile.jinja2 -> target/phipo/src/ontology/Makefile
INFO:root:  Compiling: /tools/templates/src/ontology/README-editors.md.jinja2 -> target/phipo/src/ontology/README-editors.md
INFO:root:  Copying: /tools/templates/src/ontology/tmp/.gitkeep -> target/phipo/src/ontology/tmp/.gitkeep
INFO:root:Applying templates
INFO:root:Created files:
INFO:root:  File: target/phipo/CODE_OF_CONDUCT.md
INFO:root:  File: target/phipo/CONTRIBUTING.md
INFO:root:  File: target/phipo/README.md
INFO:root:  File: target/phipo/src/ontology/phipo-edit.owl
INFO:root:  File: target/phipo/src/ontology/phipo-idranges.owl
INFO:root:  File: target/phipo/src/ontology/phipo.Makefile
INFO:root:  File: target/phipo/src/ontology/imports/ido_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/go_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/ro_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/chebi_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/pato_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/so_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/cl_import.owl
INFO:root:  File: target/phipo/src/ontology/imports/ido_terms.txt
INFO:root:  File: target/phipo/src/ontology/imports/go_terms.txt
INFO:root:  File: target/phipo/src/ontology/imports/ro_terms.txt
INFO:root:  File: target/phipo/src/ontology/imports/chebi_terms.txt
INFO:root:  File: target/phipo/src/ontology/imports/pato_terms.txt
INFO:root:  File: target/phipo/src/ontology/imports/so_terms.txt
INFO:root:  File: target/phipo/src/ontology/imports/cl_terms.txt
INFO:root:  File: target/phipo/src/metadata/README.md
INFO:root:  File: target/phipo/src/metadata/phipo.md
INFO:root:  File: target/phipo/src/metadata/phipo.yml
INFO:root:  File: target/phipo/src/patterns/definitions.owl
INFO:root:  File: target/phipo/src/patterns/pattern.owl
INFO:root:  File: target/phipo/src/patterns/README.md
INFO:root:  File: target/phipo/src/patterns/data/default/example.tsv
INFO:root:  File: target/phipo/src/patterns/dosdp-patterns/example.yaml
INFO:root:  File: target/phipo/src/patterns/dosdp-patterns/external.txt
INFO:root:  File: target/phipo/src/patterns/data/default/README.md
INFO:root:  File: target/phipo/src/sparql/phipo_terms.sparql
INFO:root:  File: target/phipo/src/sparql/owldef-self-reference-violation.sparql
INFO:root:  File: target/phipo/src/sparql/iri-range-violation.sparql
INFO:root:  File: target/phipo/src/sparql/label-with-iri-violation.sparql
INFO:root:  File: target/phipo/src/sparql/multiple-replaced_by-violation.sparql
INFO:root:  File: target/phipo/src/sparql/dc-properties-violation.sparql
INFO:root:  File: target/phipo/.github/workflows/qc.yml
INFO:root:  File: target/phipo/.gitignore
INFO:root:  File: target/phipo/issue_template.md
INFO:root:  File: target/phipo/src/scripts/run-command.sh
INFO:root:  File: target/phipo/src/scripts/validate_id_ranges.sc
INFO:root:  File: target/phipo/src/scripts/update_repo.sh
INFO:root:  File: target/phipo/src/sparql/labels.sparql
INFO:root:  File: target/phipo/src/sparql/class-count-by-prefix.sparql
INFO:root:  File: target/phipo/src/sparql/preprocess-module.ru
INFO:root:  File: target/phipo/src/sparql/basic-report.sparql
INFO:root:  File: target/phipo/src/sparql/obsoletes.sparql
INFO:root:  File: target/phipo/src/sparql/terms.sparql
INFO:root:  File: target/phipo/src/sparql/synonyms.sparql
INFO:root:  File: target/phipo/src/sparql/edges.sparql
INFO:root:  File: target/phipo/src/sparql/simple-seed.sparql
INFO:root:  File: target/phipo/src/sparql/postprocess-module.ru
INFO:root:  File: target/phipo/src/sparql/xrefs.sparql
INFO:root:  File: target/phipo/src/sparql/subsets-labeled.sparql
INFO:root:  File: target/phipo/src/sparql/README.md
INFO:root:  File: target/phipo/src/sparql/inject-synonymtype-declaration.ru
INFO:root:  File: target/phipo/src/sparql/inject-subset-declaration.ru
INFO:root:  File: target/phipo/src/ontology/catalog-v001.xml
INFO:root:  File: target/phipo/src/ontology/run.bat
INFO:root:  File: target/phipo/src/ontology/run.sh
INFO:root:  File: target/phipo/src/ontology/Makefile
INFO:root:  File: target/phipo/src/ontology/README-editors.md
INFO:root:  File: target/phipo/src/ontology/tmp/.gitkeep
INFO:root:  File: target/phipo/src/ontology/phipo-odk.yaml
Repository files have been successfully copied, but no git commands have been run.
total 20
drwxr-xr-x 2 root root 4096 Aug 29 09:33 metadata
drwxr-xr-x 4 root root 4096 Aug 29 09:33 ontology
drwxr-xr-x 4 root root 4096 Aug 29 09:33 patterns
drwxr-xr-x 2 root root 4096 Aug 29 09:33 scripts
drwxr-xr-x 2 root root 4096 Aug 29 09:33 sparql
total 20
drwxrwxr-x 2 root root 4096 Sep  5  2021 metadata
drwxrwxr-x 7 root root 4096 Aug 29 09:33 ontology
drwxrwxr-x 4 root root 4096 Aug 29 09:33 patterns
drwxrwxr-x 3 root root 4096 Nov 23  2022 scripts
drwxrwxr-x 2 root root 4096 Oct 12  2023 sparql
WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)
WARNING: Your QC workflows have not been updated automatically. Please update the ODK version number(s) in .github/workflows/qc.yml.
Ontology repository update successfully completed.
run.sh: 77: Syntax error: word unexpected

Then the second run, where the error happens:

sh ../scripts/update_repo.sh
This (experimental) update script will create a new repo according to your config file. It will:
(1) overwrite your repositories Makefile, ODK sparql queries (your custom queries wont be touched) and docker wrapper (run.sh).
(2) and add missing files, if any.
rm: cannot remove 'target/phipo/src/scripts/run-command.sh': Permission denied
rm: cannot remove 'target/phipo/src/scripts/update_repo.sh': Permission denied
rm: cannot remove 'target/phipo/src/scripts/validate_id_ranges.sc': Permission denied
rm: cannot remove 'target/phipo/src/sparql/labels.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/class-count-by-prefix.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/inject-subset-declaration.ru': Permission denied
rm: cannot remove 'target/phipo/src/sparql/preprocess-module.ru': Permission denied
rm: cannot remove 'target/phipo/src/sparql/basic-report.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/obsoletes.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/owldef-self-reference-violation.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/terms.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/phipo_terms.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/label-with-iri-violation.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/synonyms.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/dc-properties-violation.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/edges.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/simple-seed.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/postprocess-module.ru': Permission denied
rm: cannot remove 'target/phipo/src/sparql/inject-synonymtype-declaration.ru': Permission denied
rm: cannot remove 'target/phipo/src/sparql/multiple-replaced_by-violation.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/xrefs.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/iri-range-violation.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/subsets-labeled.sparql': Permission denied
rm: cannot remove 'target/phipo/src/sparql/README.md': Permission denied
rm: cannot remove 'target/phipo/src/ontology/phipo.Makefile': Permission denied
rm: cannot remove 'target/phipo/src/ontology/run.bat': Permission denied
rm: cannot remove 'target/phipo/src/ontology/Makefile': Permission denied
rm: cannot remove 'target/phipo/src/ontology/phipo-edit.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/README-editors.md': Permission denied
rm: cannot remove 'target/phipo/src/ontology/phipo-idranges.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/run.sh': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/ro_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/cl_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/ido_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/chebi_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/go_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/ro_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/cl_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/pato_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/chebi_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/so_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/so_import.owl': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/go_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/ido_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/imports/pato_terms.txt': Permission denied
rm: cannot remove 'target/phipo/src/ontology/catalog-v001.xml': Permission denied
rm: cannot remove 'target/phipo/src/ontology/phipo-odk.yaml': Permission denied
rm: cannot remove 'target/phipo/src/ontology/tmp/.gitkeep': Permission denied
rm: cannot remove 'target/phipo/src/metadata/phipo.md': Permission denied
rm: cannot remove 'target/phipo/src/metadata/phipo.yml': Permission denied
rm: cannot remove 'target/phipo/src/metadata/README.md': Permission denied
rm: cannot remove 'target/phipo/src/patterns/data/default/example.tsv': Permission denied
rm: cannot remove 'target/phipo/src/patterns/data/default/README.md': Permission denied
rm: cannot remove 'target/phipo/src/patterns/definitions.owl': Permission denied
rm: cannot remove 'target/phipo/src/patterns/pattern.owl': Permission denied
rm: cannot remove 'target/phipo/src/patterns/dosdp-patterns/example.yaml': Permission denied
rm: cannot remove 'target/phipo/src/patterns/dosdp-patterns/external.txt': Permission denied
rm: cannot remove 'target/phipo/src/patterns/README.md': Permission denied
rm: cannot remove 'target/phipo/.gitignore': Permission denied
rm: cannot remove 'target/phipo/CODE_OF_CONDUCT.md': Permission denied
rm: cannot remove 'target/phipo/CONTRIBUTING.md': Permission denied
rm: cannot remove 'target/phipo/.github/workflows/qc.yml': Permission denied
rm: cannot remove 'target/phipo/README.md': Permission denied
rm: cannot remove 'target/phipo/issue_template.md': Permission denied
make: *** [Makefile:755: update_repo] Error 1
@gouttegd
Copy link
Contributor

From which version were you migrating?

I'm not sure if the script has completed successfully

Most likely, yes.

To check, you can try generating a diff of all changed files in the repository. Post that diff here and we’ll be able to tell you whether everything that should have changed has indeed changed.

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

2 participants