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

Ubuntu can't find steamcmd command #8

Closed
sumpurnis opened this issue Jan 13, 2022 · 14 comments
Closed

Ubuntu can't find steamcmd command #8

sumpurnis opened this issue Jan 13, 2022 · 14 comments

Comments

@sumpurnis
Copy link

Ran into this issue while trying to run the dztui:
Selection: 1 [INFO] Verifying integrity of server modlist manifest [7/7] [ERROR] Missing mods. Invoking steamcmd for user zivs [INFO] Found steamcmd user. Downloading mods sudo: steamcmd: command not found

The thing is, steamcmd is installed, I can log in into it, but the script refuses to find the command? script is chmoded to +x and ran with ./dztui.sh
Not very familiar with linux scripts and stuff like that, therefore, maybe I do something completely wrong or skip some steps absolutely? Where should I look into or what info to give extra, to solve this mistery?

Ubuntu:
Distributor ID: Ubuntu
Description: Ubuntu 21.10
Release: 21.10
Codename: impish
All the required packages are installed and up to date.

Thanks in advance!

@sumpurnis
Copy link
Author

When running steamcmd as non-root (and creating user called steam), logging into it and running the script again, got basically the same error message:
Selection: 1
[INFO] Verifying integrity of server modlist manifest [7/7]
[ERROR] Missing mods. Invoking steamcmd for user steam
[ERROR] steamcmd not found. See: https://developer.valvesoftware.com/wiki/SteamCMD
[ERROR] Missing mods. Open these links and subscribe to each one, then reconnect

@aclist
Copy link
Owner

aclist commented Jan 14, 2022

Thanks for the report. I think I have a fix for you:

  1. Go to line 174 of the script
  2. Replace command -v steamcmd &>/dev/null with sudo -u $steamcmd_user bash -c 'command -v steamcmd &>/dev/null'
  3. Try running it again.

This should work. If it does, I will push this hotfix into the script.

@sumpurnis
Copy link
Author

sumpurnis commented Jan 15, 2022

Probably doing something wrong (still), but after changing 174 line to what you mentioned, it gives pretty much the same error:
[INFO] Verifying integrity of server modlist manifest [7/7]
[ERROR] Missing mods. Invoking steamcmd for user steam
[ERROR] steamcmd not found. See: https://developer.valvesoftware.com/wiki/SteamCMD
[ERROR] Missing mods. Open these links and subscribe to each one, then reconnect

174 line now looks like this: sudo -u $steamcmd_user bash -c 'command -v steamcmd &>/dev/null'

I could post whole script, but the only changes made there is beforementioned line and config section by adding random servers, adding steam account name and API key:
#BEGIN CONFIG================
steam_path="/home/zivs/.steam/steam"
workshop_dir="$steam_path/steamapps/workshop/content/$aid"
game_dir="$steam_path/steamapps/common/DayZ"
key="the_key_is_here_just_hidden_right_now
whitelist="8041087,12754581"
fav="8041087"
name="zivs"
separator="│"
ping=1
debug=0
#END CONFIG================

P.S.
Script keeps saying that I am missing mods, but when listing them - script shows them all to be in place. This probably is also an issue?

@aclist
Copy link
Owner

aclist commented Jan 16, 2022

Could you tell me:

  • How you installed steamcmd? Was it via an Ubuntu repository?
  • What is the path where steamcmd is located? Is it /usr/bin/, or somewhere else?
  • If it's somewhere else (nonstandard location), has that been added to your $PATH in e.g. .bashrc?
  • Was steamcmd installed globally for all users, or does only the steam user have access to it?

As your regular user, could you run command -v steamcmd and report the output?

Then, can you switch to the steam user (sudo su steam) and run command -v steamcmd again and report the output?

As for the second issue (missing mods), the mod IDs located in workshop_dir must match the mod IDs reported by the server. Is the server you are trying to connect to 12754581?

Its mod list is:

2657894867
2116157322
2572331007
1828439124
1564026768
2545327648
1559212036

Your $steam_path/steamapps/workshp/content/221100 must contain 7 directories (mods) with those IDs. Do you have all of those?

Anyway, I think it'd be best to resolve the steamcmd issue first before attacking this other question, since there's a slight chance of a problem in the control flow.

I'm planning to add a logging functionality in the next release so that users can send a full debug log with relevant info when they have a problem.

@sumpurnis
Copy link
Author

Could you tell me:

