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

linux, replays, need proton/steamcmd love. also, need something extensible that's not hardcoded for other channels. what other channels though? #2586

Closed
jnorthrup opened this issue Feb 27, 2022 · 37 comments

Comments

@jnorthrup
Copy link

this appears to be an attempt to parse the executable using the shell.

given this is on ubuntu and not windows, there may be some proton magic required to perform a .cmd file +- protontricks 9420 shell with some drive letter normalization, or steamcmd which i am even less familiar with.

I am running this locally in intellij. If unifying the lobby/match and replay code is a good idea, I am happy to help. if it's not a good idea, more info about this is also greatly appreciated!

details below:

2022-02-27 15:41:17.097 INFO 11776 --- [onPool-worker-3] c.f.client.fa.ForgedAllianceService : Starting Forged Alliance with command: [%USER_PROFILE%/.faforever/bin/ForgedAlliance.exe, /init, init.lua, /nobugreport, /log, %USER_PROFILE%/.faforever/logs/, /replay, %USER_PROFILE%/.faforever/cache/temp.scfareplay, /replayid, 14167823] in directory: %USER_PROFILE%/.faforever/bin
2022-02-27 15:41:17.123 INFO 11776 --- [onPool-worker-3] com.faforever.client.game.GameService : Forged Alliance terminated with exit code 2
/home/jim/.faforever/bin/ForgedAlliance.exe: 1: MZ������@0������: not found
/home/jim/.faforever/bin/ForgedAlliance.exe: 1: Syntax error: word unexpected (expecting ")")

image

@jnorthrup jnorthrup added the bug label Feb 27, 2022
@jnorthrup
Copy link
Author

confirming preliminary success to the degree of my proton configuration, using:

protontricks-launch --appid 9420 ~/.faforever/bin/ForgedAlliance.exe /init init.lua /nobugreport /log ~/.faforever/logs/ /replay ~/.faforever/cache/temp.scfareplay /replayid 14167823

@Sheikah45
Copy link
Member

You can just add the prefix to the executable decorator in the client settings then it will run the game with whatever prefix commands you want.

@jnorthrup
Copy link
Author

there is no precedent for accessing the PROFILE strings or the decorators or how the settings would identify the need for linux decorator on init, and there are no other decorators to get any hints from.

i guess what I wrote is that each builder instance does the check if the config is blank. there are some imports from a previous streams filter in this first patch.

@jnorthrup jnorthrup changed the title linux, replays, need proton/steamcmd love. linux, replays, need proton/steamcmd love. also, need something extensible that's not hardcoded for other channels. what other channels though? Feb 27, 2022
@Angular-Angel
Copy link

So, I might be having the same issue? Or I might be having something completely different, I'm not sure. I can get into the FAF client, but when I try and launch an actual game, it immediately crashes, giving me:

