haberda / signal-addon

Signal addon docker files
10 stars 7 forks source link

can run this docker image on arm64 #46

Closed malfino closed 2 years ago

malfino commented 2 years ago

Hi, I installed this docker image through home assistant on my raspberry pi 4 with ubuntu (arm64). When I check the /var/log/signal-cli-json-rpc-1/out.log

it says:


OpenJDK Server VM warning: You have loaded library /tmp/sqlite-3.36.0.3-ac8623a3-aee1-4fa5-a340-971b59c6f6be-libsqlitejdbc.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'.
Failed to load native library:sqlite-3.36.0.3-ac8623a3-aee1-4fa5-a340-971b59c6f6be-libsqlitejdbc.so. osinfo: Linux/aarch64
java.lang.UnsatisfiedLinkError: /tmp/sqlite-3.36.0.3-ac8623a3-aee1-4fa5-a340-971b59c6f6be-libsqlitejdbc.so: /tmp/sqlite-3.36.0.3-ac8623a3-aee1-4fa5-a340-971b59c6f6be-libsqlitejdbc.so: wrong E
LF class: ELFCLASS64 (Possible cause: can't load AARCH64 .so on a ARM platform)
ERROR HikariPool - HikariPool-1 - Exception during pool initialization.
java.sql.SQLException: Error opening connection
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:244)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21)
        at org.sqlite.JDBC.createConnection(JDBC.java:115)
        at org.sqlite.JDBC.connect(JDBC.java:90)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
        at org.asamk.signal.manager.storage.Database.getHikariDataSource(Database.java:94)
        at org.asamk.signal.manager.storage.Database.initDatabase(Database.java:32)
        at org.asamk.signal.manager.storage.AccountDatabase.init(AccountDatabase.java:23)
        at org.asamk.signal.manager.storage.SignalAccount.lambda$getAccountDatabase$21(SignalAccount.java:1062)
        at org.asamk.signal.manager.storage.SignalAccount.getOrCreate(SignalAccount.java:1348)
        at org.asamk.signal.manager.storage.SignalAccount.getAccountDatabase(SignalAccount.java:1060)
        at org.asamk.signal.manager.storage.SignalAccount.initDatabase(SignalAccount.java:263)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:88)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:64)
        at org.asamk.signal.App.loadManager(App.java:337)
        at org.asamk.signal.App.handleLocalCommand(App.java:272)
        at org.asamk.signal.App.init(App.java:213)
        at org.asamk.signal.Main.main(Main.java:58)
Caused by: java.lang.Exception: No native library found for os.name=Linux, os.arch=aarch64, paths=[/org/sqlite/native/Linux/aarch64:/usr/java/packages/lib:/lib:/usr/lib]
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:389)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68)
        at org.sqlite.core.NativeDB.load(NativeDB.java:63)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:240)
        ... 25 common frames omitted
Error loading state file for user +4xxxxxxx: Failed to initialize pool: Error opening connection (PoolInitializationException)
OpenJDK Server VM warning: You have loaded library /tmp/sqlite-3.36.0.3-16d91112-4326-4d6d-be79-bb44fa1805bb-libsqlitejdbc.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'.
Failed to load native library:sqlite-3.36.0.3-16d91112-4326-4d6d-be79-bb44fa1805bb-libsqlitejdbc.so. osinfo: Linux/aarch64
java.lang.UnsatisfiedLinkError: /tmp/sqlite-3.36.0.3-16d91112-4326-4d6d-be79-bb44fa1805bb-libsqlitejdbc.so: /tmp/sqlite-3.36.0.3-16d91112-4326-4d6d-be79-bb44fa1805bb-libsqlitejdbc.so: wrong E
LF class: ELFCLASS64 (Possible cause: can't load AARCH64 .so on a ARM platform)
ERROR HikariPool - HikariPool-1 - Exception during pool initialization.
java.sql.SQLException: Error opening connection
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:244)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21)
        at org.sqlite.JDBC.createConnection(JDBC.java:115)
        at org.sqlite.JDBC.connect(JDBC.java:90)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:100)
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
        at org.asamk.signal.manager.storage.Database.getHikariDataSource(Database.java:94)
        at org.asamk.signal.manager.storage.Database.initDatabase(Database.java:32)
        at org.asamk.signal.manager.storage.AccountDatabase.init(AccountDatabase.java:23)
        at org.asamk.signal.manager.storage.SignalAccount.lambda$getAccountDatabase$21(SignalAccount.java:1062)
        at org.asamk.signal.manager.storage.SignalAccount.getOrCreate(SignalAccount.java:1348)
        at org.asamk.signal.manager.storage.SignalAccount.getAccountDatabase(SignalAccount.java:1060)
        at org.asamk.signal.manager.storage.SignalAccount.initDatabase(SignalAccount.java:263)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:88)
        at org.asamk.signal.manager.SignalAccountFiles.initManager(SignalAccountFiles.java:64)
        at org.asamk.signal.App.loadManager(App.java:337)
        at org.asamk.signal.App.handleLocalCommand(App.java:272)
        at org.asamk.signal.App.init(App.java:213)
        at org.asamk.signal.Main.main(Main.java:58)
