fightforlife / docker_hddfancontrol

simple Docker image for hddfancontrol by desbma
8 stars 0 forks source link

Help with Deployment #10

Open The-Inamati opened 9 months ago

The-Inamati commented 9 months ago

Hello,

I am trying to deploy this in TrueNAS Scale but it's been quite a journey and I still didn't get it to work so I'm now begging for your help.

On my system when I run sensors this is part of what I get

sensors

When I run the container I get the following error:

fans

The variables I am using in the container are shown in the image. I changed from hwmon6 to hwmon5 because for some reason on the container it starts with hwmon0 and on the system itself it starts with hwmon1.

I'm not sure if I am doing this right or not. I checked the BIOS and the fan is exposed as PWM. It was Auto but I changed it to PWM.

Can you help me please?

fightforlife commented 9 months ago

Hi The-Inamati,

the error you are getting looks like a permission problem to the used hwmon path. Read-only file system: /..../hwmon5/pwm1_enable

Either your are missing these in your compose config:

    volumes:
      - /lib/modules:/lib/modules:ro
    privileged: true
    cap_add:
      - SYS_MODULE

Or your bios is somehow blocking manual control of the pwm fans.

Sunoo commented 7 months ago

I get the same error now, it worked on TrueNAS Scale until I believe the 23.10 update. I'm not sure if it's Docker or TrueNAS, but I'm guessing one of them is now blocking all write access to /sys from Docker images?

I did some testing over just SSH and it seems, as root, I can update the values under /sys that hddfancontrol is trying to touch. So I'm left to assume this is likely some Docker setting now?

If it makes a difference, here is my log, though it looks much the same as the one The-Inamati posted:


2024-03-13 00:31:40.999027-04:00INFO [Main] Process real time scheduler set to 2, priority 49
2024-03-13 00:31:41.009438-04:00INFO [sda ST12000VN0008-2PH103] Drive does not support native drivetemp temp query
2024-03-13 00:31:41.043061-04:00INFO [sda ST12000VN0008-2PH103] Will probe temperature with method SMARTCTL_SCT_INVOCATION
2024-03-13 00:31:41.053264-04:00INFO [sdb ST12000VN0008-2PH103] Drive does not support native drivetemp temp query
2024-03-13 00:31:41.082665-04:00INFO [sdb ST12000VN0008-2PH103] Will probe temperature with method SMARTCTL_SCT_INVOCATION
2024-03-13 00:31:41.085183-04:00INFO [sdc ST12000VN0008-2PH103] Drive does not support native drivetemp temp query
2024-03-13 00:31:41.117306-04:00INFO [sdc ST12000VN0008-2PH103] Will probe temperature with method SMARTCTL_SCT_INVOCATION
2024-03-13 00:31:41.119608-04:00INFO [sdd ST12000VN0008-2PH103] Drive does not support native drivetemp temp query
2024-03-13 00:31:41.152173-04:00INFO [sdd ST12000VN0008-2PH103] Will probe temperature with method SMARTCTL_SCT_INVOCATION
2024-03-13 00:31:41.157548-04:00INFO [sde ST12000VN0008-2PH103] Drive does not support native drivetemp temp query
2024-03-13 00:31:41.186497-04:00INFO [sde ST12000VN0008-2PH103] Will probe temperature with method SMARTCTL_SCT_INVOCATION
2024-03-13 00:31:41.344636-04:00INFO [Main] Maximum device temperature: 48 °C
2024-03-13 00:31:41.344658-04:00INFO [Fan #1] Setting fan speed to 52%
2024-03-13 00:31:41.345376-04:00ERROR [Main] OSError: [Errno 30] Read-only file system: '/sys/class/hwmon/hwmon2/pwm1_enable'
2024-03-13 00:31:41.345412-04:00Traceback (most recent call last):
2024-03-13 00:31:41.345416-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 1130, in main
2024-03-13 00:31:41.345419-04:00fan.setSpeed(fan_speed_prct)
2024-03-13 00:31:41.345421-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 773, in setSpeed
2024-03-13 00:31:41.345426-04:00self.setPwmValue(target_value)
2024-03-13 00:31:41.345428-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 778, in setPwmValue
2024-03-13 00:31:41.345431-04:00self.setEnabledValue(1)
2024-03-13 00:31:41.345433-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 806, in setEnabledValue
2024-03-13 00:31:41.345437-04:00with open(self.enable_filepath, "r+t") as enable_file:
2024-03-13 00:31:41.345439-04:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13 00:31:41.345442-04:00OSError: [Errno 30] Read-only file system: '/sys/class/hwmon/hwmon2/pwm1_enable'
2024-03-13 00:31:41.345446-04:00INFO [Fan #1] Setting fan speed to 100%
2024-03-13 00:31:41.345448-04:00Traceback (most recent call last):
2024-03-13 00:31:41.345450-04:00File "/usr/local/bin/hddfancontrol", line 33, in <module>
2024-03-13 00:31:41.345470-04:00sys.exit(load_entry_point('hddfancontrol==1.6.0', 'console_scripts', 'hddfancontrol')())
2024-03-13 00:31:41.345490-04:00^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-03-13 00:31:41.345495-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 1386, in cl_main
2024-03-13 00:31:41.345564-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 1160, in main
2024-03-13 00:31:41.345577-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 773, in setSpeed
2024-03-13 00:31:41.345598-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 778, in setPwmValue
2024-03-13 00:31:41.345617-04:00File "/usr/local/lib/python3.12/site-packages/hddfancontrol-1.6.0-py3.12.egg/hddfancontrol/__init__.py", line 806, in setEnabledValue
2024-03-13 00:31:41.345640-04:00OSError: [Errno 30] Read-only file system: '/sys/class/hwmon/hwmon2/pwm1_enable'```
Sunoo commented 7 months ago

Okay, I don’t understand it, but we have a solution.

In the settings for the application in TrueNAS, under the Networking section, enable “Provide access to node network namespace for the workload”.

I have no idea why that works, but after toggling that setting, everything is working perfectly again. @The-Inamati you should try that as well.

The-Inamati commented 7 months ago

Hello, Thanks for the response but because of this and other weird time consuming issues I switched back to Proxmox and have had no issues since.