lomorage / lomo-docker

Lomorage Raspberry Pi docker image
57 stars 14 forks source link

platform error? #1

Closed darrepac closed 3 years ago

darrepac commented 3 years ago

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?

fuji246 commented 3 years ago

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, https://github.com/balena-io-library/base-images/issues/672. Tried to change base image to "balenalib/armv7hf-debian" but still having problem. Will figure it out.

fuji246 commented 3 years ago

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

darrepac commented 3 years ago

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:

I think I need help ;)

fuji246 commented 3 years ago
darrepac commented 3 years ago

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

fuji246 commented 3 years ago

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.

darrepac commented 3 years ago

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"

fuji246 commented 3 years ago

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

darrepac commented 3 years ago

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?

The-Earth commented 3 years ago

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:

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

[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:

- 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: , 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.
dwebfan commented 3 years ago

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

2. 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.
darrepac commented 3 years ago

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

dwebfan commented 3 years ago

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

The-Earth commented 3 years ago
  • 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:

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. :-)

darrepac commented 3 years ago

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.
dwebfan commented 3 years ago

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

aisnote commented 3 years ago

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.

fuji246 commented 3 years ago

fixed in https://github.com/lomorage/lomo-docker/commit/5ae68e752e58f27f5f083212035ebda1c020eee9