Closed Osiris-Team closed 3 months ago
Looks like this issue was not caused by jansi but another dependency I have that was crashing, thus sending a crash signal to the web-panel that was running my jar and thus aborting the self-updating process.
And the actual issue itself still happens, and I just now noticed that the self-updating only works if the jar is run via a start script that ends with "pause" which prevents the actual terminal and jar from fighting for the user input.
Not sure if this is a jansi issue, but the only thing log/console related that I updated recently was jansi (2.4.1 -> current master). TODO create a simple test-case to reproduce this issue.
Its a bit complicated so bear with me, I'll try to explain it as simply as I can.
So my application is able to update itself automatically by doing the following steps:
This worked perfectly in regular windows and linux terminals until recently. Now something really weird happens, as you can see in the attached log. After current.jar launches the ./downloads/new.jar and exits, the terminal input is lost (meaning the user cannot input commands anymore), but the output is still printed to the terminal.
You can see where this happens, namely in this line:
PS D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER>
To increase to the confusion it seems that the shell and jar are fighting over reading the user input, so some characters sometimes get read by the application and sometimes by the shell itself.
Any ideas?
Show log
``` PS D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER> java -jar .\AutoPlug-Client.jar Initialising AutoPlug-Client 8.2.6 [29-07-2024 22:05:30][AP][DEBUG][AL] Started Logger(AP) [29-07-2024 22:05:30][AP][DEBUG][Main] !!!IMPORTANT!!! -> THIS LOG-FILE CONTAINS SENSITIVE INFORMATION <- !!!IMPORTANT!!! [29-07-2024 22:05:30][AP][DEBUG][Main] !!!IMPORTANT!!! -> THIS LOG-FILE CONTAINS SENSITIVE INFORMATION <- !!!IMPORTANT!!! [29-07-2024 22:05:30][AP][DEBUG][Main] !!!IMPORTANT!!! -> THIS LOG-FILE CONTAINS SENSITIVE INFORMATION <- !!!IMPORTANT!!! [29-07-2024 22:05:31][AP][DEBUG][Main] START COMMAND: null [29-07-2024 22:05:31][AP][DEBUG][Main] JAR: D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER\AutoPlug-Client.jar [29-07-2024 22:05:31][AP][DEBUG][Main] ARGS: [] [29-07-2024 22:05:31][AP][DEBUG][Main] SYSTEM OS: Windows 11 [29-07-2024 22:05:31][AP][DEBUG][Main] SYSTEM OS ARCH: amd64 [29-07-2024 22:05:31][AP][DEBUG][Main] SYSTEM VERSION: 10.0 [29-07-2024 22:05:31][AP][DEBUG][Main] JAVA VERSION: 21.0.3 [29-07-2024 22:05:31][AP][DEBUG][Main] JAVA VENDOR: Eclipse Adoptium https://adoptium.net/ [29-07-2024 22:05:31][AP][DEBUG][Main] JAVA DIR: C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot [29-07-2024 22:05:31][AP][DEBUG][Main] WORKING DIR: D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER [29-07-2024 22:05:31][AP][DEBUG][Main] TEST-MODE: false [29-07-2024 22:05:31][AP][INFO] | ------------------------------------------- | [29-07-2024 22:05:31][AP][INFO] ___ __ ___ __ [29-07-2024 22:05:31][AP][INFO] / _ |__ __/ /____ / _ \/ /_ _____ _ [29-07-2024 22:05:31][AP][INFO] / __ / // / __/ _ \/ ___/ / // / _ `/ [29-07-2024 22:05:31][AP][INFO] /_/ |_\_,_/\__/\___/_/ /_/\_,_/\_, / [29-07-2024 22:05:31][AP][INFO] /___/ [29-07-2024 22:05:31][AP][INFO] AutoPlug-Client 8.2.6 by Osiris-Team [29-07-2024 22:05:31][AP][INFO] Web-Panel: https://autoplug.one/ [29-07-2024 22:05:31][AP][INFO] | ------------------------------------------- | [29-07-2024 22:05:31][AP][INFO] Initialised successfully. [29-07-2024 22:05:31][AP][INFO] | ------------------------------------------- | [29-07-2024 22:05:37][AP][DEBUG][TaskDownload] Downloading AutoPlug-Client.jar from: https://github.com/Osiris-Team/AutoPlug-Releases/raw/master/beta-builds/AutoPlug-Client.jar [29-07-2024 22:05:41][AP][INFO] [TASK] [\] > [SelfUpdater] Update found (8.2.6 -> 8.2.7), started download! [29-07-2024 22:05:41][AP][INFO] [TASK] [|] > [Downloader][58%] Downloading AutoPlug-Client.jar... (10mb/17mb) [29-07-2024 22:05:41][AP][INFO] [29-07-2024 22:05:44][AP][DEBUG][TaskDownload] Comparing hashes (SHA-256). Is equal? true Excepted: "0838ad01f3f4b77d04ca748a09cc6e495517330b487ef30759434836967c773d" Actual: "0838ad01f3f4b77d04ca748a09cc6e495517330b487ef30759434836967c773d" Starting jar with: [C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot\bin\java, -jar, D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER\autoplug\downloads\AutoPlug-Client.jar] [29-07-2024 22:05:44][AP][INFO] See you soon! [29-07-2024 22:05:44][AP][DEBUG][AL] Stopped AP [29-07-2024 22:05:44][AP][INFO] SSH Server is not running! Initialising AutoPlug-Client 8.2.7 Installing update for jar file: 'D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER\AutoPlug-Client.jar'... PS D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER> Old jar is not in use. Installing update... Successfully installed update! Starting jar with: [C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot\bin\java, -jar, D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER\AutoPlug-Client.jar] Initialising AutoPlug-Client 8.2.7 [29-07-2024 22:05:45][AP][DEBUG][AL] Started Logger(AP) [29-07-2024 22:05:45][AP][DEBUG][Main] !!!IMPORTANT!!! -> THIS LOG-FILE CONTAINS SENSITIVE INFORMATION <- !!!IMPORTANT!!! [29-07-2024 22:05:45][AP][DEBUG][Main] !!!IMPORTANT!!! -> THIS LOG-FILE CONTAINS SENSITIVE INFORMATION <- !!!IMPORTANT!!! [29-07-2024 22:05:45][AP][DEBUG][Main] !!!IMPORTANT!!! -> THIS LOG-FILE CONTAINS SENSITIVE INFORMATION <- !!!IMPORTANT!!! [29-07-2024 22:05:45][AP][DEBUG][Main] START COMMAND: null [29-07-2024 22:05:45][AP][DEBUG][Main] JAR: D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER\AutoPlug-Client.jar [29-07-2024 22:05:45][AP][DEBUG][Main] ARGS: [] [29-07-2024 22:05:45][AP][DEBUG][Main] SYSTEM OS: Windows 11 [29-07-2024 22:05:45][AP][DEBUG][Main] SYSTEM OS ARCH: amd64 [29-07-2024 22:05:45][AP][DEBUG][Main] SYSTEM VERSION: 10.0 [29-07-2024 22:05:45][AP][DEBUG][Main] JAVA VERSION: 21.0.3 [29-07-2024 22:05:45][AP][DEBUG][Main] JAVA VENDOR: Eclipse Adoptium https://adoptium.net/ [29-07-2024 22:05:45][AP][DEBUG][Main] JAVA DIR: C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot [29-07-2024 22:05:45][AP][DEBUG][Main] WORKING DIR: D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER [29-07-2024 22:05:45][AP][DEBUG][Main] TEST-MODE: false [29-07-2024 22:05:45][AP][INFO] | ------------------------------------------- | [29-07-2024 22:05:45][AP][INFO] ___ __ ___ __ [29-07-2024 22:05:45][AP][INFO] / _ |__ __/ /____ / _ \/ /_ _____ _ [29-07-2024 22:05:45][AP][INFO] / __ / // / __/ _ \/ ___/ / // / _ `/ [29-07-2024 22:05:45][AP][INFO] /_/ |_\_,_/\__/\___/_/ /_/\_,_/\_, / [29-07-2024 22:05:45][AP][INFO] /___/ [29-07-2024 22:05:45][AP][INFO] AutoPlug-Client 8.2.7 by Osiris-Team [29-07-2024 22:05:45][AP][INFO] Web-Panel: https://autoplug.one/ [29-07-2024 22:05:45][AP][INFO] | ------------------------------------------- | [29-07-2024 22:51:48][AP][INFO] Authenticating server... [29-07-2024 22:51:48][AP][DEBUG][ConMain] open() [29-07-2024 22:51:48][AP][DEBUG][ConMain] _close() [29-07-2024 22:51:48][AP][DEBUG][ConMain] [CON_TYPE: 0] Connecting to AutoPlug-Web (localhost:35555)... [29-07-2024 22:51:48][AP][WARN] Creating unencrypted connection, transmitted data can be read by a third-party. [29-07-2024 22:51:48][AP][WARN] Connection refused: connect [29-07-2024 22:51:48][AP][INFO] Authenticating server... [29-07-2024 22:51:48][AP][DEBUG][ConMain] open() [29-07-2024 22:51:48][AP][DEBUG][ConMain] _close() [29-07-2024 22:51:48][AP][DEBUG][ConMain] [CON_TYPE: 0] Connecting to AutoPlug-Web (localhost:35555)... [29-07-2024 22:51:48][AP][WARN] Creating unencrypted connection, transmitted data can be read by a third-party. [29-07-2024 22:51:48][AP][DEBUG][ConMain] _close() [29-07-2024 22:51:48][AP][WARN] Connection problems! Reconnecting in 30 seconds... Details: Connection refused: connect PS D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER> elp [29-07-2024 22:51:54][AP][WARN] Failed to submit command 'hp' because server is not running! Use '.start' to start the server. D el:gJtPulATStlliDiJAolletASStPlin.uoCet h el:gJtPulATStlliDiJAolletASStPlin.elp [29-07-2024 22:51:58][AP][WARN] Failed to submit command 'hp' because server is not running! Use '.start' to start the server. h [29-07-2024 22:51:59][AP][WARN] Failed to submit command 'h' because server is not running! Use '.start' to start the server. h el:gJtPulATStlliDiJAolletASStPlin.elelp [29-07-2024 22:52:01][AP][WARN] Failed to submit command 'hlp' because server is not running! Use '.start' to start the server. el:gJtPulATStlliDiJAolletASStPlin.elehelp el:gJtPulATStlliDiJAolletASStPlin.elehelp : Die Benennung "el:gJtPulATStlliDiJAolletASStPlin.elehelp" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang. In Zeile:1 Zeichen:1 + el:gJtPulATStlliDiJAolletASStPlin.elehelp + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (el:gJtPulATStll...SStPlin.elehelp:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS D:\Coding\JAVA\AutoPlug-Client\AP-TEST-SERVER> ```