2022-02-27 10:28:47.537  INFO 7450 --- [Thread-78] c.f.client.fa.ForgedAllianceService      : Starting Forged Alliance with command: [%USER_PROFILE%/.faforever/bin/FAFDebugger.exe, %USER_PROFILE%/.faforever/bin/ForgedAlliance.exe, /init, init.lua, /nobugreport, /log, %USER_PROFILE%/.faforever/logs/game_16454457.log, /gpgnet, 127.0.0.1:18545, /mean, 1500.0, /deviation, 500.0, /savereplay, gpgnet://127.0.0.1:46825/16454457/%USER%.SCFAreplay, /country, US, /numgames, 0, /numgames, 0] in directory: %USER_PROFILE%/.faforever/bin
2022-02-27 10:28:47.635  INFO 7450 --- [ForkJoinPool.commonPool-worker-3] com.faforever.client.game.GameService    : Forged Alliance terminated with exit code 2

And no game_###.log. I tried using the experimental debugger, as you can see, and it didn't help any. I'm on Xubuntu 20.4, using GraalCE17, and Vanilla FA runs just fine if I launch it with 'PROTON_NO_ESYNC=1 PROTON_NO_FSYNC=1 %command% /windowed 1024 758'.

Of note, it might not be the same issue, because I don't have:

/home/jim/.faforever/bin/ForgedAlliance.exe: 1: MZ������@0������: not found
/home/jim/.faforever/bin/ForgedAlliance.exe: 1: Syntax error: word unexpected (expecting ")")

Or anything like it in my logs - my game just crashes without any kind of notice. :/

@jnorthrup
Copy link
Author

jnorthrup commented Feb 27, 2022

you might not have bash, or might not have same selinux things, but it looks like its trying to run a .exe which hasn't worked in decades on linux (linux used to make an attempt, and also run java class files).

@jnorthrup
Copy link
Author

change "%s" to "protontricks-launch --appid 9420 %s" in your configs btw, assuming you can get protontricks on your path

@Angular-Angel
Copy link

I definitely have bash, that's how I run the FAF client. But, yeah, it seems the default commands don't run on my linux? Which is weird, I downloaded the linux client. And I think it's just passing the executable to something else, not calling it directly? I couldn't get the command to run properly when I tried copy=pasting it into terminal, it didn;t like all the commas. I'll try the protontricks thing though. :/

@Angular-Angel
Copy link

Well, that didn't work, but I got a neat new error! XD

NotifiableException(i18nKey=game.start.couldNotStart, i18nArgs=[])
	at com.faforever.client.game.GameService.lambda$startGame$35(GameService.java:594)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
	at com.faforever.client.fa.relay.ice.IceAdapterImpl.lambda$start$7(IceAdapterImpl.java:222)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Cannot run program "protontricks-launch" (in directory "/home/angle/.faforever/bin"): error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at com.faforever.client.fa.ForgedAllianceService.launch(ForgedAllianceService.java:144)
	at com.faforever.client.fa.ForgedAllianceService.startGameOnline(ForgedAllianceService.java:82)
	at com.faforever.client.game.GameService.lambda$startGame$35(GameService.java:591)
	... 5 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 9 more

@Angular-Angel
Copy link

I can also confirm that protontricks is on my path, if I run just 'protontricks' in a new terminal, it spits out the help screen.

@jnorthrup
Copy link
Author

protontrisk-launch is ... i donnuo where i got it..;.

jim@okmijnhub:$ which protontricks-
protontricks-desktop-install protontricks-launch
jim@okmijnhub:
$ which protontricks-launch
/home/jim/.local/bin/protontricks-launch

@Angular-Angel
Copy link

Angular-Angel commented Feb 27, 2022

'protontricks-launch' is also on the path, it works in a terminal:

(base) angle@Sager:~/.faforever/bin$ protontricks-launch
usage: protontricks-launch [-h] [--no-term] [--verbose] [--no-runtime]
                           [--no-bwrap] [--appid [APPID]]
                           executable ...

Utility for launching Windows executables using Protontricks

Usage:
(base) angle@Sager:~/.faforever/bin$ which protontricks-launch
/home/angle/.local/bin/protontricks-launch

@jnorthrup
Copy link
Author

i was told that it should be in the configs but i sent a PR instead. wfm. i did not actually try the advice i gave you first

@jnorthrup
Copy link
Author

your latest error dump does not print the whole array.
quotes seem suspect.

@jnorthrup
Copy link
Author

jnorthrup commented Feb 27, 2022

in the java code, i prepend "protontricks-launch --appid 9420 " to "\"%s\""

@jnorthrup
Copy link
Author

i have also only been testing with replays though im sure that bash won't parse an exe file.

@Angular-Angel
Copy link

Hmm, yeah maybe I'm screwing the quotes up? I tried adding a pair of double quotes around it, and got:

Client Version: 2022.2.0
NotifiableException(i18nKey=game.start.couldNotStart, i18nArgs=[])
	at com.faforever.client.game.GameService.lambda$startGame$35(GameService.java:594)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
	at com.faforever.client.fa.relay.ice.IceAdapterImpl.lambda$start$7(IceAdapterImpl.java:222)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Cannot run program "protontricks-launch --appid 9420 " (in directory "/home/angle/.faforever/bin"): error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at com.faforever.client.fa.ForgedAllianceService.launch(ForgedAllianceService.java:144)
	at com.faforever.client.fa.ForgedAllianceService.startGameOnline(ForgedAllianceService.java:82)
	at com.faforever.client.game.GameService.lambda$startGame$35(GameService.java:591)
	... 5 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 9 more

@jnorthrup
Copy link
Author

i just entered this and ran a replay i have locally and it worked

image

@Angular-Angel
Copy link

Nope, I already tried that, no such luck. Maybe it can't find the directory for some reason? I can find it in file manager, but maybe there's an issue with permissions somewhere or something? :/

@Angular-Angel
Copy link

Though, I am trying to run the game, not watch a replay, so maybe that's the issue? :/

@jnorthrup
Copy link
Author

i don't personally trust flatpack, but it documents workarounds.

make sure things in your path have export in bashrc

export PATH=$PATH:/home/jim/.konan/kotlin-native-prebuilt-linux-x86_64-1.6.0-RC/bin:~/.local/bin:/usr/local/bin

@Angular-Angel
Copy link

...Do I need to install Konan first, or something? :/

@jnorthrup
Copy link
Author

nonono that's just where i found the ~/.local/bin/

@jnorthrup
Copy link
Author

my total path is about 20 lines of console
echo $PATH |wc -c
2974

@jnorthrup
Copy link
Author

:/home/jim/.local/bin:/usr/local/bin
is the end of the path fwiw.

@Angular-Angel
Copy link

Hmm, I tried adding that to my profile? I'll try restarting my computer and see if it helps. XD

@jnorthrup
Copy link
Author

i attempted a replay with
image

result
image

@jnorthrup
Copy link
Author

if you lack winetricks protontricks does not succeed

@Angular-Angel
Copy link

Well I definitely have winetricks. When I tried running the game now though, I got a rather different appearance - I got a windows style window saying fatal error, containing:

Failed to setup initial search path.

Program : Z:\home\angle\.faforever\bin\ForgedAlliance.exe
Cmd line arguments : / /init init.lua /nobugreport /log /home/angle/.faforever/logs/game_7347164.log /replay /home/angle/.faforever/cache/temp.scfareplay /replayid 7347164

Callstack:
    unavailable.

Last 100 lines of log...

warning: Running "Z:\home\angle\.faforever\bin\init.lua" failed: cannot read init_faf.lua: No such file or directory
         stack traceback:
         	[C]: in function `dofile'
         	Z:\home\angle\.faforever\bin\init.lua(1): in main chunk

I was able to look up said 'init.lua' file, I can confirm that it does, actually, exist. :/

@jnorthrup
Copy link
Author

it took some fishing for this log entry but i joined a lobby with success

2022-02-28 02:36:42.049 INFO 54466 --- [ Thread-137] c.f.client.fa.ForgedAllianceService : Starting Forged Alliance with command: [protontricks-launch, --appid, 9420, %USER_PROFILE%/.faforever/bin/ForgedAlliance.exe, /init, init.lua, /nobugreport, /log, %USER_PROFILE%/.faforever/logs/game_16454915.log, /gpgnet, 127.0.0.1:4968, /mean, 1118.57, /deviation, 81.2442, /savereplay, gpgnet://127.0.0.1:35713/16454915/Zentrodi.SCFAreplay, /country, ID, /numgames, 455, /numgames, 427] in directory: %USER_PROFILE%/.faforever/bin
2022-02-28 02:36:42.105 DEBUG 54466 --- [tor-tcp-epoll-1] com.faforever.commons.lobby.FafLobbyApi : Inbound message: {"command":"ice_servers","ice_servers":[{"urls":["turn:coturn-eu-1.supcomhub.org?transport=tcp","turn:coturn-eu-1.supcomhub.org?transport=udp","stun:coturn-eu-1.supcomhub.org"],"username":"1646073401:96452","credential":"EKDBMYQBwmjrqB8sc9EWZSu2rW8=","credentialType":"token"},{"urls":["turn:faforever.com?transport=tcp","turn:faforever.com?transport=udp","stun:faforever.com"],"username":"1646073401:96452","credential":"EKDBMYQBwmjrqB8sc9EWZSu2rW8=","credentialType":"token"},{"urls":["turn:faf.mabula.net?transport=tcp","turn:faf.mabula.net?transport=udp","stun:faf.mabula.net"],"username":"1646073401:96452","credential":"st5JA4Luh7rYfwYuooJhhpAjJMM=","credentialType":"token"}],"ttl":86400}

@Angular-Angel
Copy link

Well, I amanged to get an actual gamer error log. Pretty short:

warning: Running "Z:\home\%USER%\.faforever\bin\init.lua" failed: cannot read init_faf.lua: No such file or directory
         stack traceback:
         	[C]: in function `dofile'
         	Z:\home\%USER%\.faforever\bin\init.lua(1): in main chunk

Not sure what's up with the 'Z:' at the start there. That might be wine or proton doing some compatibility thing? Or it might be the source of the problem, I'm not sure. :/

@jnorthrup
Copy link
Author

im running ubuntu on liquorix right now, almost fresh install, steam is always first validation test.

im running proton experimental, it seems like a whole other vintage from Z; drive mentions.

@jnorthrup
Copy link
Author

have you gone to protondb lately? its not profound, but the fa page has some pretty consistent non-faf run throughs

@Angular-Angel
Copy link

Yeah, I followed those and they got it running in normal FA just fine. But they don't seem help me here. And I had different problems with normal FA, it would run, just laggy, until I followed the advice from protondb. :/

@jnorthrup
Copy link
Author

you should be able to launch protontricks-launch --appid 9420 ~/.faforever/bin/blahblabha

this would give you a new perspective on the path related issue

@Angular-Angel
Copy link

Okay, so I found: 'https://gist.github.com/Yoslincake/ddfa6f3f1aedfb6faa5f17ddd7d12f28' which has lots of novel instructions. Gonna see if I can figure it out, and get back to you. :/

Also, pretty sure my problem here is different from what yours was, so I should probably make my own issue, I'll do that too. :X

@jnorthrup
Copy link
Author

that was the first set of instructions i used which got me seeing bash parsing the exe on ubuntu 22.10

$SHELL --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

@jnorthrup
Copy link
Author

jnorthrup commented Feb 28, 2022

closing as culturally unresolvable, awaiting a J2EE+EJB+Spring "Backend" specialist.

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

Successfully merging a pull request may close this issue.

3 participants