Skip to content

IOTstack new installation got FAILS #438

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

Closed
ambusv opened this issue Oct 28, 2021 · 2 comments · Fixed by #576
Closed

IOTstack new installation got FAILS #438

ambusv opened this issue Oct 28, 2021 · 2 comments · Fixed by #576

Comments

@ambusv
Copy link

ambusv commented Oct 28, 2021

Hi Support,

New IOTstack installation got failed, please see the docker compose files and error that I got

cat docker-compose.yml
version: '3.6'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
- "8089:80/tcp"
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
environment:
- WEBPASSWORD=IOtSt4ckP1Hol3
- INTERFACE=eth0
volumes:
- ./volumes/pihole/etc-pihole/:/etc/pihole/
- ./volumes/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/
dns:
- 127.0.0.1
- 1.1.1.1
cap_add:
- NET_ADMIN
restart: unless-stopped
networks:
- iotstack_nw
- vpn_nw

Recommended but not required (DHCP needs NET_ADMIN)

https://github.com/pi-hole/docker-pi-hole#note-on-capabilities

influxdb:
container_name: influxdb
image: "influxdb:1.8"
restart: unless-stopped
ports:
- "8086:8086"
environment:
- INFLUXDB_HTTP_FLUX_ENABLED=false
- INFLUXDB_REPORTING_DISABLED=false
- INFLUXDB_HTTP_AUTH_ENABLED=false
- INFLUX_USERNAME=dba
- INFLUX_PASSWORD=supremo
- INFLUXDB_UDP_ENABLED=false
- INFLUXDB_UDP_BIND_ADDRESS=0.0.0.0:8086
- INFLUXDB_UDP_DATABASE=udp
volumes:
- ./volumes/influxdb/data:/var/lib/influxdb
- ./backups/influxdb/db:/var/lib/influxdb/backup
networks:
- iotstack_nw

portainer-ce:
container_name: portainer-ce
image: portainer/portainer-ce
restart: unless-stopped
ports:
- "8000:8000"
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./volumes/portainer-ce/data:/data
grafana:
container_name: grafana
image: grafana/grafana
restart: unless-stopped
user: "0"
ports:
- "3000:3000"
environment:
- GF_PATHS_DATA=/var/lib/grafana
- GF_PATHS_LOGS=/var/log/grafana
volumes:
- ./volumes/grafana/data:/var/lib/grafana
- ./volumes/grafana/log:/var/log/grafana
networks:
- iotstack_nw

portainer_agent:
image: portainer/agent
container_name: portainer-agent
ports:
- "9001:9001"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
restart: unless-stopped
networks:
iotstack_nw: # Exposed by your host.
# external: true
name: IOTstack_Net
driver: bridge
ipam:
driver: default
config:
- subnet: 10.77.60.0/24
# - gateway: 10.77.60.1

iotstack_nw_internal: # For interservice communication. No access to outside
name: IOTstack_Net_Internal
driver: bridge
internal: true
ipam:
driver: default
config:
- subnet: 10.77.76.0/24
# - gateway: 10.77.76.1
vpn_nw: # Network specifically for VPN
name: IOTstack_VPN
driver: bridge
ipam:
driver: default
config:
- subnet: 10.77.88.0/24
# - gateway: 192.18.200.1

nextcloud_internal: # Network for NextCloud service
name: IOTstack_NextCloud
driver: bridge
internal: true

default:

external: true

name: iotstack_nw

hosts_nw:

driver: hosts

===========ERROR=======

sudo docker-compose up -d
WARNING: Some networks were defined but are not used by any service: nextcloud_internal, iotstack_nw_internal
Pulling portainer_agent (portainer/agent:)...
latest: Pulling from portainer/agent
7721cab3d696: Already exists
0645e7e2a110: Already exists
63c7dd053838: Pull complete
63ab7bb768d2: Pull complete
5de741d05b7e: Pull complete
Digest: sha256:4e57940784bc3981a17c2605652a9ea431eb97ca62d3f61fe80b89404b5ef43b
Status: Downloaded newer image for portainer/agent:latest
Starting pihole ... error
Starting portainer-ce ...
Starting grafana ...
Starting influxdb ...
Creating portainer-agent ...
Starting grafana ... error
ERROR: for pihole Cannot start service pihole: failed to create endpoint pihole on network IOTstack_VPN: failed to add the host (veth0b24063) <=> sandbox (vethcf7db68) pair interfaces: operation not supported

Starting influxdb ... error
Starting portainer-ce ... error

