Skip to content
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

standard_init_linux.go:211: exec user process caused "exec format error" #88

Closed
gabrielwhite opened this issue Sep 22, 2020 · 10 comments
Closed
Labels
arm Related to ARM builds

Comments

@gabrielwhite
Copy link

I have just tried to get this running on OMV5 (Debian Buster) / ARMv7 using the Docker compose.

The Docker PhotoView logs show this:

standard_init_linux.go:211: exec user process caused "exec format error"

I can't access the server on the local network using it's IP (http://10.0.0.3:8088). I changed the port configuration in Docker below. The container itself keeps restarting.

curl http://10.0.0.3:8088
curl: (7) Failed to connect to 10.0.0.3 port 8088: Connection refused

I'm using the linuxserver/mariadb image because the stock mariadb image doesn't have an ARMv7 build.

Here's my docker-compose

version: "3"

services:
  db:
    image: linuxserver/mariadb
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=100
      - MYSQL_ROOT_PASSWORD=1234
      - TZ=America/Santiago
      - MYSQL_DATABASE=photoview
      - MYSQL_USER=photoview 
      - MYSQL_PASSWORD=abcd 
    volumes:
      - db_data:/config
    ports:
      - 3306:3306
    restart: unless-stopped

  photoview:
    image: viktorstrate/photoview:latest
    container_name: photoview
    restart: always
    ports:
      - "8088:80"
    depends_on:
      - db
    environment:
      - MYSQL_URL=photoview:abcd@tcp(db)/photoview
      - API_LISTEN_IP=photoview
      - API_LISTEN_PORT=80
      - PHOTO_CACHE=/app/cache
      - PUBLIC_ENDPOINT=http://10.0.0.3:80/
    volumes:
      - api_cache:/app/cache
      - /srv/dev-disk-by-label-NASHD/Photos/test:/photos:ro

volumes:
  db_data:
  api_cache:

I've tried the PUBLIC_ENDPOINT commented out completely, and on both ports 80 and 8088.

The mariadb logs don't show any errors

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.,
[s6-init] ensuring user provided files have correct perms...exited 0.,
[fix-attrs.d] applying ownership & permissions fixes...,
[fix-attrs.d] done.,
[cont-init.d] executing container initialization scripts...,
[cont-init.d] 01-envfile: executing... ,
[cont-init.d] 01-envfile: exited 0.,
[cont-init.d] 10-adduser: executing... ,
,
-------------------------------------,
          _         (),
         | |  ___   _    __,
         | | / __| | |  /  \ ,
         | | \__ \ | | | () |,
         |_| |___/ |_|  \__/,
,
,
Brought to you by linuxserver.io,
-------------------------------------,
,
To support LSIO projects visit:,
https://www.linuxserver.io/donate/,
-------------------------------------,
GID/UID,
-------------------------------------,
,
User uid:    1000,
User gid:    100,
-------------------------------------,
,
[cont-init.d] 10-adduser: exited 0.,
[cont-init.d] 30-config: executing... ,
[cont-init.d] 30-config: exited 0.,
[cont-init.d] 40-initialise-db: executing... ,
[cont-init.d] 40-initialise-db: exited 0.,
[cont-init.d] 99-custom-scripts: executing... ,
[custom-init] no custom files found exiting...,
[cont-init.d] 99-custom-scripts: exited 0.,
[cont-init.d] done.,
[services.d] starting services,
[services.d] done.,
200922 16:27:11 mysqld_safe Logging to syslog.,
200922 16:27:11 mysqld_safe Starting mysqld daemon with databases from /config/databases,
@viktorstrate
Copy link
Member

Hi @gabrielwhite, thank you for the detailed description.

I have tried to recreate your environment, running it on arm/v7 with linuxserver/mariadb.
I got some errors when photoview tried to set up the database.

  • One problem with key lengths, the arm database must have a smaller max key length, which caused an issue with the username field being too long (256 characters)
  • Another problem was a small syntax error, that apparently doesn't matter in the official docker version of mariadb.

I will update the database migrations, and come back to ask you to verify that it works.


Another thing, in your docker-compose.yml config, you are exposing photoview to port 8088. Theirefore, you will have problems loading images on the website, if you don't update PUBLIC_ENDPOINT accordingly:

- PUBLIC_ENDPOINT=http://10.0.0.3:8088/

viktorstrate added a commit that referenced this issue Sep 23, 2020
- Change max key-length of username to 128
- Fix minor syntax error
@viktorstrate
Copy link
Member

Hi again,
After fixing the errors mentioned above, I got the same error as you reported:

standard_init_linux.go:211: exec user process caused "exec format error"

I found out that the Dockerfile was misconfigured, causing the cross-compilation to not work properly. It has been fixed in the newest commits.

Could you please try again but using the viktorstrate/photoview:edge version, as the changes hasn't been fully released yet.

@viktorstrate viktorstrate added the arm Related to ARM builds label Sep 23, 2020
@gabrielwhite
Copy link
Author

gabrielwhite commented Sep 23, 2020

Thanks for the quick fix. So I can now get the app up and running, but it's not showing photos and generating errors.

I can create an account, and trigger a scan. The photos page is empty after running a scan.

I set photos to /photos, per the Docker config.

When I open the Albums page I get this error:

Multiple things went wrong
Received 3 errors from the server. See the console for more information

On the Albums page itself, this is shown

Error GraphQL error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'recursive sub_albums AS ( SELECT * FROM album AS root WHERE album_id = ? U' at line 1 GraphQL error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'recursive sub_albums AS ( SELECT * FROM album AS root WHERE album_id = ? U' at line 1 GraphQL error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'recursive sub_albums AS ( SELECT * FROM album AS root WHERE album_id = ? U' at line 1

Here's the log:

2020/09/23 13:44:11 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:12 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:13 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:14 Could not connect to database: Could not ping database, exiting: dial tcp 172.18.0.2:3306: connect: connection refused,
panic: Could not connect to database: Could not ping database, exiting: dial tcp 172.18.0.2:3306: connect: connection refused,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc41bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 13:44:18 No .env file found,
2020/09/23 13:44:18 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 13:44:18 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:19 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:20 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:21 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:22 Could not connect to database: Could not ping database, exiting: dial tcp 172.18.0.2:3306: connect: connection refused,
panic: Could not connect to database: Could not ping database, exiting: dial tcp 172.18.0.2:3306: connect: connection refused,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc8dbcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 13:44:25 No .env file found,
2020/09/23 13:44:25 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 13:44:25 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:26 WARN: Could not ping database: dial tcp 172.18.0.2:3306: connect: connection refused, Will retry after 1 second,
2020/09/23 13:44:28 Database migrated,
2020/09/23 13:44:28 Queue waiting,
2020/09/23 13:44:28 Periodic scan interval changed: disabled,
2020/09/23 13:44:28 Scan interval runner: Waiting for signal,
2020/09/23 13:44:28 Scan interval runner: New ticker detected,
2020/09/23 13:44:28 Scan interval runner: Waiting for signal,
2020/09/23 13:44:28 Executable worker not found: darktable,
2020/09/23 13:44:28 Found executable worker: ffmpeg,
2020/09/23 13:44:28 Photoview API endpoint listening at http://photoview:80/api,
2020/09/23 13:44:28 Photoview API public endpoint ready at /api,
2020/09/23 13:44:28 Photoview UI public endpoint ready at ,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/ 4.232499ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/src.92b283f0.css 56.616781ms unauthenticated,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/src.1100ebeb.js 79.017692ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 Not allowing websocket request from 10.0.0.3:8088 because it doesn't match UI_ENDPOINT ,
2020/09/23 13:45:40 unable to upgrade *server.statusResponseWriter to websocket websocket: request origin not allowed by Upgrader.CheckOrigin: ,
2020/09/23 13:45:40 http: superfluous response.WriteHeader call from github.com/viktorstrate/photoview/api/server.(*statusResponseWriter).WriteHeader (logging.go:83),
2020/09/23 13:45:40 GET 400 10.0.0.3:8088/api/graphql 910.958µs unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/photoview-logo.98f3a1b7.svg 5.361916ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/PhotosPage.2fdabd9e.js 3.528499ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/icons.6c15f489.woff2 1.915708ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/LoginPage.fe2f260d.js 3.263916ms unauthenticated,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/LoginPage.81ce14ad.css 2.101457ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
[mysql] 2020/09/23 13:45:40 packets.go:122: closing bad idle connection: unexpected read from socket,
2020/09/23 13:45:40 POST 200 10.0.0.3:8088/api/graphql 16.662955ms unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/favicon.ico 284.709µs unauthenticated,
2020/09/23 13:45:40 Did not find auth-token cookie,
2020/09/23 13:45:40 GET 200 10.0.0.3:8088/InitialSetupPage.decd0dee.js 3.316582ms unauthenticated,
2020/09/23 13:45:47 Did not find auth-token cookie,
2020/09/23 13:45:48 POST 200 10.0.0.3:8088/api/graphql 730.64894ms unauthenticated,
2020/09/23 13:45:48 Not allowing websocket request from 10.0.0.3:8088 because it doesn't match UI_ENDPOINT ,
2020/09/23 13:45:48 unable to upgrade *server.statusResponseWriter to websocket websocket: request origin not allowed by Upgrader.CheckOrigin: ,
2020/09/23 13:45:48 http: superfluous response.WriteHeader call from github.com/viktorstrate/photoview/api/server.(*statusResponseWriter).WriteHeader (logging.go:83),
2020/09/23 13:45:48 GET 400 10.0.0.3:8088/api/graphql 265.25µs user: admin,
2020/09/23 13:45:48 POST 200 10.0.0.3:8088/api/graphql 367.375µs user: admin,
2020/09/23 13:45:48 GET 200 10.0.0.3:8088/outline-icons.bdc1b4ed.woff2 4.466875ms user: admin,
2020/09/23 13:45:48 SQL Filter: ' ORDER BY title ASC LIMIT 100 OFFSET 0',
2020/09/23 13:45:48 POST 200 10.0.0.3:8088/api/graphql 7.97404ms user: admin,
2020/09/23 13:45:52 GET 200 10.0.0.3:8088/SettingsPage.c952d252.js 6.814082ms user: admin,
2020/09/23 13:45:52 GET 200 10.0.0.3:8088/SettingsPage.d6f81c96.css 2.433291ms user: admin,
2020/09/23 13:45:52 POST 200 10.0.0.3:8088/api/graphql 3.364166ms user: admin,
2020/09/23 13:45:52 POST 200 10.0.0.3:8088/api/graphql 2.430542ms user: admin,
2020/09/23 13:45:52 POST 200 10.0.0.3:8088/api/graphql 3.171208ms user: admin,
2020/09/23 13:45:54 Scanning directory: /photos/,
2020/09/23 13:45:54 Scanning directory: /photos/folder three,
2020/09/23 13:45:54 Scanning directory: /photos/one,
2020/09/23 13:45:54 Scanning directory: /photos/two,
2020/09/23 13:45:54 Queue waiting for lock,
2020/09/23 13:45:54 Queue running,
2020/09/23 13:45:54 Broadcasting notification: Scanning media,
2020/09/23 13:45:54 Queue waiting,
2020/09/23 13:45:54 POST 200 10.0.0.3:8088/api/graphql 128.149558ms user: admin,
2020/09/23 13:45:54 Queue waiting for lock,
2020/09/23 13:45:54 Queue running,
2020/09/23 13:45:54 Queue waiting,
2020/09/23 13:47:26 GET 200 10.0.0.3:8088/AlbumsPage.7ee3deb7.js 3.426916ms user: admin,
2020/09/23 13:47:26 SQL Filter: ' ORDER BY title ASC',
2020/09/23 13:47:26 POST 200 10.0.0.3:8088/api/graphql 12.000581ms user: admin,

Also, I commented out this in docker-compose, as it was generating other errors

# - PUBLIC_ENDPOINT=http://10.0.0.3:8088/

Not sure how I should configure this?

@viktorstrate
Copy link
Member

viktorstrate commented Sep 23, 2020

Hmm, it looks like mariadb is having some issues with a recursive query, I will look into that tomorrow.

The PUBLIC_ENDPOINT env variable is very important for photoview to work. If it is generating other errors, please post them as well. It should be configured to the same as the url you type into the address bar in your browser to access photoview.

@gabrielwhite
Copy link
Author

gabrielwhite commented Sep 23, 2020

Thanks!

So I tried setting PUBLIC_ENDPOINT to these

      - PUBLIC_ENDPOINT=http://10.0.0.3:80/
      - PUBLIC_ENDPOINT=http://10.0.0.3:8088/

And in both cases the logs were full of the same error (for what it's worth the docker host is 10.0.0.3 and my router is 10.0.0.1):

2020/09/23 20:28:11 No .env file found,
2020/09/23 20:28:11 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:11 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:12 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:13 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:14 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:16 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc8dbcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 20:28:23 No .env file found,
2020/09/23 20:28:23 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:23 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:24 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:25 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:26 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:27 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc93bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 20:28:30 No .env file found,
2020/09/23 20:28:30 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:30 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:31 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:32 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:33 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:34 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc5bbcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 20:28:36 No .env file found,
2020/09/23 20:28:36 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:36 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:37 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:38 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:39 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:40 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc41bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 20:28:42 No .env file found,
2020/09/23 20:28:42 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:42 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:43 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:44 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:45 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:46 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc93bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 20:28:50 No .env file found,
2020/09/23 20:28:50 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:50 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:51 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:52 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:53 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:54 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc41bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/23 20:28:58 No .env file found,
2020/09/23 20:28:58 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:58 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:59 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,

And I can't connect

curl http://10.0.0.3:8088/
curl: (7) Failed to connect to 10.0.0.3 port 8088: Connection refused

As I said before if I'd left the line commented out I was able to get into the Photoview UI but with the errors I described above.

Here's the docker-compose file again - I'm not sure whether my changed port mapping is affecting things?

version: "3"

services:
  db:
    image: linuxserver/mariadb
    network_mode: bridge
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=100
      - MYSQL_ROOT_PASSWORD=1234
      - TZ=America/Santiago
      - MYSQL_DATABASE=photoview
      - MYSQL_USER=photoview 
      - MYSQL_PASSWORD=abcd 
    volumes:
      - db_data:/config
    ports:
      - 3306:3306
    restart: unless-stopped

  photoview:
    image: viktorstrate/photoview:edge
    network_mode: bridge
    container_name: photoview
    restart: unless-stopped
    ports:
      - 8088:80
    depends_on:
      - db
    environment:
      - MYSQL_URL=photoview:abcd@tcp(db)/photoview
      - API_LISTEN_IP=photoview
      - API_LISTEN_PORT=80
      - PHOTO_CACHE=/app/cache

      # Change This: The publicly exposed url
      # For example if the server is available from the domain example.com,
      # change this value to http://example.com/
      - PUBLIC_ENDPOINT=http://10.0.0.3:8088/

    volumes:
      - api_cache:/app/cache

      # Change this to the directory where your photos are located on your server.
      # If the photos are located at `/home/user/photos`, then change this value
      # to the following: `/home/user/photos:/photos:ro`.
      # You can mount multiple paths, if your photos are spread across multiple directories.
      - /srv/dev-disk-by-label-NASHD/Photos/test:/photos:ro

volumes:
  db_data:
  api_cache:

@viktorstrate
Copy link
Member

Hmm.. It looks like linuxserver/mariadb is using an old version of mariadb v10.1, which was initially release in 2014, with no new features added since.
A recursive query is used for getting album thumbnails, this feature was first added to mariadb in version 10.4. And the latest is v10.5.

$ docker-compose exec db /bin/bash -c "mysql -u photoview -pabcd -e 'SELECT VERSION();'"
+----------------------------------+
| VERSION()                        |
+----------------------------------+
| 10.1.44-MariaDB-0ubuntu0.18.04.1 |
+----------------------------------+

Do you think there exists a more up to date mariadb docker image for arm7?
I would like not having to support older versions of mariadb, as it would make testing more difficult.


Regarding your last comment, the error you are getting doesn't seem to corelate with the PUBLIC_ENDPOINT variable.
Are you sure the only thing you changed was to add PUBLIC_ENDPOINT?

It looks like a problem with resolving the hostname db to the ip address of the database container. It asks your router instad of Docker. It might have somthing to do with the network_mode being bridge. I can see that the network_mode wasn't set in the first docker-compose file you sent.

@gabrielwhite
Copy link
Author

I got it running, but now no photos are showing up. It seems to be scanning successfully (and the folders are showing up as albums), but the album thumbnails are blank and both the Photos page and within each album are empty.

There seemed to be some issue with the configuration of this environment variable within the Docker environment. I changed this:

      - MYSQL_URL=photoview:abcd@tcp(db)/photoview

To this

      - MYSQL_URL=photoview:abcd@tcp(10.0.0.3)/photoview

I'd tried both host and bridge in the original configuration (db) you specified and neither worked.

The (db) configuration resulted in these errors:

2020/09/23 20:28:42 No .env file found,
2020/09/23 20:28:42 Connecting to database: photoview:abcd@tcp(db)/photoview?multiStatements=true&parseTime=true,
2020/09/23 20:28:42 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:43 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:44 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:45 WARN: Could not ping database: dial tcp: lookup db on 10.0.0.1:53: no such host, Will retry after 1 second,
2020/09/23 20:28:46 Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
panic: Could not connect to database: Could not ping database, exiting: dial tcp: lookup db on 10.0.0.1:53: no such host,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc93bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,

Here's my docker-compose

version: "3"

services:

  db:
    image: yobasystems/alpine-mariadb:latest
    network_mode: host
    container_name: photoviewdb
    environment:
      - MYSQL_ROOT_PASSWORD=1234
      - MYSQL_DATABASE=photoview
      - MYSQL_USER=photoview
      - MYSQL_PASSWORD=abcd
    ports:
      - 3306:3306
    volumes:
      - db_data:/var/lib/mysql
    restart: unless-stopped

  photoview:
    image: viktorstrate/photoview:edge
    network_mode: bridge
    container_name: photoview
    restart: unless-stopped
    ports:
      - 8088:80
    depends_on:
      - db
    environment:
      - MYSQL_URL=photoview:abcd@tcp(10.0.0.3)/photoview
      - API_LISTEN_IP=photoview
      - API_LISTEN_PORT=80
      - PHOTO_CACHE=/app/cache

      # Change This: The publicly exposed url
      # For example if the server is available from the domain example.com,
      # change this value to http://example.com/
      - PUBLIC_ENDPOINT=http://10.0.0.3:8088/

    volumes:
      - api_cache:/app/cache

      # Change this to the directory where your photos are located on your server.
      # If the photos are located at `/home/user/photos`, then change this value
      # to the following: `/home/user/photos:/photos:ro`.
      # You can mount multiple paths, if your photos are spread across multiple directories.
      - /srv/dev-disk-by-label-NASHD/Photos/test:/photos:ro

volumes:
  db_data:
  api_cache:

And here's the photoview log

2020/09/24 13:27:20 No .env file found,
2020/09/24 13:27:20 Connecting to database: photoview:abcd@tcp(10.0.0.3)/photoview?multiStatements=true&parseTime=true,
2020/09/24 13:27:20 WARN: Could not ping database: dial tcp 10.0.0.3:3306: connect: connection refused, Will retry after 1 second,
2020/09/24 13:27:21 WARN: Could not ping database: dial tcp 10.0.0.3:3306: connect: connection refused, Will retry after 1 second,
2020/09/24 13:27:22 WARN: Could not ping database: dial tcp 10.0.0.3:3306: connect: connection refused, Will retry after 1 second,
2020/09/24 13:27:23 WARN: Could not ping database: dial tcp 10.0.0.3:3306: connect: connection refused, Will retry after 1 second,
2020/09/24 13:27:24 Could not connect to database: Could not ping database, exiting: dial tcp 10.0.0.3:3306: connect: connection refused,
panic: Could not connect to database: Could not ping database, exiting: dial tcp 10.0.0.3:3306: connect: connection refused,
,
,
goroutine 1 [running]:,
log.Panicf(0x57b13e, 0x22, 0xc41bcc, 0x1, 0x1),
	/usr/local/go/src/log/log.go:358 +0x94,
main.main(),
	/app/server.go:35 +0xe8,
2020/09/24 13:27:26 No .env file found,
2020/09/24 13:27:26 Connecting to database: photoview:abcd@tcp(10.0.0.3)/photoview?multiStatements=true&parseTime=true,
2020/09/24 13:27:27 Database migrated,
2020/09/24 13:27:27 Queue waiting,
2020/09/24 13:27:27 Periodic scan interval changed: disabled,
2020/09/24 13:27:27 Scan interval runner: Waiting for signal,
2020/09/24 13:27:27 Scan interval runner: New ticker detected,
2020/09/24 13:27:27 Scan interval runner: Waiting for signal,
2020/09/24 13:27:27 Executable worker not found: darktable,
2020/09/24 13:27:27 Found executable worker: ffmpeg,
2020/09/24 13:27:27 Photoview API endpoint listening at http://photoview:80/api,
2020/09/24 13:27:27 Photoview API public endpoint ready at http://10.0.0.3:8088/api,
2020/09/24 13:27:27 Photoview UI public endpoint ready at http://10.0.0.3:8088/,
2020/09/24 13:27:27 sql: no rows in result set,
2020/09/24 13:27:27 Invalid token: sql: no rows in result set,
2020/09/24 13:27:27 sql: no rows in result set,
2020/09/24 13:27:27 Invalid token: sql: no rows in result set,
2020/09/24 13:27:27 Did not find auth-token cookie,
2020/09/24 13:27:27 POST 200 10.0.0.3:8088/api/graphql 1.583917ms unauthenticated,
2020/09/24 13:27:32 Did not find auth-token cookie,
2020/09/24 13:27:32 Did not find auth-token cookie,
2020/09/24 13:27:32 POST 200 10.0.0.3:8088/api/graphql 3.549792ms unauthenticated,
2020/09/24 13:27:38 Did not find auth-token cookie,
2020/09/24 13:27:38 POST 200 10.0.0.3:8088/api/graphql 655.923218ms unauthenticated,
2020/09/24 13:27:38 GET 0 10.0.0.3:8088/api/graphql 6.98842538s unauthenticated,
2020/09/24 13:27:39 POST 200 10.0.0.3:8088/api/graphql 607.167µs user: admin,
2020/09/24 13:27:39 Registering notification listener,
2020/09/24 13:27:39 SQL Filter: ' ORDER BY title ASC LIMIT 100 OFFSET 0',
2020/09/24 13:27:39 POST 200 10.0.0.3:8088/api/graphql 4.867208ms user: admin,
2020/09/24 13:27:40 POST 200 10.0.0.3:8088/api/graphql 5.620709ms user: admin,
2020/09/24 13:27:40 POST 200 10.0.0.3:8088/api/graphql 5.220667ms user: admin,
2020/09/24 13:27:40 POST 200 10.0.0.3:8088/api/graphql 11.734084ms user: admin,
2020/09/24 13:27:42 Scanning directory: /photos,
2020/09/24 13:27:42 Scanning directory: /photos/one,
2020/09/24 13:27:42 Scanning directory: /photos/two,
2020/09/24 13:27:42 POST 200 10.0.0.3:8088/api/graphql 61.095421ms user: admin,
2020/09/24 13:27:42 Queue waiting for lock,
2020/09/24 13:27:42 Queue running,
2020/09/24 13:27:42 Broadcasting notification: Scanning media,
2020/09/24 13:27:42 Queue waiting,
2020/09/24 13:27:42 Queue waiting for lock,
2020/09/24 13:27:42 Queue running,
2020/09/24 13:27:42 Queue waiting,
2020/09/24 13:27:48 SQL Filter: ' ORDER BY title ASC',
2020/09/24 13:27:48 POST 200 10.0.0.3:8088/api/graphql 32.934836ms user: admin,
2020/09/24 13:27:49 SQL Filter: ' ORDER BY title ASC',
2020/09/24 13:27:49 SQL Filter: ' ORDER BY title DESC',
2020/09/24 13:27:49 POST 200 10.0.0.3:8088/api/graphql 6.689292ms user: admin,
2020/09/24 13:27:49 POST 200 10.0.0.3:8088/api/graphql 4.056459ms user: admin,
2020/09/24 13:28:09 GET 0 10.0.0.3:8088/api/graphql 30.073088936s user: admin,
2020/09/24 13:28:09 Deregistering notification listener,
2020/09/24 13:28:12 Scanning directory: /photos,
2020/09/24 13:28:12 Scanning directory: /photos/one,
2020/09/24 13:28:12 Scanning directory: /photos/two,
2020/09/24 13:28:12 POST 200 10.0.0.3:8088/api/graphql 80.434048ms user: admin,

The directories each have 4 JPG images.

@viktorstrate
Copy link
Member

I was able to replicate it. The photos wasn't scanned because of a bug introduced in one of the most recently implemented features that hadn't been tested properly. I should be fixed in the commit bbff259.

Please try to pull and rerun it:

$ docker-compose pull
$ docker-compose down -v
$ docker-compose up

@gabrielwhite
Copy link
Author

Working! Thanks a million.

@viktorstrate
Copy link
Member

No problem, I crushed some quite important bugs when debugging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Related to ARM builds
Projects
None yet
Development

No branches or pull requests

2 participants