Cloud-RF / tak-server

TAK Server docker setup
GNU General Public License v3.0
171 stars 59 forks source link

Support for TAK Server 4.10 #37

Closed ddscentral closed 7 months ago

ddscentral commented 1 year ago

This is more of a suggestion/advice than a bug report.

With a very minor change, I got TAK Server 4.10 to run using this script. The only change that was required is bumping OpenJDK version in "docker/\<architecture>/Dockerfile.takserver" from "openjdk:11-jdk-bullseye" to "openjdk:17-jdk-bullseye". tak.gov hasn't been yet updated with system requirements for version 4.10, but judging from the class version errors I get when attempting to run 4.10 on OpenJDK 11, the required Java version is now OpenJDK 17.

The only major problem I see with bumping the JDK version in Dockerfile is that you will likely need separate Dockerfiles to support older versions which still run on OpenJDK 11.

Alphalynxjet commented 1 year ago

Confirmed to work with this fix. Thanks!

km6lslf commented 1 year ago

I made the change you described, but I'm still getting this error when trying to use takserver-docker-4.10-RELEASE-12:

No joy with DB at ....***, will retry in 10s. If this loops more than 6 times go and get some fresh air... Error: LinkageError occurred while loading main class com.bbn.marti.UserManager java.lang.UnsupportedClassVersionError: com/bbn/marti/UserManager has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

I'm trying to run it in a clean Ubuntu 22.04 Desktop VM with only Docker installed. Any advice?

ddscentral commented 1 year ago

This means you still have JDK 11 in the container. There are two Dockerfiles, did you change the right one ?

km6lslf commented 1 year ago

I changed the one in the folder for AMD/x86 architecture.

Thank you, Bill Kreutinger - KM6SLF Chief Radio Officer & Technical Director - Tri-Cities RACES 949-391-2342

On Thu, Sep 7, 2023, 11:36 PM ddscentral @.***> wrote:

This means you still have JDK 11 in the container. There are two Dockerfiles, did you change the right one ?

— Reply to this email directly, view it on GitHub https://github.com/Cloud-RF/tak-server/issues/37#issuecomment-1711151713, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARKNSMX3NBVVXL3KUSZANDLXZK4FFANCNFSM6AAAAAA3VHEKOE . You are receiving this because you commented.Message ID: @.***>

Jachimo commented 1 year ago

@km6lslf I ran into this issue as well; it was caused by stale Docker images that still had the old version of Java in them. Apparently Docker is not smart enough to realize that the Dockerfile has been changed and re-pull things.

Try running the cleanup script (sudo ./scripts/cleanup.sh) and then run docker image list and see if you have entries for "tak-server-tak" and "tak-server-db" that are not new.

Delete them with docker image rm tak-server-tak and docker image rm tak-server-db.

Jachimo commented 1 year ago

I was able to get around the JDK 17 issue by modifying the Dockerfile, but 4.10 R12 is still failing a bit later on in the process with complaints about password authentication for the "martiuser" account. I guess the TAK gods must have decided that password authentication is disabled by default or something?

06:23:54.085 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
06:23:54.207 [main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "martiuser"
        at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:659)
        at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:180)
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247)
        at org.postgresql.Driver.makeConnection(Driver.java:434)
        at org.postgresql.Driver.connect(Driver.java:291)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
        at com.bbn.tak.schema.SchemaManager.configure(SchemaManager.java:327)
        at com.bbn.tak.schema.SchemaManager.processCommandLine(SchemaManager.java:266)
        at com.bbn.tak.schema.SchemaManager.main(SchemaManager.java:67)
06:23:54.207 [main] ERROR com.bbn.tak.schema.SchemaManager - Failed to initialize pool: FATAL: password authentication failed for user "martiuser" FATAL: password authentication failed for user "martiuser"

Suggestions appreciated on how to work around this... if I can get the scripts into a condition where 4.10 installs cleanly, I will be happy to put in a pull request with changes. I have a fork going with the changes needed so far.

ddscentral commented 1 year ago

Thanks for the advice regarding setup containers. I had no issues with the database, the install went through without issues. A build log would help, perhaps there's some error when setting the database password.

Jachimo commented 1 year ago

Build log is attached: installfail_2023-09-17.txt

The first error is around L475 and then it goes downhill from there until eventually I stop the process.

It happens repeatedly and does this every time. The only changes I have made to the install script were to replace openjdk:11 with openjdk:17,

Very interested in any help or suggestions anyone can provide! I'm kinda stumped at this point.

ddscentral commented 1 year ago

Database user/pass is generated by the database init script. From your logs, it appears this script was not run at all.

Jachimo commented 1 year ago

