lomorage/lomo-docker

platform error?

Closed this issue · 18 comments

Hi

Willing to give a try to Lomorage (sounds promising!) and got the following error while trying to run it through Docker on Raspberry:
The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
Any clue?

It used to work with the same image, tried to run locally with latest docker installation and having the same problem, not sure the root cause yet, the docker image use balena base image, and seems other user has similar problem, balena-io-library/base-images#672. Tried to change base image to "balenalib/armv7hf-debian" but still having problem. Will figure it out.

@darrepac, that is just warning message, besides that is there any other errors?

Hi
In fact as the run script was ending, I thought it was failing but yes something is running (sorry I am new to docker) but:

  • ps -aef show a strange command line:
    usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8000 -container-ip 172.17.0.2 -container-port 8000
    What is this 172.17.0.2 ip? Knowing that is neither my local (192.168.0.53) or wan ip

  • when I go into 192.168.0.53:8000 it forwards me to lomorage.com, normal?

  • When I go into 192.168.0.53:8001, it asks me for login and password but neither my pi or root login work (?)

  • Finally, with the ios app, it successfully see the lomorage server at 192.168.0.53:8001 but then always fail to create user

I think I need help ;)

  • It's the docker container ip, so the traffic forward from your host machine to the docker container.

  • 192.168.0.53:8000 just redirect to the homepage for user reference, nothing is sent to us. Actually you don't internet access to use Lomorage.

  • 192.168.0.53:8001 is the Lomorage web app, the login username and password is the Lomorage Username/Password set using Phone APP.

  • Could you check "/opt/lomorage/var/log/lomod.log" to see if there is any error there? Or you can send log in iOS app, go to the settings and send log via email. Or join us on slack

Log sent from iOS
Nothing in /opt

`192.168.0.53:8001 is the Lomorage web app, the login username and password is the Lomorage Username/Password set using Phone APP.

`
Yeah but the ios app always say that it fails to create user

oh, sorry, in docker the log is in "lomo-dir" set via commandline option "-b {lomo-dir}".

There should be subdirectories in media home directory,for example if you specify "-m /mnt/hdd/", then there should be some subdirectory in hdd, like "/mnt/hdd/lomorage".

Will add that in the readme, we had that on the homepage but still it's missing here.

cat lomod.log | grep error
time="2020-12-18T19:46:03Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T06:40:27Z" level=error msg="Invalid Token"
time="2020-12-19T08:01:10Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:01:10Z" level=error msg="sql: no rows in result set"
time="2020-12-19T08:04:07Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:04:07Z" level=error msg="sql: no rows in result set"
time="2020-12-19T08:04:15Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:04:15Z" level=error msg="sql: no rows in result set"
time="2020-12-19T08:05:03Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:05:03Z" level=error msg="sql: no rows in result set"
time="2020-12-19T08:13:04Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:13:04Z" level=error msg="sql: no rows in result set"
time="2020-12-19T08:14:46Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:14:46Z" level=error msg="Invalid name"
time="2020-12-19T08:14:58Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:14:58Z" level=error msg="mkdir /media/001.jpg: not a directory"
time="2020-12-19T08:24:55Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:24:55Z" level=error msg="mkdir /media/001.jpg: not a directory"
time="2020-12-19T08:27:44Z" level=error msg="Invalid Token"
time="2020-12-19T08:55:56Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T08:55:56Z" level=error msg="sql: no rows in result set"
time="2020-12-19T11:03:04Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T11:03:04Z" level=error msg="sql: no rows in result set"
time="2020-12-19T11:04:44Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T11:04:44Z" level=error msg="mkdir /media/001.jpg: not a directory"
time="2020-12-19T11:04:53Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-19T11:04:53Z" level=error msg="mkdir /media/001.jpg: not a directory"

What is the directory you use for "lomo-dir", you can create a subdirectory there, and when create user choose that directory created on iOS APP.

createuser

First of all, it was not clear to me that I have to choose a folder when I create an user (if it can help to improve user experience)
I created a folder in my lomo-dir but in fact, in the app, it is proposing folder from the media-dir. So I created a folder there and indeed, by selecting it I have been able to create a user on iOS app!

