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

Permissions error when editing the ARM Settings after fresh install #111

Closed
2 tasks done
shitwolfymakes opened this issue Feb 9, 2022 · 1 comment
Closed
2 tasks done
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@shitwolfymakes
Copy link
Collaborator

shitwolfymakes commented Feb 9, 2022

  • I have checked the wiki
  • I have searched for similar issues

Describe the bug
In the course of testing my updated Ubuntu scripts (#108), I discovered an oversight in the script, and in the wiki install guides caused by this command:

sudo cp docs/arm.yaml.sample arm.yaml

Earlier in the installation, arm.sample.yaml is correctly set to arm as it's owner. However, the sudo command in this line invokes the cp docs/arm.yaml.sample arm.yaml command as root, resulting in arm.yaml having root for an owner, leaving it inaccessible to the armui process, which runs under arm as the owner.

This results in the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2091, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2076, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/dist-packages/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/opt/arm/arm/ui/routes.py", line 340, in settings
    with open(arm_cfg_file, "w") as f:
PermissionError: [Errno 13] Permission denied: '/opt/arm/arm/ui/../../arm.yaml'

This command is the source of the permissions error so many users experience after the initial installation, when they try to change the settings

I'm already working on the Ubuntu scripts, so the fix for this will be included in the larger PR for merging. The other OS install scripts and wiki install guides will need to be updated separately with the remediation below.

I'm also going to make a separate PR in the upstream repo so they have a fix for this as well.

Environment

Any environment where the setup involves the command sudo cp docs/arm.yaml.sample arm.yaml is subject to this issue.

Remediation

In every install script and wiki article where this appears

sudo cp docs/arm.yaml.sample arm.yaml

replace it with this

sudo cp docs/arm.yaml.sample arm.yaml
sudo chown arm:arm arm.yaml
@shitwolfymakes shitwolfymakes added the bug Something isn't working label Feb 9, 2022
@1337-server 1337-server added the documentation Improvements or additions to documentation label Mar 2, 2022
@1337-server
Copy link
Owner

Wiki updated, and PR was merged. This can now safely be closed, I think. If not, let me know and ill reopen.

1337-server added a commit that referenced this issue Mar 19, 2022
* refactored into functions

* added handling harness for script options

* added logic to run proper installation function

* Fixed errors

* added pycharm-community install

* implemented install_arm_dev_env

* implemented launch_setup

* added call for launch_setup

* minor change for clarity

* hard-coding path since the user folder is already created

* refactored to run in correct dirs

* fixed command to run under arm user

* fix command to properly run without hanging script

* moved dev environment installation location

* grab the ip of the site that's now running

* fixed errors and added logic

* Fixed permissions issue

* removed deprecated file

* pycharm runs as "other", so the 777 is needed

* rollback broken queries merged by #112

* added ALSA install to script to avoid breakage on Ubuntu Server instances

* Added handling for arm group/user already existing

* Added installs for lsscsi and net-tools

* Added coloration to logging statements

* Added Markdown v3.3.4 explicitly to requirements.txt, to fix breaking change caused by 3.3.5 (see Python-Markdown/markdown#1203)

* Putting alsa install first to hopefully fix continuing error calling aplay in scripts

* fixed out of order parameters

* fixed bad parameter

* updated the clone command for testing updated requirements

* moved checkout command a better spot

* fixed typo

* fixed typo

* Ubuntu loud script fix for 1337-server/automatic-ripping-machine issue #111

* Ubuntu quiet script fix for 1337-server/automatic-ripping-machine issue #111

* added logic to prevent duplicating fstab entries

* Moved heredocs to custom files

* fixed typos

* fix for broken service start

* refactored into functions

* added handling harness for script options

* added logic to run proper installation function

* Fixed errors

* added pycharm-community install

* implemented install_arm_dev_env

* implemented launch_setup

* added call for launch_setup

* minor change for clarity

* hard-coding path since the user folder is already created

* refactored to run in correct dirs

* fixed command to run under arm user

* fix command to properly run without hanging script

* moved dev environment installation location

* grab the ip of the site that's now running

* fixed errors and added logic

* Fixed permissions issue

* removed deprecated file

* pycharm runs as "other", so the 777 is needed

* added ALSA install to script to avoid breakage on Ubuntu Server instances

* Added handling for arm group/user already existing

* Added installs for lsscsi and net-tools

* Added coloration to logging statements

* Added Markdown v3.3.4 explicitly to requirements.txt, to fix breaking change caused by 3.3.5 (see Python-Markdown/markdown#1203)

* Putting alsa install first to hopefully fix continuing error calling aplay in scripts

* fixed out of order parameters

* fixed bad parameter

* updated the clone command for testing updated requirements

* moved checkout command a better spot

* fixed typo

* fixed typo

* Ubuntu loud script fix for 1337-server/automatic-ripping-machine issue #111

* Ubuntu quiet script fix for 1337-server/automatic-ripping-machine issue #111

* added logic to prevent duplicating fstab entries

* Moved heredocs to custom files

* fixed typos

* fix for broken service start

* refactored into functions

* added handling harness for script options

* added logic to run proper installation function

* Fixed errors

* added pycharm-community install

* implemented install_arm_dev_env

* implemented launch_setup

* added call for launch_setup

* minor change for clarity

* hard-coding path since the user folder is already created

* refactored to run in correct dirs

* fixed command to run under arm user

* fix command to properly run without hanging script

* moved dev environment installation location

* grab the ip of the site that's now running

* fixed errors and added logic

* Fixed permissions issue

* removed deprecated file

* pycharm runs as "other", so the 777 is needed

* added ALSA install to script to avoid breakage on Ubuntu Server instances

* Added handling for arm group/user already existing

* Added installs for lsscsi and net-tools

* Added coloration to logging statements

* Added Markdown v3.3.4 explicitly to requirements.txt, to fix breaking change caused by 3.3.5 (see Python-Markdown/markdown#1203)

* Putting alsa install first to hopefully fix continuing error calling aplay in scripts

* fixed out of order parameters

* fixed bad parameter

* updated the clone command for testing updated requirements

* moved checkout command a better spot

* fixed typo

* fixed typo

* Ubuntu loud script fix for 1337-server/automatic-ripping-machine issue #111

* Ubuntu quiet script fix for 1337-server/automatic-ripping-machine issue #111

* added logic to prevent duplicating fstab entries

* Moved heredocs to custom files

* fixed typos

* fix for broken service start

* refactored into functions

* added handling harness for script options

* added logic to run proper installation function

* Fixed errors

* added pycharm-community install

* implemented install_arm_dev_env

* implemented launch_setup

* added call for launch_setup

* minor change for clarity

* hard-coding path since the user folder is already created

* refactored to run in correct dirs

* fixed command to run under arm user

* fix command to properly run without hanging script

* moved dev environment installation location

* grab the ip of the site that's now running

* fixed errors and added logic

* Fixed permissions issue

* removed deprecated file

* pycharm runs as "other", so the 777 is needed

* Added handling for arm group/user already existing

* Added installs for lsscsi and net-tools

* Added coloration to logging statements

* Putting alsa install first to hopefully fix continuing error calling aplay in scripts

* fixed out of order parameters

* fixed bad parameter

* updated the clone command for testing updated requirements

* moved checkout command a better spot

* fixed typo

* Ubuntu loud script fix for 1337-server/automatic-ripping-machine issue #111

* added logic to prevent duplicating fstab entries

* Moved heredocs to custom files

* fixed typos

* refactored into functions

* added handling harness for script options

* added logic to run proper installation function

* Fixed errors

* added pycharm-community install

* implemented install_arm_dev_env

* implemented launch_setup

* added call for launch_setup

* minor change for clarity

* hard-coding path since the user folder is already created

* refactored to run in correct dirs

* fixed command to run under arm user

* fix command to properly run without hanging script

* moved dev environment installation location

* grab the ip of the site that's now running

* fixed errors and added logic

* Fixed permissions issue

* pycharm runs as "other", so the 777 is needed

* added ALSA install to script to avoid breakage on Ubuntu Server instances

* Added handling for arm group/user already existing

* Added installs for lsscsi and net-tools

* Added coloration to logging statements

* Putting alsa install first to hopefully fix continuing error calling aplay in scripts

* fixed out of order parameters

* fixed bad parameter

* updated the clone command for testing updated requirements

* moved checkout command a better spot

* fixed typo

* Ubuntu loud script fix for 1337-server/automatic-ripping-machine issue #111

* added logic to prevent duplicating fstab entries

* Moved heredocs to custom files

* fixed typos

* refactored into functions

* added handling harness for script options

* added logic to run proper installation function

* Fixed errors

* added pycharm-community install

* implemented install_arm_dev_env

* implemented launch_setup

* added call for launch_setup

* minor change for clarity

* hard-coding path since the user folder is already created

* refactored to run in correct dirs

* fixed command to run under arm user

* fix command to properly run without hanging script

* moved dev environment installation location

* grab the ip of the site that's now running

* fixed errors and added logic

* Fixed permissions issue

* pycharm runs as "other", so the 777 is needed

* reverted changes

* removed deprecated checkout

* fixed typo

* delete old symlinks broken by the reinstallation process

* fixed typo

* auto-accept bc these repos are core to the install

* remove deprecated checkout command

* fixed broken evaluations

* fixed not finding the existing armui.service due to the space being where a / should be

* stop and remove and existing ARM install to avoid FileNotFound errors caused by the service being deleted after the source code it runs is deleted during script runtime

* refactored repeated logic into function run_makemkv(cmd)

* added update_key.sh

* installer now sets permissions for the new update_keys.sh

* fixed permissions set on the service file during install

* updated install scripts to set proper permissions for update_key.sh

* Overhaul of makemkv.py, everything needed to be done at the same time (I know, I know...)

* added noqa tags for variables that aren't being used

* Nicer printing of the logging statement

* Make sure each title is transcoded in order

* updated LICENSE

* Removed getkeys.py

* Updated VERSION

* Revert "Removed getkeys.py"

This reverts commit 2e73b5d.

* Fix bug in file sorting

* Update deb-install-quiet.sh

* Update debian-setup.sh

* Create docker-publish.yml

* Update docker-publish.yml

* Update README.md

* Push to dockerhub

* Delete build-push-action.yml

* Delete docker-publish.yml

* Create docker-publish.yml

* more github action tests

* Update docker-publish.yml

* Update docker-publish.yml

* Fixes #128 - doc strings showed wrong types leading to confusion

Index page will now correctly update the card header with correct details

* cleaning some js code to reduce warnings/errors

* cleaning some js code to reduce warnings/errors

* Removing unused variables from makemkv
Adding the progress from makemkv to logging
Cleaning some js code to reduce warnings/errors (tested FF&Chrome)

* Removing commented unused code
Small refactoring to be more compliant

* fix variable name

* flake8

* Fixes #129

* Revert "Merge branch 'v2_master' into v2_devel"

This reverts commit 58cb03a, reversing
changes made to 4b0793d.

Co-authored-by: wolfy <wolfy@shitwolfymakes.com>
Co-authored-by: wolfy <wolfy@shitwolfymakes>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants