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

Docker install error #3

Open
tehniemer opened this issue Jul 28, 2020 · 9 comments
Open

Docker install error #3

tehniemer opened this issue Jul 28, 2020 · 9 comments

Comments

@tehniemer
Copy link

tehniemer commented Jul 28, 2020

I'm having a problem getting this container up and running, this is the error I'm getting
/tagem-server: error while loading shared libraries: libffmpegthumbnailer.so.4: cannot open shared object file: No such file or directory

Here is the relevant snippet of my compose file.

version: "3.3"

networks:
  proxy:
    external:
      name: proxy
  tagem:
    driver: bridge

## MariaDB - MySQL Database
  tagemdb:
    image: linuxserver/mariadb:latest
    container_name: tagemdb
    restart: always
    networks:
      - tagem
    security_opt:
      - no-new-privileges:true
    volumes:
      - $CONFIG_DIR/tagem/db:/config
      - /etc/localtime:/etc/localtime:ro
    environment:
      PUID: $PUID
      PGID: $PGID
      MYSQL_ROOT_PASSWORD: $ROOT_PASS
      MYSQL_DATABASE: db
      MYSQL_USER: tagem
      MYSQL_PASSWORD: $USER_PASS
      MYSQL_ROOT_HOST: "%"

# Tagem - A single page application, with associated command-line utilities, for the rapid categorising and accessing of files, based on assignable attributes such as (heirarchical) tags, named variables, file sizes, hashes, and audio duration.
# Create all databases and files first
  tagem:
    image: notcompsky/tagem:latest
    container_name: tagem
    restart: always
    networks:
      - proxy
      - tagem
    volumes:
      - $CONFIG_DIR/tagem/tagem-auth.cfg:/tagem-auth.cfg
      - /etc/localtime:/etc/localtime:ro
    security_opt:
      - no-new-privileges:true
    ports:
      - "$TAGEM_PORT:80"
    depends_on:
     - tagemdb
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.tagem-rtr.entrypoints=https"
      - "traefik.http.routers.tagem-rtr.rule=Host(`tagem.$DOMAIN_NAME`)"
      - "traefik.http.routers.tagem-rtr.tls=true"
      ## Middlewares
      - "traefik.http.routers.tagem-rtr.middlewares=chain-oauth@file,add-tagem" # Google OAuth 2.0
      ## HTTP Services
      - "traefik.http.routers.tagem-rtr.service=tagem-svc"
      - "traefik.http.services.tagem-svc.loadbalancer.server.port=80"
@NotCompsky
Copy link
Owner

NotCompsky commented Jul 28, 2020

Okay, it appears I made quite a silly mistake - I forgot to commit a line in the Dockerfile installing the ffmpegthumbnailer package, and tested a local Docker build rather than the DockerHub build.

The fix will come out shortly, I've just noticed another thing I need to patch.

@tehniemer
Copy link
Author

tehniemer commented Jul 28, 2020

That helped me get a little further, now, after creating the .cfg file I get the following error

terminate called after throwing an instance of 'compsky::mysql::except::FileOpen'
  what():  Error opening file: /opt/docker/tagem/tagem-auth.cfg
*** Aborted at 1595940469 (unix time) try "date -d @1595940469" if you are using GNU date ***
PC: @     0x7f687bd7318b gsignal
*** SIGABRT (@0x7) received by PID 7 (TID 0x7f6870379600) from PID 7; stack trace: ***
    @     0x7f687c32b631 (unknown)
    @     0x7f687c2643c0 (unknown)
    @     0x7f687bd7318b gsignal
    @     0x7f687bd52859 abort
    @     0x7f687c10c951 (unknown)
    @     0x7f687c11847c (unknown)
    @     0x7f687c1184e7 std::terminate()
    @     0x7f687c118799 __cxa_throw
    @     0x55ee680ba8cb (unknown)
    @     0x55ee6808b59d (unknown)
    @     0x7f687bd540b3 __libc_start_main
    @     0x55ee6808cdbe (unknown)
Aborted (core dumped)

