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

Cannot read from socket #196

Open
cristotodev opened this issue Jul 19, 2023 · 1 comment
Open

Cannot read from socket #196

cristotodev opened this issue Jul 19, 2023 · 1 comment

Comments

@cristotodev
Copy link

I'm trying deploy the exporter via Docker but I have the following error:
image

This is my docker-compose with differents exporters with prometheus and grafana and the other ones are working fine except speedtest:

version: "3"
services:
  grafana:
    container_name: monitoring-grafana
    image: grafana/grafana:latest
    hostname: rpi-grafana
    restart: unless-stopped
    user: "472"
    networks:
      - internal
    ports:
      - "3000:3000"
    env_file:
      - ./grafana/.env
    volumes:
      # /!\ To be modified depending on your needs /!\
      - ./grafana/data:/var/lib/grafana
      - ./grafana/provisioning:/etc/grafana/provisioning
    depends_on:
      - prometheus

  cadvisor:
    container_name: monitoring-cadvisor
    image: gcr.io/cadvisor/cadvisor:v0.47.0
    hostname: rpi-cadvisor
    restart: unless-stopped
    privileged: true
    networks:
      - internal
    expose:
      - 8080
    devices:
      - /dev/kmsg
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
      - /dev/disk/:/dev/disk:ro
      - /etc/machine-id:/etc/machine-id:ro

  node-exporter:
    container_name: monitoring-node-exporter
    image: prom/node-exporter:latest
    hostname: rpi-exporter
    restart: unless-stopped
    networks:
      - internal
    expose:
      - 9100
    command:
      - --path.procfs=/host/proc
      - --path.sysfs=/host/sys
      - --path.rootfs=/host
      - --collector.filesystem.ignored-mount-points
      - ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
      - /:/host:ro,rslave

  prometheus:
    container_name: monitoring-prometheus
    image: prom/prometheus:latest
    hostname: rpi-prometheus
    restart: unless-stopped
    user: "nobody"
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
    networks:
      - internal
    expose:
      - 9090
    ports:
      - "9090:9090"
    volumes:
      # /!\ To be modified depending on your needs /!\
      - ./prometheus/data:/prometheus
      - ./prometheus:/etc/prometheus/
    depends_on:
      - cadvisor
      - node-exporter
      - speedtest-exporter
    links:
      - cadvisor:cadvisor
      - node-exporter:node-exporter
      - speedtest-exporter:speedtest-exporter

  speedtest-exporter:
    image: miguelndecarvalho/speedtest-exporter
    container_name: speedtest-exporter
    environment:
      - SPEEDTEST_PORT:9798
      - SPEEDTEST_SERVER:14543
    hostname: rpi-speedtest
    networks:
      - internal
    expose:
      - 9798
    ports:
      - 9798:9798
    restart: unless-stopped

networks:
  internal:
    driver: bridge
@itsmejoeeey
Copy link

itsmejoeeey commented Apr 4, 2024

I had a similar issue when using billimek/prometheus-speedtest-exporter the other day, I've opened an issue there.:

[2024-04-03 12:06:27.330] [warning] Receive error: 11 (Resource temporarily unavailable)
[2024-04-03 12:06:27.331] [warning] Receive error: 11 (Resource temporarily unavailable)
[2024-04-03 12:06:27.332] [warning] Loaded latency: Hello handshake failed with the server: [0] Cannot read from socket:
[2024-04-03 12:06:27.332] [info] Connection 3 failed. Added connection and continuing test.
[2024-04-03 12:06:27.334] [info] Connection 4 failed. Added connection and continuing test.
[2024-04-03 12:06:27.335] [error] Test failed to complete: Cannot read from socket:

I've tested with network_mode: host and this seems to solve the issue, although some non-fatal warnings about Cannot read from uninitialized socket can still be seen in the runs.

It seems like an issue with ookla-speedtest being run inside a docker container with bridge networking, but I am still failing to understand why this might be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants