gvenzl / oci-oracle-xe

Build scripts for Oracle Database XE container/docker images
Apache License 2.0
257 stars 77 forks source link

Permission denied on Github Workflow #234

Closed xkosubek closed 8 months ago

xkosubek commented 8 months ago

Hello,

thanks for that image! I try to include the container in a Github Workflow and mount a directory for init scripts.

services:
      # Oracle service (label used to access the service container)
      oracle:
        # Docker Hub image (feel free to change the tag "latest" to any other available one)
        image: gvenzl/oracle-xe:latest
        # Provide passwords and other environment variables to container
        env:
          ORACLE_RANDOM_PASSWORD: true
          # APP_USER: geo_test
          # APP_USER_PASSWORD: geo_test
        # Forward Oracle port
        ports:
          - 1521:1521
        volumes:
          - ${{ github.workspace }}/tests/data/oracle/init-db:/container-entrypoint-startdb.d
        # Provide healthcheck script options for startup
        options: >-
          --health-cmd healthcheck.sh
          --health-interval 10s
          --health-timeout 5s
          --health-retries 10

In the folder i have one script with the name 01-create-user.sql.

CREATE USER geo_test IDENTIFIED BY geo_test QUOTA UNLIMITED ON USERS;

GRANT CONNECT, RESOURCE, DBA TO geo_test;

The Github workflow ends with an permission denied error:

Deleting the contents of '/home/runner/work/pygeoapi/pygeoapi'
Error: Command failed: rm -rf /home/runner/work/pygeoapi/pygeoapi/tests
rm: cannot remove '/home/runner/work/pygeoapi/pygeoapi/tests/data/oracle/init-db': Permission denied

Has anybody an idea how i can fix that error?

gvenzl commented 8 months ago

Hi @xkosubek,

Thanks a lot for using these images!

The container doesn't change the permissions or ownership of the folder /container-entrypoint-startdb.d or the files inside it.

Could it be that the folder ${{ github.workspace }}/tests/data/oracle/init-db is checked in under some permissions that wouldn't allow the runner to delete it.

Thanks,

xkosubek commented 8 months ago

Thank you for the answer!

The file permissions where 755. I changed it to 777, but the change has no effect.

Getting still the permission error ...

xkosubek commented 8 months ago

Sorry, my fault! I did not read the logs exactly enough .. :-/ It was an error in the combination with actions/checkout@v2 (https://github.com/actions/checkout).

There i had to change the file permissions. Solution: https://github.com/actions/checkout/issues/211

Thanks for your help!

gvenzl commented 8 months ago

Awesome, glad to hear, @xkosubek!