I figured it out... it's because the working directory I was using was cloned from my fork, and when cloning I named it "tak-server-setup" rather than "tak-server" (to keep it separate), and since Docker Compose uses the working directory as the project name if one isn't specified explicitly, the images it created weren't what other parts of the script expected. Whoops.

This also led me to discover why the cleanup script was leaving stale images around: cleanup.sh is looking for tak-server_db and tak-server_tak (the v1, docker-compose naming convention), and doesn't delete containers created with the newer v2 (docker compose) hyphen-based naming.

I'm not sure if this is necessarily consistent with best practices, but I don't love having the image names depend on the working directory name, so I just added image: tak-server_db and image: tak-server_tak to docker-compose.yml and that resolved both the DB initialization issue and also makes the cleanup.sh (and any other ancillary tools that might assume the v1 naming convention) work as-is.

KubaMiszcz commented 10 months ago

after update java11 to java17 in Dockerfile.takserver got this error: I got same error when i try to install it according to TAKserver manual here: https://tak-gov-webapp-assets.s3.us-gov-west-1.amazonaws.com/eajdv9ytmpkpb9uzim2g5um9fy82?response-content-disposition=inline%3B%20filename%3D%22TAK_Server_Configuration_Guide.pdf

Waiting for TAK server to go live. This should take <1m with an AMD64, ~2min on a ARM64 (Pi)
[+] Running 1/1
 ✔ Container tak-server-tak-1  Started                                                                                1.4s
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment (build 17.0.9+9-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.9+9-Debian-1deb11u1, mixed mode, sharing)
1usermanager usermod
java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at com.bbn.marti.takcl.cli.CommandCommon.invokeMethodFromModuleWithParams(CommandCommon.java:85)
        at com.bbn.marti.takcl.cli.advanced.AdvancedParamParser.execute(AdvancedParamParser.java:279)
        at com.bbn.marti.takcl.cli.advanced.AdvancedCliMainHelper.main(AdvancedCliMainHelper.java:127)
        at com.bbn.marti.UserManager.main(UserManager.java:61)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at com.bbn.marti.takcl.cli.CommandCommon.invokeMethodFromModuleWithParams(CommandCommon.java:52)
        ... 3 more
Caused by: class org.apache.ignite.IgniteException: Failed to find deployed service: distributed-user-file-manager
        at org.apache.ignite.internal.processors.service.GridServiceProxy.invokeMethod(GridServiceProxy.java:202)
        at org.apache.ignite.internal.processors.service.GridServiceProxy$ProxyInvocationHandler.invoke(GridServiceProxy.java:511)
        at jdk.proxy2/jdk.proxy2.$Proxy43.getUsers(Unknown Source)
        at com.bbn.marti.takcl.AppModules.OnlineFileAuthModule.innerUserCertMod(OnlineFileAuthModule.java:137)
        at com.bbn.marti.takcl.AppModules.OnlineFileAuthModule.usermod(OnlineFileAuthModule.java:91)
        ... 8 more
java.lang.reflect.InvocationTargetException
No joy with DB at 192.168.1.213, will retry in 10s. If this loops more than 6 times go and get some fresh air...
TechSully commented 10 months ago

Thank you for the comments. After updating java11 to java17 in Dockerfile.takserver, I was able to get the server running on Ubuntu 22. I have scoured the FAQ, PDFs and readme and cannot find out how to add/upload plugins (takserver-plugins) to 4.10?

TechSully commented 10 months ago

Thank you for the comments. After updating java11 to java17 in Dockerfile.takserver, I was able to get the server running on Ubuntu 22. I have scoured the FAQ, PDFs and readme and cannot find out how to add/upload plugins (takserver-plugins) to 4.10?

...added - I attempted to run the takserver script in /tak/launcher/takserver and the services failed to start (Failed to start... plugins.service not found). I'm a noob at this but will learn it.

Sorry for highjacking the thread - thanks to Cloud-RF for your efforts, they are greatly appreciated.

KubaMiszcz commented 9 months ago

I made the change you described, but I'm still getting this error when trying to use takserver-docker-4.10-RELEASE-12:

No joy with DB at ....***, will retry in 10s. If this loops more than 6 times go and get some fresh air... Error: LinkageError occurred while loading main class com.bbn.marti.UserManager java.lang.UnsupportedClassVersionError: com/bbn/marti/UserManager has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

I'm trying to run it in a clean Ubuntu 22.04 Desktop VM with only Docker installed. Any advice?

try to increase sleep to eg 360sec in setup.sh line 328, it helps me

FarrantAlex commented 7 months ago

Thanks for the feedback. We're testing 5.0 presently and will update this repo shortly.

FarrantAlex commented 7 months ago

Done