OpenC3 / cosmos-project

OpenC3 COSMOS Project Configuration Structure
https://openc3.com
Other
13 stars 7 forks source link

Permissions Issue Inside cosmos-init Container with Local Mode Enabled #3

Closed dmw4 closed 1 year ago

dmw4 commented 1 year ago

When running with local mode enabled, the targets_modified directory can't be created in plugins inside the cosmos-init container. The error I'm seeing is:

Updating local plugin files: /plugins/DEFAULT/openc3-cosmos-demo
Error installing plugin: DEFAULT: /openc3/plugins/gems/openc3-cosmos-demo-5.1.1.gem: EACCES : Permission denied @ dir_s_mkdir - /plugins/DEFAULT/openc3-cosmos-demo
/usr/lib/ruby/3.1.0/fileutils.rb:243:in mkdir'
/usr/lib/ruby/3.1.0/fileutils.rb:243:infu_mkdir'
/usr/lib/ruby/3.1.0/fileutils.rb:221:in block (2 levels) in mkdir_p'
/usr/lib/ruby/3.1.0/fileutils.rb:219:inreverse_each'
/usr/lib/ruby/3.1.0/fileutils.rb:219:in block in mkdir_p'
/usr/lib/ruby/3.1.0/fileutils.rb:211:ineach'
/usr/lib/ruby/3.1.0/fileutils.rb:211:in mkdir_p'
/usr/lib/ruby/gems/3.1.0/gems/openc3-5.1.1/lib/openc3/utilities/local_mode.rb:275:inupdate_local_plugin_files'
/usr/lib/ruby/gems/3.1.0/gems/openc3-5.1.1/lib/openc3/utilities/local_mode.rb:266:in update_local_plugin'                                                                                                       
/openc3/bin/openc3cli:436:inload_plugin'
/openc3/bin/openc3cli:497:in `<main>'

The plugins directory on my host machine has permissions drwxrwxr-x and there's also a line in openc3.sh that sets permssions on the host to 775. However, when I take a look inside the container I'm finding the plugins directory has permissions 755 instead, and I suspect that is the source of my issue, but I'm not sure of the cause.

Note: the demo comes up fine without local mode enabled.

Here's my .env:

ALPINE_VERSION=3.16
ALPINE_BUILD=2
APK_URL=https://dl-cdn.alpinelinux.org
RUBYGEMS_URL=https://rubygems.org
NPM_URL=https://registry.npmjs.org
SECRET_KEY_BASE=bdb4300d46c9d4f116ce3dbbd54cac6b20802d8be1c2333cf5f6f90b1627799ac5d043e8460744077bc0bd6aacdd5c4bf53f499a68303c6752e7f327b874b96a
OPENC3_LOGS_BUCKET=logs
OPENC3_TOOLS_BUCKET=tools
OPENC3_CONFIG_BUCKET=config
OPENC3_REDIS_HOSTNAME=openc3-redis
OPENC3_REDIS_PORT=6379
OPENC3_REDIS_EPHEMERAL_HOSTNAME=openc3-redis-ephemeral
OPENC3_REDIS_EPHEMERAL_PORT=6380
OPENC3_REDIS_USERNAME=openc3
OPENC3_REDIS_PASSWORD=openc3password
OPENC3_BUCKET_USERNAME=openc3minio
OPENC3_BUCKET_PASSWORD=openc3miniopassword
OPENC3_SERVICE_PASSWORD=openc3service
OPENC3_SR_REDIS_USERNAME=scriptrunner
OPENC3_SR_REDIS_PASSWORD=scriptrunnerpassword
OPENC3_SR_BUCKET_USERNAME=scriptrunnerminio
OPENC3_SR_BUCKET_PASSWORD=scriptrunnerminiopassword
OPENC3_ENTERPRISE_REGISTRY=ghcr.io
OPENC3_ENTERPRISE_NAMESPACE=openc3
OPENC3_DEPENDENCY_REGISTRY=docker.io
OPENC3_REGISTRY=docker.io
OPENC3_NAMESPACE=openc3inc
OPENC3_TAG=5.1.1
OPENC3_LOCAL_MODE=1
OPENC3_LOCAL_MODE_GROUP_ID=1000
OPENC3_DEMO=1
OPENC3_CLOUD=local

I'm running on Rocky 8.6

jmthomas commented 1 year ago

Should be addressed in 5.4.2