ryansch / docker-unifi-rpi

Unifi Controller for Raspberry Pi 3+ and x86
https://hub.docker.com/r/ryansch/unifi-rpi/
347 stars 42 forks source link

cannot login after migration new sdcard rpi3b+ #34

Closed RezzZ closed 5 years ago

RezzZ commented 5 years ago

Hi, I just installed a new sd in my raspberry (3B+) and tried to restore my unifi installation. I backed up my opt/ folder and restored in on the new sd card. I created new images and containers for all my running docker applications. Unfortunately I cannot login to unifi, I get a:

Login error
Invalid username and/or password.

My compose file looks like this:

version: '2.1'
services:
  unifi:
    container_name: unifi
    image: ryansch/unifi-rpi:latest
    network_mode: "host"
    ports:
      - '3478:3478/udp'
      - '10001:10001/udp'
      - '6789:6789/tcp'
      - '8080:8080/tcp'
      - '8880:8880/tcp'
      - '8443:8443/tcp'
      - '8843:8843/tcp'
    volumes:
      - /opt/unifi/varlib:/var/lib/unifi
      - /opt/unifi/logs1:/usr/lib/unifi/logs
      - /opt/unifi/logs2:/var/log/unifi
      - /opt/unifi/run1:/usr/lib/unifi/run
      - /opt/unifi/run2:/run/unifi
      - /opt/unifi/work:/usr/lib/unifi/work
    restart: on-failure
    environment:
      - TZ=Europe/Amsterdam

Any ideas why my credentials are rejected? I already tried the default ubnt/ubnt but without luck

ryansch commented 5 years ago

I don't see anything with your volume configuration that sticks out. Make sure the files in /opt/unifi/varlib make sense and have the right ownership.

Note: The ports section is unneeded with host networking.

RezzZ commented 5 years ago

what is the correct owner for the files? It might be the cause but I chowned all files and folders to root:root and I still can't login.

In the logs I find the following error:

Java HotSpot(TM) Client VM warning: You have loaded library /usr/lib/unifi/lib/native/Linux/armv7/libubnt_webrtc_jni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
ryansch commented 5 years ago

That error message is standard for unifi installations (for whatever reason).

Can you run uname -a and let me know what the output is?

I'm also curious to know if this is the problem: https://github.com/ryansch/docker-unifi-rpi/blob/master/5.9/Dockerfile.arm32v7#L35

RezzZ commented 5 years ago

Hi Ryan, I started with a new set of files and restored the settings with a backup file so can't verify this any more. I will revisit your git if the problem reoccurs should I ever move to a different SD or perhaps usb/ssd again. One thing that might be the reason is that I noticed some big changes in Unify itself so perhaps the my persisted config files were outdated and not compatible with the latest unify version?

ryansch commented 5 years ago

Oh that's great @RezzZ. I'm glad you got it working.