How you installed steamcmd? Was it via an Ubuntu repository? - Simply by adding it via terminal (from standard Ubuntu repositories - apt-get install steamcmd

What is the path where steamcmd is located? Is it /usr/bin/, or somewhere else? I can't find anything stea* related files under /usr/bin and my knowledge on Linux is not that great (still learning to use it) to effectively find it where it lies.. :(

If it's somewhere else (nonstandard location), has that been added to your $PATH in e.g. .bashrc? I haven't changed anything on system installation - all is pretty much standard and installs where it wants to. I don't try to alter anything, since I'm not sure if that will break something or not.

Was steamcmd installed globally for all users, or does only the steam user have access to it? Installed it as a root and that's about all I know to say. How can I check it?

Your $steam_path/steamapps/workshp/content/221100 must contain 7 directories (mods) with those IDs. Do you have all of those? I have them (manually subscribed and updated game when error was thrown out about missing all of them. Also script shows that I have them.

Sorry for all this hassle - Used to windows next-next-finish stuff and now anything what goes into scripts, causes me small panic attacks..

@aclist
Copy link
Owner

aclist commented Jan 17, 2022

It's no hassle. I'm happy to help you. A similar issue was reported by another Ubuntu user, and after looking into it (https://packages.ubuntu.com/focal/i386/steamcmd/filelist), it seems that Ubuntu installs the program to /usr/games/steamcmd, which is nonstandard.

As your normal user, try running command -v steamcmd. What does it report? If it reports nothing, this /usr/games is not part of your $PATH, so the system can't see it.

If that happens, for starters, run echo $PATH and post the output here.

To clarify, the PATH environment variable is used to tell bash where to look for all the installed programs. It's possible that this /usr/games location is not being seen by the system.

@sumpurnis
Copy link
Author

As your normal user, try running command -v steamcmd. What does it report? If it reports nothing, this /usr/games is not part of your $PATH, so the system can't see it.
command -v steamcmd givrs this:
/usr/games/steamcmd

If that happens, for starters, run echo $PATH and post the output here. Just in case, here's the output:
echo $PATH gives this:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

@aclist
Copy link
Owner

aclist commented Jan 19, 2022

OK, good news: I set up an Ubuntu virtual machine and was able to reproduce and fix the issue.

I'm going to include some other miscellaneous fixes in the next release, so it'll be 1-2 days until it's ready. Once it's online, I'll send you an update here.

@sumpurnis
Copy link
Author

Thanks for all the effort you've put into this issue! Really appreciate that! <3

@aclist
Copy link
Owner

aclist commented Jan 20, 2022

Okay, the update is live.

Thanks for reporting it. I knew that there was something vaguely wrong there, but wasn't able to identify it until your patient and detailed report. It's not an issue limited to Ubuntu per se, but the command being used to call steamcmd was malformed in some scenarios.

The main fixes for this minor version (0.3.0) are:

  • Fix malformed steamcmd invocation
  • Better handling of mod list comparison to prevent false positives (related to the other issue you reported)
  • Test for up to date version of column package for Ubuntu and other distros (this probably affected you originally, but it seems you found a way to install column yourself)
  • Add cleaner signal interrupt handling if user forces quit with ctrl-c
  • Handle moving of mod directories better in case the move occurs between different devices
  • Check upstream version of script for updates

Still to come: detailed changelogs, standalone releases on GitHub

With the last fix, the script will now notify you if there is a new version available to download (but not download it for you). This is forwards-compatible with future versions, so you shouldn't miss any future bug fixes.

Please test the original problem and let me know if it's working correctly, at which point I will close this issue.

@sumpurnis
Copy link
Author

sumpurnis commented Jan 25, 2022

Now everything goes as far as to open Windows version of Steam (emulated under wine) instead of the one I actually use - Linux native with proton support. Should I uninstall Windows version or that won't fix the problem?

sudo su ./dztui.sh gives following errors:
INFO] Verifying integrity of server modlist manifest [10/10]
[INFO] Mod check passed
awk: fatal: cannot open file /home/zivs/.steam/steam/steamapps/workshop/content/221100/1869442369/meta.cpp for reading: No such file or directory
awk: fatal: cannot open file /home/zivs/.steam/steam/steamapps/workshop/content/221100/1869442369/meta.cpp for reading: No such file or directory
[INFO] Connecting to: dSmile DayZ Namalsk EU/LV | Latvija | Regular 3PP 89.201.7.209:2414
./dztui.sh: line 154: steam: command not found

If running as root #./dztui.sh I get Windows steam with error pop-up saying "An error ocurred while updating DayZ (invalid platform)" - I haven't installed DayZ on that version (or any games whatsoever. I have no idea why I still keep that version on my PC at all).

EDIT:
For some reason I was trying to run it as a root - Can connect to servers and game by going as a regular user ./dztui.sh (firstly had to chmod +x that file). Will play around with it now and then give some updates on how things work out!

EDIT #2:
Everything works perfectly!

Thanks you for your enormous effort in fixing these issues! Greatly appreciated!

@aclist
Copy link
Owner

aclist commented Jan 25, 2022

Right, you shouldn't run scripts as root unless there is some special reason to. The script will only ask for elevated privileges when it tries to invoke steamcmd with sudo. I didn't list the instruction to chmod +x because I assumed it was implied for a script (always make a script executable so that you can invoke it as a regular user), but I can add that instruction to the documentation.

Thanks for confirming that it works. I'll close this issue, but feel free to open another one if you encounter something else.

@aclist
Copy link
Owner

aclist commented Jan 25, 2022

I should add, if you put the script in your /usr/bin or other $PATH you can rename it to dztui and simply run it from anywhere by typing dztui at the terminal.

@aclist
Copy link
Owner

aclist commented Jun 17, 2022

Hi, the latest version of DZTUI contains some additional error handling and more reliable method of finding steamcmd.

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