ERROR: for influxdb Cannot start service influxdb: failed to create endpoint influxdb on network IOTstack_Net: failed to add the host (veth5d07a42) <=> sandbox (veth858cce9) pair interfaces: operation not supported

ERROR: for portainer-ce Cannot start service portainer-ce: failed to create endpoint portainer-ce on network iotstack_default: failed to add the host (vethd3Creating portainer-agent ... error

ERROR: for portainer-agent Cannot start service portainer_agent: failed to create endpoint portainer-agent on network iotstack_default: failed to add the host (vetha60d8cc) <=> sandbox (veth58c248a) pair interfaces: operation not supported

ERROR: for pihole Cannot start service pihole: failed to create endpoint pihole on network IOTstack_VPN: failed to add the host (veth0b24063) <=> sandbox (vethcf7db68) pair interfaces: operation not supported

ERROR: for grafana Cannot start service grafana: failed to create endpoint grafana on network IOTstack_Net: failed to add the host (veth740db80) <=> sandbox (vetha3faa72) pair interfaces: operation not supported

ERROR: for influxdb Cannot start service influxdb: failed to create endpoint influxdb on network IOTstack_Net: failed to add the host (veth5d07a42) <=> sandbox (veth858cce9) pair interfaces: operation not supported

ERROR: for portainer-ce Cannot start service portainer-ce: failed to create endpoint portainer-ce on network iotstack_default: failed to add the host (vethd392ce9) <=> sandbox (veth2da6da0) pair interfaces: operation not supported

ERROR: for portainer_agent Cannot start service portainer_agent: failed to create endpoint portainer-agent on network iotstack_default: failed to add the host (vetha60d8cc) <=> sandbox (veth58c248a) pair interfaces: operation not supported
ERROR: Encountered errors while bringing up the project.

@Paraphraser
Copy link

I suspect this is the problem:

sudo docker-compose up -d

See a word about the sudo command.

If you try to run docker-compose up -d (without sudo) and you get an error which suggests that sudo is needed then it means something else is wrong, and the most likely candidate is that IOTstack wasn't installed properly.

Maybe see if anything in Installing Docker for IOTstack helps. At the very least, you can:

  1. uninstall docker and docker-compose, then
  2. Run the commands in scripting IOTstack installations.

Think back to when you might've used sudo. For example, if you used sudo when you did the git clone of IOTstack, you'll have a complete mess on your hands. Similarly, if you ran the menu as sudo ./menu.sh. What I would suggest is a strategy like this:

$ cd
$ sudo mv IOTstack IOTstack.off
$ git clone https://github.com/SensorsIot/IOTstack.git IOTstack
$ cp IOTstack.off/docker-compose.yml IOTstack/
$ mkdir -p IOTstack/services
$ cp IOTstack.off/services/docker-compose.save.yml IOTstack/services/

In words:

  1. Be in your home directory.
  2. Move your existing IOTstack out of the way. The sudo might not be needed for this but it does no harm in this situation.
  3. Get a clean clone of IOTstack.
  4. Copy your existing docker-compose.yml into the clean clone.
  5. Simulate a menu side-effect by creating the services directory.
  6. Copy your existing docker-compose.save.yml into the clean clone. This is what the menu actually generates and it records your choices. It, plus any override file are coalesced to become docker-compose.yml.

It would be a good idea to look through the old "services" directory to pick up things like Node-RED choices. Using mkdir to create target directories and cp to copy files, all without sudo, is the best way of ensuring the result is what the menu would have done.

Once everything is in place:

$ cd ~/IOTstack
$ docker-compose up -d

If none of that works then it might be time to start over from a clean slate. Maybe take a look at PiBuilder. That takes a bit of time to get your brain around but, ultimately, you wind up with a system ready-to-run IOTstack, plus a set of customised scripts that let you repeat the build any time you like (busted SD, Pi emits magic smoke, you get a second Pi, etc).

But, please, really pay attention to "a word about the sudo command". Over-using sudo is the best way to cause all manner of trouble. It's a habit to break.


By the way, when you post things like your docker-compose.yml in an issue, please wrap everything in triple back-ticks, like this:

```

your compose file or list of error messages etc goes here

```

Everything between matching pairs of triple back-ticks is displayed "as is". Nothing gets interpreted as headings. It makes it much easier for people trying to help you read through your evidence.

@Paraphraser
Copy link

Pilot error. Should probably be considered stale.

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

Successfully merging a pull request may close this issue.

2 participants