Caused by: java.lang.Exception: No native library found for os.name=Linux, os.arch=aarch64, paths=[/org/sqlite/native/Linux/aarch64:/usr/java/packages/lib:/lib:/usr/lib]
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:389)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68)
        at org.sqlite.core.NativeDB.load(NativeDB.java:63)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:240)
        ... 25 common frames omitted
Error loading state file for user +4xxxxxxxx: Failed to initialize pool: Error opening connection (PoolInitializationException)

Is there an easy way to fix this?

haberda commented 2 years ago

Hello, from the log Possible cause: can't load AARCH64 .so on a ARM platform it looks like you are not running ARM64. For the record, I run this just fine on a Pi4 ARM64 on HASSOS. uname -m in the console should print out what architecture you are running.

However, if there is some underlying issue, the upstream container is where the problem would lie. I simply take the upstream and change some environment variables to work with Home Assistant. It also might be worth just running the upstream directly on Docker rather than the add-on, since you are running Ubuntu anyway.

haberda commented 2 years ago

One other thing, I don't think Native mode works for ARM64. You have to run the normal mode, or maybe json-rpc. From the log it looks like you're trying to run native.

malfino commented 2 years ago

Thank you for your reply. I guess that I'm also on arm64. If I ran uname -m in the docker container, it says

signal-api@1315902c-signal-messenger:/var/log/signal-cli-json-rpc-1$ uname -m
aarch64

The settings in homeassistant sa json-rpc.

I don't hink it is related to running it in normal mode.

OpenJDK Server VM warning: You have loaded library /tmp/sqlite-3.36.0.3-1495367d-8e7d-4b3e-954e-7211a4236025-libsqlitejdbc.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 ', or link it with '-z noexecstack'. Failed to load native library:sqlite-3.36.0.3-1495367d-8e7d-4b3e-954e-7211a4236025-libsqlitejdbc.so. osinfo: Linux/aarch64 java.lang.UnsatisfiedLinkError: /tmp/sqlite-3.36.0.3-1495367d-8e7d-4b3e-954e-7211a4236025-libsqlitejdbc.so: /tmp/sqlite-3.36.0.3-1495367d-8e7d-4b3e-954e-7211a4236025-libsqlitejdbc.so: wrong ELF class: ELFCLASS64 (Possible cause: can't load AARCH64 .so on a ARM platform)

The libsqlitejdcbc.so seems to be the problem, don't you think?

But you are right, I will file this ticket on upstream...

haberda commented 2 years ago

I'd suggest trying uname -m on the host, rather than in the container.

Regardless, see if you can run the upstream container directly in docker. If it works fine, then maybe I can do something on my end. If not then it's an upstream issue.

malfino commented 2 years ago

I installed an upstream docker image directly in docker and it works fine. It's a weird bug. But for now, I'm happy, that I can use it again.

github-actions[bot] commented 2 years ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!