So if I understand correctly, I now backup my phone photos to the media-dir (my NAS).
Is there a way to read my 120GB of photos from my Nas in the app?
I mean I would like to use it like a replacement of all cloud services. Or it is limited to phone backup?

I see the same waring as mentioned in this issue:

The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested

What I have:

  • Raspberry Pi 4B with 2GB RAM

  • 16 GB MicroSD

  • 500 GB HDD connected through USB 3.0 port and mounted to /media/pi/MyDrive

  • Android 10 phone

  • Lomorage App for Android (version 0.72, downloaded from here)

What I do (follow this direction, using docker):

  • Run these commands one by one
sudo apt install -y ca-certificates
sudo update-ca-certificates --fresh
curl -fSLs https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
sudo systemctl start docker
sudo docker pull lomorage/raspberrypi-lomorage:latest
  • Set up frpc service, map local 8000 and 8001 port to these two ports on my VPS. My frpc.ini:
[common]
server_addr = (ip address of my VPS)
server_port = 7000
token = 1234567

[lomod]
type = tcp
local_ip = 127.0.0.1
local_port = 8000
remote_port = 8000

[lomow]
type = tcp
local_ip = 127.0.0.1
local_port = 8001
remote_port = 8001

(other frpc configs)
  • Edit run.sh as following, in order to save some time in typing those arguments in command line. The rest part of run.sh is not modified. (192.168.1.88 is the local IP of my raspberry pi)
DEBUG=0
HOME_MEDIA_DIR=/media/pi/MyDrive/Bac
HOME_LOMO_DIR=/home/pi/MyDir/lomorage
HOST=192.168.1.88
LOMOD_HOST_PORT=8000
LOMOW_HOST_PORT=8001
IMAGE_NAME="lomorage/raspberrypi-lomorage:latest"
  • Run sudo ./run.sh

What happen after that

  • Output
Host: 192.168.1.88
lomo-backend host port: 8001
lomo-web host port: 8000
Media directory: /media/pi/MyDrive/Bac
Lomo directory: /home/pi/MyDir/lomorage
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
d9a6c1ceca550ccd6c91ba51d4bc0830e4f233b9a8dcef8d2f9c2fef2c233945
  • Webpage on port 8001 is ok. I can visit it from http://ip_of_my_vps:8001, http://192.168.1.88:8001 (through local network) and even http://raspberrypi.local:8001 (through local network). The webpage has input boxes for username and password and also a submit button.
  • Fail to create account in Android app (version 0.72). None of Server Address: ip_of_my_vps+Port: 8000, Server Address: 192.168.1.88+Port: 8000 (through local network) and Server Address: raspberrypi.local+Port: 8000 (through local network) can be used to create an account.
  • Error message of failure in creating account on app is:
Create User Failed(Interal Error Dir=0 or Server not started).
Please check or setup Lomorage server!

Server Addess You Input is: <whatever IP I use>
  • I also find these things in lomod.log:
time="2020-12-20T02:57:40Z" level=info msg="access log file is /lomo/lomod_access.log"
time="2020-12-20T02:57:40Z" level=info msg="backup log file is /lomo/lomod_backup.log"
time="2020-12-20T02:57:40Z" level=info msg="inconsistent check log file is /lomo/lomod_check.log"
time="2020-12-20T02:57:40Z" level=warning msg="query got error: sql: no rows in result set"
time="2020-12-20T02:57:40Z" level=info msg="next backup is scheduled at 2020-12-21 02:00:00 +0000 UTC"
time="2020-12-20T02:57:40Z" level=info msg="Start serving at ::8000"
time="2020-12-20T02:57:40Z" level=warning msg="while starting https listener, got no sub domain allocated yet"
time="2020-12-20T02:57:50Z" level=info msg="Published service: <redacted>, type: _lomod._tcp, domain: local."

Comments

Error message on Android app is the same as connecting to an IP address with no Lomorage service. Meanwhile, webpage on port 8001 is running correctly, indicating that there might be problems in lomod. I checked my frp service, there should be no problem there. Even if frp is broken, I should still be able to connect through my local network. So there is problem unrelated to frp.

By the way, the Android app crashes when I use the TEST EXTERNAL SETTING button in Setting.

