SensorsIot / IOTstack

Docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.44k stars 304 forks source link

Cannot pull mosquitto #602

Closed dmenne closed 1 year ago

dmenne commented 1 year ago

When I run the generated yml, I get the following error message:

 => ERROR [iotstack-mosquitto 3/7] RUN apk update && apk add --no-cache rsync tzdata                                     22.5s
------
 > [iotstack-mosquitto 3/7] RUN apk update && apk add --no-cache rsync tzdata:
#0 5.415 fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz
#0 10.42 ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.16/main: temporary error (try again later)
#0 10.42 WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.16/main: No such file or directory
#0 10.42 fetch http://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz
#0 15.43 ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.16/community: temporary error (try again later)
#0 15.43 WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.16/community: No such file or directory
#0 15.43 2 errors; 20 distinct packages available
------
failed to solve: executor failed running [/bin/sh -c apk update && apk add --no-cache rsync tzdata]: exit code: 2

An explicit install works:

docker pull eclipse-mosquitto:latest # ok

A download of the requested file in the browsers also works:

http://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz

The error also occurs in a simplified compose.yaml with only

docker compose -f compose.yaml build

version: '3.6'

services:
  mosquitto:
    container_name: mosquitto
    build:
      context: ./.templates/mosquitto/.
      args:
      - MOSQUITTO_BASE=eclipse-mosquitto:latest
    restart: unless-stopped
    environment:
    - TZ=Etc/UTC
    ports:
    - "1883:1883"
    volumes:
    - ./volumes/mosquitto/config:/mosquitto/config
    - ./volumes/mosquitto/data:/mosquitto/data
    - ./volumes/mosquitto/log:/mosquitto/log
    - ./volumes/mosquitto/pwfile:/mosquitto/pwfile
Paraphraser commented 1 year ago

My guess is you are running Buster without the libseccomp2 patch. For some background see:

Assuming this diagnosis is correct, applying the patch should fix it.

dmenne commented 1 year ago

This is bullseye. Against the recommendation not to use it, I will think along these lines. I have already installed IOStack successfully some dozens of times with this image before. So it's probably caused by some recent update patch.

Linux raspberry 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
Paraphraser commented 1 year ago

OK. Let me try a Mosquitto rebuild.

Paraphraser commented 1 year ago

Test system where stack was not running (I've been using it for something else). Brought up the existing stack. Rebuilt Mosquitto. New image built and came up OK.

F37FFA19-4630-4C1B-9A60-3E9A2FD81EAE

CAB2658A-777E-44BB-A011-647CAA0AAD94

Paraphraser commented 1 year ago

Not that it will likely make a difference but the REBUILD alias expands to:

docker-compose build --no-cache --pull mosquitto
Paraphraser commented 1 year ago

The other thing that has sometimes caused build failures is DNS problems. Perhaps try some curls from that system to the URLs mentioned in the original output.

I know that might seem the same as doing it in a browser but I want to be sure it's the same system doing the download.

Paraphraser commented 1 year ago

See this, then a few posts later with tips on changing the DNS options.

dmenne commented 1 year ago

Good point, I had installed Pi-Hole, and also had already tested it by switching it off, no change. Direct curl fails with 301, and dozens of flushdns' did not help up to now. Same with your suggestions resolvconf or daemon.json.

But curl works on another computer in the network, so I will have to check again with this focus.

Good night to down-under (I presume)

dmenne commented 1 year ago

Works now "suddenly", but sorry I cannot tell the world which of the many action I took really help - possibly some mystical cache expiry. I also cannot rule out that it has to do with http/https redirection, as intermediately curl worked with https and failed with http.

I also used https://www.schuetzler.net/blog/disable-pihole-for-some-devices/, but reverting it did not give a failure.