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

[FR] Improve UX of CLI introspection failures due to filesystem permissions #11

Open
nihxdr opened this issue Sep 25, 2024 · 1 comment

Comments

@nihxdr
Copy link
Contributor

nihxdr commented Sep 25, 2024

DDN CLI Version: v2.5.0
MySQL connector version: 0.1.0


When running the command ddn connector introspect mysql, getting following error:

>> ddn connector introspect mysql --log-level debug

6:48AM DBG global config directory is not pre-set, defaulting
6:48AM DBG global config directory set as '/home/azureuser/.ddn'
6:48AM DBG global config file set as '/home/azureuser/.ddn/config.yaml'
6:48AM DBG global config file exists, verifying contents
6:48AM DBG global config is not pre-set, reading from current env
6:48AM DBG global config: uuid: f9d49424-8e78-4956-af8e-da8e5ec84314
6:48AM DBG global config: enableTelemetry: true
6:48AM DBG global config: showUpdateNotification: true
6:48AM DBG global config: cliEnvironment: default
6:48AM DBG execution id: 22468bbb-1fdb-491c-8a46-a13820ab248f
6:48AM DBG Supergraph config not supplied by flag. Attempting to find a SubgraphConfig config...
6:48AM INF Using Subgraph "app/subgraph.yaml" found in context.
6:48AM DBG Using Subgraph config "/home/azureuser/hasura/mysql_ddn/app/subgraph.yaml"
6:48AM INF Using localEnvFile ".env" found in context.
6:48AM DBG No plugin specified for connector hasura/mysql:v0.1.0
Error writing configuration to file: /app/output/configuration.json (Permission denied)
Parent directory: /app/output
Readable: true, Writable: false
Permissions: rwxr-xr-x
6:48AM DBG telemetry: beamed
6:48AM ERR introspect failed with error: exit status 1

the default permission for connector folder is : drwxr-xr-x

as a workaround I had to add write permission to others by updating the folder permission to drwxr-xrwx

Then the MySQL database is successfully introspected

but the configuration.json file generated has root user as owner:
-rw-r--r-- 1 185 root 1115974 Sep 25 07:00 configuration.json

@GavinRay97
Copy link
Member

The root of the issue here is that the CLI runs inside of Docker
Because of that, I think it adopts the Docker usergroup

I'm uncertain if there's a way to interact with the filesystem from inside of Docker as though you were another user.
(IE, can I ask for writes to be done as $user, or root?)

@GavinRay97 GavinRay97 changed the title Error in Introspecting MySQL database [FR] Improve UX of CLI introspection failures due to filesystem permissions Nov 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

2 participants