Draggon / hassio-hdd-tools

27 stars 14 forks source link

Permission denied problem #27

Closed carsten-h closed 2 years ago

carsten-h commented 3 years ago

Hello!

I found this messages when starting the Addon:

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[Tue Mar 30 21:38:24 CEST 2021][INFO] HDD Tools start
[Tue Mar 30 21:38:24 CEST 2021][INFO] Configuration - performance check enabled: false
[Tue Mar 30 21:38:24 CEST 2021][INFO] Configuration - disk path: /dev/sda
[Tue Mar 30 21:38:24 CEST 2021][INFO] Configuration - check period: 5
[Tue Mar 30 21:38:24 CEST 2021][INFO] Configuration - database update: true
[Tue Mar 30 21:38:24 CEST 2021][INFO] Configuration - database update period: 168
[Tue Mar 30 21:38:25 CEST 2021][INFO] Configuration - output file: temp.log
[Tue Mar 30 21:38:25 CEST 2021][INFO] Configuration - attributes property: ata_smart_attributes.table
[Tue Mar 30 21:38:25 CEST 2021][INFO] Init run
[Tue Mar 30 21:38:26 CEST 2021][INFO] Sensor value: 43°
[Tue Mar 30 21:38:26 CEST 2021][INFO] Sensor update response code: 200
[Tue Mar 30 21:38:26 CEST 2021][INFO] Cron tab SMART update
[Tue Mar 30 21:38:26 CEST 2021][INFO] Cron tab database update ENABLED
/run.sh: line 49: /share/hdd_tools/scripts/database.sh: Permission denied
[cmd] /run.sh exited 126
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

and this can be found in supervisor log:

21-03-30 19:37:44 INFO (SyncWorker_7) [supervisor.docker.interface] Cleaning addon_dac3d81b_hdd_tools application
21-03-30 19:37:45 INFO (SyncWorker_7) [supervisor.docker.addon] Starting Docker add-on dac3d81b/aarch64-addon-hdd_tools with version 0.50.0
21-03-30 19:38:15 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with dac3d81b_hdd_tools!
21-03-30 19:38:15 INFO (SyncWorker_0) [supervisor.docker.interface] Cleaning addon_dac3d81b_hdd_tools application
21-03-30 19:38:16 INFO (SyncWorker_0) [supervisor.docker.addon] Starting Docker add-on dac3d81b/aarch64-addon-hdd_tools with version 0.50.0
21-03-30 19:38:22 INFO (SyncWorker_1) [supervisor.docker.interface] Cleaning addon_dac3d81b_hdd_tools application
21-03-30 19:38:23 INFO (SyncWorker_4) [supervisor.docker.addon] Starting Docker add-on dac3d81b/aarch64-addon-hdd_tools with version 0.50.0
McGiverGim commented 3 years ago

I've found a bug in the dockerfile, I don't know why it works for me and others. I will release a patch version today. Until then, disable the "update database" check in the configuration.

McGiverGim commented 3 years ago

I think is fixed in version 0.50.1. Can you test it?

carsten-h commented 3 years ago

Yes, I will do. In the moment I can't see this version in Home Assistant.

McGiverGim commented 3 years ago

@carsten-h go to the add-on store, three points in the up rigth corner, and press reload.

carsten-h commented 3 years ago

Yes, this worked. But I still get the same error message when selecting to update the database. I am using a HassOS installation on a Pi 4B.

McGiverGim commented 3 years ago

I've reproduced it... delete the contents of the /share/hdd_tools/script folder (using samba or ssh) and press rebuild on the addon page. It will fill this folder again with the right permissions. I will let this issue open by now, others can have the same error. The problem is a copy instruction, it does not copy the "new permissions" of the file and remains with the old one. I'm not too sure why this addon uses this scripts and not the ones that are inside the docker, maybe to make it easier to test new changes.

carsten-h commented 3 years ago

Yes, when deleting the contents and rebuild, everything is working fine! Thank you!

McGiverGim commented 3 years ago

Seeing the code again, a simple restart will be enough after deleting the files (not rebuild needed) :)

What I don't understand is why I was executing it without problem, because my permissions where wrong too. Every people who installed the version 0.50.0 has the permissions bad.

I can do a fix (maybe a simple -p when copying the file), but I will wait a little to see if more people affected appears here.

carsten-h commented 3 years ago

Ok, I will wait and can test if there is a new version.

McGiverGim commented 3 years ago

I've pushed the fix, but I will wait to see if more people is affected by this. If more people appear, I will generate a new version. If not, I will postpone it for later.

Jefe2 commented 3 years ago

Same error here on my RPi4 4GB. So I deleted the contents of the /share/hdd_tools/script folder, restarted, and now everything is working fine. Thanks!