Hope all these things I reported here to be useful to you.

First of all, it was not clear to me that I have to choose a folder when I create an user (if it can help to improve user experience)
Thanks for sharing the detail workflow. It will definitely improve. We'll add more notes in installation guide and app.
I created a folder in my lomo-dir but in fact, in the app, it is proposing folder from the media-dir. So I created a folder there and indeed, by selecting it I have been able to create a user on iOS app!

So if I understand correctly, I now backup my phone photos to the media-dir (my NAS).
Is there a way to read my 120GB of photos from my Nas in the app?
I mean I would like to use it like a replacement of all cloud services. Or it is limited to phone backup?
Yes, there is one /opt/lomorage/bin/lomoc utility to scan and import existing photos. What you can do is

  1. run /opt/lomorage/bin/lomoc scan to scan one given directory. It will analysis EXIF tags and generate one data file. If file doesn't have timestamp, it will put it in one folder for user to check.
$ /opt/lomorage/bin/lomoc scan --help
NAME:
   lomoc scan - Scan given directory to check if create time tag is exist or not

USAGE:
   lomoc scan [command options] [directory]

OPTIONS:
   --no-exif-analysis, -n  skip exif tag extraction
  1. run /opt/lomorage/bin/lomoc import to import scanned result.
$ /opt/lomorage/bin/lomoc import --help
NAME:
   lomoc import - Import all photos from scanned directory into lomo backend with given username and password

USAGE:
   lomoc import [command options] [username] [password]

OPTIONS:
   --mdns-domain value   mdns search domain name (default: "local.")
   --mdns-service value  mdns service type (default: "_lomod._tcp")
   --host value          backend lomod host
   --yes, -y             import all photos

Please notes:

  1. Lomorage is designed for multiple users purpose. If your existing photos at NAS are organized by users, you can simple import them; otherwise, better separate them before import
  2. Lomorage manages all imported photos in its own directory, so it will have its own copy after import.

Thanks for using the app. Let us know if you have any other issues.

ok so if I understand correctly, lomoc import will copy all my photos, so then I will have 2x120GB of data, correct?

ok so if I understand correctly, lomoc import will copy all my photos, so then I will have 2x120GB of data, correct?

Yes. But we are open for enhancement if you think it important to keep existing copy. In this case, we can create symbol link only

  • Fail to create account in Android app (version 0.72). None of Server Address: ip_of_my_vps+Port: 8000, Server Address: 192.168.1.88+Port: 8000 (through local network) and Server Address: raspberrypi.local+Port: 8000 (through local network) can be used to create an account.
  • Error message of failure in creating account on app is:
Create User Failed(Interal Error Dir=0 or Server not started).
Please check or setup Lomorage server!

Server Addess You Input is: <whatever IP I use>

This issue is solved by creating a subdirectory named lomorage in media/pi/MyDrive/Bac (where I set for photo storage). Thank you for your guidance. It is appreciated if the error message could be a little bit more precise. Anyway, thank you lomorage. :-)

Knowing that it will copy all my photos (to answer your question above, I find it space/time consuming to copy photo directory that already exist), I decided to restart lomorage with lomodir inside my Nas...;but it failed:

pi@raspberrypi:~ $ sudo ./run.sh -m /home/pi/Photos/ -b /home/pi/DATABASE/Lomorage/ -h 192.168.0.53
Host: 192.168.0.53
lomo-backend host port: 8001
lomo-web host port: 8000
Media directory: /home/pi/Photos/
Lomo directory: /home/pi/DATABASE/Lomorage/
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
4b073fd98065afa45526ad9a25c133a376e86a249d6929e2bff9b907a1a3d063
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: no cgroup mount found in mountinfo: unknown.

@darrepac seems like no cgroup mount found in mountinfo: unknown. is one known issue of docker docker/for-linux#219. Can you please try some workaround mentioned in the issues:

By the way, the Android app crashes when I use the TEST EXTERNAL SETTING button in Setting.

Hope all these things I reported here to be useful to you.

could you help to send the feedback via Lomorage Phone App which will include the log? It is in the Settings page.

fixed in 5ae68e7