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

[BUG] Smartctl open device: /dev/bus/0 [megaraid_disk_47] failed: cannot open #677

Open
trazoss opened this issue Aug 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@trazoss
Copy link

trazoss commented Aug 28, 2024

Describe the bug
Smartctl when run inside the container cannot open device. When run on host machine works fine.

Inside collector container -

root@47c94cfe70f4:/opt/scrutiny# smartctl --info --json --device megaraid,47 /dev/bus/0
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      3
    ],
    "svn_revision": "5338",
    "platform_info": "x86_64-linux-6.5.0-44-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--info",
      "--json",
      "--device",
      "megaraid,47",
      "/dev/bus/0"
    ],
    "messages": [
      {
        "string": "Smartctl open device: /dev/bus/0 [megaraid_disk_47] failed: cannot open /dev/megaraid_sas_ioctl_node or /dev/megadev0",
        "severity": "error"
      }
    ],
    "exit_status": 2
  },
  "local_time": {
    "time_t": 1724888672,
    "asctime": "Wed Aug 28 23:44:32 2024 UTC"
  }
}

On host -

root@Jellyfin:~# smartctl --info --json --device megaraid,47 /dev/bus/0
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      2
    ],
    "svn_revision": "5155",
    "platform_info": "x86_64-linux-6.5.0-44-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--info",
      "--json",
      "--device",
      "megaraid,47",
      "/dev/bus/0"
    ],
    "exit_status": 0
  },
  "device": {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_47] [SAT]",
    "type": "sat+megaraid,47",
    "protocol": "ATA"
  },
  "model_name": "ST20000NE000-3G5101",
  "serial_number": "ZVT8DJEG",
  "wwn": {
    "naa": 5,
    "oui": 3152,
    "id": 3865314787
  },
  "firmware_version": "EN01",
  "user_capacity": {
    "blocks": 39063650304,
    "bytes": 20000588955648
  },
  "logical_block_size": 512,
  "physical_block_size": 4096,
  "rotation_rate": 7200,
  "form_factor": {
    "ata_value": 2,
    "name": "3.5 inches"
  },
  "trim": {
    "supported": false
  },
  "in_smartctl_database": false,
  "ata_version": {
    "string": "ACS-4 (minor revision not indicated)",
    "major_value": 4064,
    "minor_value": 65535
  },
  "sata_version": {
    "string": "SATA 3.3",
    "value": 511
  },
  "interface_speed": {
    "max": {
      "sata_value": 14,
      "string": "6.0 Gb/s",
      "units_per_second": 60,
      "bits_per_unit": 100000000
    },
    "current": {
      "sata_value": 3,
      "string": "6.0 Gb/s",
      "units_per_second": 60,
      "bits_per_unit": 100000000
    }
  },
  "local_time": {
    "time_t": 1724888362,
    "asctime": "Thu Aug 29 09:39:22 2024 AEST"
  }
}

compose.yml -

version: '2.4'

services:
  influxdb:
    image: influxdb:2.2
    ports:
      - '8086:8086'
    volumes:
      - './influxdb:/var/lib/influxdb2'
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8086/health"]
      interval: 5s
      timeout: 10s
      retries: 20


  web:
    image: 'ghcr.io/analogj/scrutiny:master-web'
    ports:
      - '8081:8080'
    volumes:
      - './config:/opt/scrutiny/config'
    environment:
      SCRUTINY_WEB_INFLUXDB_HOST: 'influxdb'
    depends_on:
      influxdb:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
      interval: 5s
      timeout: 10s
      retries: 20
      start_period: 10s

  collector:
    image: 'ghcr.io/analogj/scrutiny:master-collector'
    cap_add:
      - SYS_RAWIO
      - SYS_ADMIN
    volumes:
      - '/run/udev:/run/udev:ro'
      - './config/collector.yaml:/opt/scrutiny/config/collector.yaml'
    environment:
      COLLECTOR_API_ENDPOINT: 'http://web:8080'
      COLLECTOR_HOST_ID: 'scrutiny-collector-hostname'
    depends_on:
      web:
        condition: service_healthy    

collector.yaml -

devices:
      - device: /dev/bus/0
        type:
          - megaraid,32
          - megaraid,33
          - megaraid,34
          - megaraid,39
          - megaraid,40
          - megaraid,41
          - megaraid,42
          - megaraid,44
          - megaraid,45
          - megaraid,46
          - megaraid,47
          - megaraid,48
          - megaraid,49
          - megaraid,50
          
      - device: /dev/sda
      - device: /dev/sdb
      - device: /dev/sdc

docker info -

root@Jellyfin:~# docker info
Client:
 Version:    24.0.5
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  v2.3.3
    Path:     /root/.docker/cli-plugins/docker-compose

Server:
 Containers: 10
  Running: 7
  Paused: 0
  Stopped: 3
 Images: 15
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version:
 runc version:
 init version:
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.0-44-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 62.09GiB
 Name: Jellyfin
 ID: ca776471-c918-4515-9a6a-11aedfb559aa
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
@trazoss trazoss added the bug Something isn't working label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant