hasura / ndc-jvm-mono

0 stars 2 forks source link

Error in Introspecting MySQL database #11

Open nihxdr opened 1 month ago

nihxdr commented 1 month ago

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 commented 1 month ago

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?)