my compose file (networks and database did not change from first post)

## Tagem - A single page application, with associated command-line utilities, for the rapid categorising and accessing of files, based on assignable attributes such as (heirarchical) tags, named variables, file sizes, hashes, and audio duration.
# Create all databases and files first
  tagem:
    image: notcompsky/tagem:latest
    container_name: tagem
    restart: always
    networks:
      - proxy
      - tagem
    volumes:
      - $CONFIG_DIR/tagem/tagem-auth.cfg:/tagem-auth.cfg
      - /etc/localtime:/etc/localtime:ro
    security_opt:
      - no-new-privileges:true
    ports:
      - "$TAGEM_PORT:80"
    environment:
      TAGEM_MYSQL_CFG: $CONFIG_DIR/tagem/tagem-auth.cfg
    depends_on:
     - tagemdb
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.tagem-rtr.entrypoints=https"
      - "traefik.http.routers.tagem-rtr.rule=Host(`tagem.$DOMAIN_NAME`)"
      - "traefik.http.routers.tagem-rtr.tls=true"
      ## Middlewares
      - "traefik.http.routers.tagem-rtr.middlewares=chain-oauth@file,add-tagem" # Google OAuth 2.0
      ## HTTP Services
      - "traefik.http.routers.tagem-rtr.service=tagem-svc"
      - "traefik.http.services.tagem-svc.loadbalancer.server.port=80"

my tagem-auth.cfg

HOST: tagemdb
PATH: /
USER: tagem
PWRD: supersecretpw
DBNM: db
PORT: 3306
DONT DELETE THIS LINE MMKAY

@NotCompsky
Copy link
Owner

NotCompsky commented Jul 28, 2020

Error opening file: /opt/docker/tagem/tagem-auth.cfg

That exception is thrown when fopen(<FILE_PATH>, "rb") is null - which means that /opt/docker/tagem/tagem-auth.cfg does not appear to the docker container as a file.

And reading your compose file, I think it's because you mount /opt/docker/tagem/tagem-auth.cfg as /tagem-auth.cfg with the following line: $CONFIG_DIR/tagem/tagem-auth.cfg:/tagem-auth.cfg. You need to change the environmental variable you pass to the docker container to account for this: from TAGEM_MYSQL_CFG: $CONFIG_DIR/tagem/tagem-auth.cfg to TAGEM_MYSQL_CFG: /tagem-auth.cfg

@tehniemer
Copy link
Author

OK, I made that change to the environment variable and am getting a new error.

terminate called after throwing an instance of 'compsky::mysql::except::SQLExec'
  what():  Error executing SQL statement of length 162: SELECT u.id,u.name,IFNULL(GROUP_CONCAT(f2.name),"")FROM user u LEFT JOIN user2shown_file2 u2v ON u2v.user=u.id LEFT JOIN file2 f2 ON f2.id=u2v.file2 GROUP BY u.id
*** Aborted at 1596133905 (unix time) try "date -d @1596133905" if you are using GNU date ***
PC: @     0x7f641582918b gsignal
*** SIGABRT (@0x7) received by PID 7 (TID 0x7f6409e2f600) from PID 7; stack trace: ***
    @     0x7f6415de1631 (unknown)
    @     0x7f6415d1a3c0 (unknown)
    @     0x7f641582918b gsignal
    @     0x7f6415808859 abort
    @     0x7f6415bc2951 (unknown)
    @     0x7f6415bce47c (unknown)
    @     0x7f6415bce4e7 std::terminate()
    @     0x7f6415bce799 __cxa_throw
    @     0x55b10ec4306c (unknown)
    @     0x55b10ec14986 (unknown)
    @     0x7f641580a0b3 __libc_start_mai
    @     0x55b10ec15dbe (unknown)
Aborted (core dumped)

@tehniemer
Copy link
Author

Looks like you made some changes, but now I'm getting this

path (null),
terminate called after throwing an instance of 'compsky::mysql::except::SQLExec',
  what():  Error executing SQL statement of length 276: ,
,
CREATE TABLE IF NOT EXISTS dir2tag (,
	dir BIGINT UNSIGNED NOT NULL,,
	tag BIGINT UNSIGNED NOT NULL,,
	user INT UNSIGNED NOT NULL,,
	FOREIGN KEY (dir) REFERENCES dir (id),,
	FOREIGN KEY (tag) REFERENCES tag (id),,
	FOREIGN KEY (user) REFERENCES user (id),,
	PRIMARY KEY (dir,tag),
),
*** Aborted at 1596374393 (unix time) try "date -d @1596374393" if you are using GNU date ***,
PC: @     0x7f7163d0718b gsignal,
*** SIGABRT (@0x1) received by PID 1 (TID 0x7f715830d600) from PID 1; stack trace: ***,
    @     0x7f71642bf631 (unknown),
    @     0x7f7163d0718b gsignal,
    @     0x7f71641f83c0 (unknown),
    @     0x7f7163ce6859 abort,
    @     0x7f71640a0951 (unknown),
    @     0x7f71640ac47c (unknown),
    @     0x7f71640ac4e7 std::terminate(),
    @     0x7f71640ac799 __cxa_throw,
    @     0x55fca91c21c1 (unknown),
    @     0x55fca9168e64 (unknown),
    @     0x55fca9193a45 (unknown),
    @     0x7f7163ce80b3 __libc_start_main,
    @     0x55fca9194ebe (unknown)

@NotCompsky
Copy link
Owner

NotCompsky commented Aug 2, 2020

I've pushed a fix now, thanks.

The issue was a simple foreign key check demanding a table that was not yet initialised.

This was a clumsy oversight on my part - I had re-ordered the initial SQL statements, and forgot to test it in its entirety again.

Edit: Though you'll need to wait for the Docker to build.

@tehniemer
Copy link
Author

Still getting errors.

terminate called after throwing an instance of 'compsky::mysql::except::SQLExec',
  what():  Error executing SQL statement of length 101: ,
  
INSERT INTO user2shown_file2,
(user,file2)
SELECT id, 1

r
ON DUPLICATE KEY UPDATE user=user,
*** Aborted at 1596413517 (unix time) try "date -d @1596413517" if you are using GNU date ***,
PC: @     0x7f38d5d7a18b gsignal,
*** SIGABRT (@0x1) received by PID 1 (TID 0x7f38ca380600) from PID 1; stack trace: ***,
    @     0x7f38d6332631 (unknown),
    @     0x7f38d626b3c0 (unknown),
    @     0x7f38d5d7a18b gsignal,
    @     0x7f38d5d59859 abort,
    @     0x7f38d6113951 (unknown),
    @     0x7f38d611f47c (unknown),
    @     0x7f38d611f4e7 std::terminate(),
    @     0x7f38d611f799 __cxa_throw,
    @     0x55807c98c331 (unknown),
    @     0x55807c932e64 (unknown),
    @     0x55807c95da22 (unknown),
    @     0x7f38d5d5b0b3 __libc_start_main,
    @     0x55807c95ee9e (unknown),

@NotCompsky
Copy link
Owner

NotCompsky commented Aug 3, 2020

That's interesting - not something I've ever seen happen before.

The source code - utils/src/init_user_guest.sql - uses this command:

INSERT INTO user2shown_file2
(user,file2)
SELECT id, 1
FROM user
ON DUPLICATE KEY UPDATE user=user;

and this is visible in its entirety in the executable (as we'd expect).

Yet for some reason FROM user is replaced with \nr in your error output (and presumably in the program itself - the error is most likely a SQL syntax error because of this). I suspect that FROM use is overwritten with spaces and/or invisible characters, because I can't think of anything touching the code that replaces text here,

Off the top of my head I can't think of anything that would cause this text to be corrupted like this - the only processing that is done on the text is to split it on semi-colons.

I'll poke around and see if I can see anything that might be causing this.

@tehniemer
Copy link
Author

Any luck figuring this out?

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

No branches or pull requests

2 participants