TS3Tools / TS3UpdateScript

Automate all update processes for your TeamSpeak 3 server instances
GNU General Public License v3.0
189 stars 22 forks source link

5.5.0: bzip2: Compressed file ends unexpectedly #59

Closed TheBlackOne closed 7 years ago

TheBlackOne commented 7 years ago

Script version: 5.5.0 OS: CentOS Linux release 7.3.1611 (Core) Update path: 3.0.12.4 -> 3.0.13.6

Please see the attached script output and debug logs:

TheBlackOne commented 7 years ago
1 TeamSpeak 3 server instance found...

Collecting as much as possible information for following TeamSpeak 3 server instance: /opt/teamspeak3-server_linux_amd64
1 instance for update process...
############################################################################
        Do you want to update this instance to the following version? 3.0.13.6

        Installation Directory: /opt/teamspeak3-server_linux_amd64
        Installed Version: 3.0.12.4 (Build: Unknown)
        Installed Platform: Linux
        Installed Architecture: amd64

        Instance Log Files: /var/log/ts3server
        Instance TSDNS Binary: /opt/teamspeak3-server_linux_amd64/tsdns/tsdnsserver
        TSDNS Status: Inactive

        Owner: teamspeak (UID: 1003)
        Group: root (GID: 0)

        Database Type: SQLite
############################################################################
Please answer: ([y]es/[n]o) y
Temporary server passwords were not backuped, because you've disabled it or whether telnet nor expect is installed.
cat: ts3server.pid: No such file or directory
cat: ts3server.pid: No such file or directory
rm: cannot remove ‘ts3server.pid’: No such file or directory
TeamSpeak 3 server instance stopped for update process.
Backup created successful.

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: No such file or directory
        Input file = teamspeak3-server.tar.bz2, output file = teamspeak3-server.tar

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

bzip2: Deleting output file teamspeak3-server.tar, if it exists.
cp: cannot stat ‘teamspeak3-server__/*’: No such file or directory
rm: cannot remove ‘teamspeak3-server.tar’: No such file or directory
chmod: cannot access ‘ts3server_*’: No such file or directory
chown: missing operand after ‘/’
Try 'chown --help' for more information.
Could not update TeamSpeak 3 server instance. Do you have enough space on ''?
df: ‘/files/’: No such file or directory
grep: /ts3server_startscript.sh: No such file or directory
./TS3UpdateScript: line 2106: expect: command not found
stat: missing operand
Try 'stat --help' for more information.
ls: cannot read symbolic link /proc/2/exe: No such file or directory
ls: cannot read symbolic link /proc/3/exe: No such file or directory
ls: cannot read symbolic link /proc/4/exe: No such file or directory
ls: cannot read symbolic link /proc/5/exe: No such file or directory
ls: cannot read symbolic link /proc/6/exe: No such file or directory
ls: cannot read symbolic link /proc/7/exe: No such file or directory
ls: cannot read symbolic link /proc/8/exe: No such file or directory
ls: cannot read symbolic link /proc/9/exe: No such file or directory
ls: cannot read symbolic link /proc/10/exe: No such file or directory
ls: cannot read symbolic link /proc/11/exe: No such file or directory
ls: cannot read symbolic link /proc/12/exe: No such file or directory
ls: cannot read symbolic link /proc/13/exe: No such file or directory
ls: cannot read symbolic link /proc/14/exe: No such file or directory
ls: cannot read symbolic link /proc/15/exe: No such file or directory
ls: cannot read symbolic link /proc/16/exe: No such file or directory
ls: cannot read symbolic link /proc/17/exe: No such file or directory
ls: cannot read symbolic link /proc/18/exe: No such file or directory
ls: cannot read symbolic link /proc/19/exe: No such file or directory
ls: cannot read symbolic link /proc/20/exe: No such file or directory
ls: cannot read symbolic link /proc/21/exe: No such file or directory
ls: cannot read symbolic link /proc/22/exe: No such file or directory
ls: cannot read symbolic link /proc/23/exe: No such file or directory
ls: cannot read symbolic link /proc/24/exe: No such file or directory
ls: cannot read symbolic link /proc/25/exe: No such file or directory
ls: cannot read symbolic link /proc/27/exe: No such file or directory
ls: cannot read symbolic link /proc/28/exe: No such file or directory
ls: cannot read symbolic link /proc/29/exe: No such file or directory
ls: cannot read symbolic link /proc/30/exe: No such file or directory
ls: cannot read symbolic link /proc/31/exe: No such file or directory
ls: cannot read symbolic link /proc/32/exe: No such file or directory
ls: cannot read symbolic link /proc/33/exe: No such file or directory
ls: cannot read symbolic link /proc/34/exe: No such file or directory
ls: cannot read symbolic link /proc/35/exe: No such file or directory
ls: cannot read symbolic link /proc/36/exe: No such file or directory
ls: cannot read symbolic link /proc/37/exe: No such file or directory
ls: cannot read symbolic link /proc/42/exe: No such file or directory
ls: cannot read symbolic link /proc/43/exe: No such file or directory
ls: cannot read symbolic link /proc/44/exe: No such file or directory
ls: cannot read symbolic link /proc/45/exe: No such file or directory
ls: cannot read symbolic link /proc/46/exe: No such file or directory
ls: cannot read symbolic link /proc/54/exe: No such file or directory
ls: cannot read symbolic link /proc/55/exe: No such file or directory
ls: cannot read symbolic link /proc/57/exe: No such file or directory
ls: cannot read symbolic link /proc/58/exe: No such file or directory
ls: cannot read symbolic link /proc/59/exe: No such file or directory
ls: cannot read symbolic link /proc/60/exe: No such file or directory
ls: cannot read symbolic link /proc/61/exe: No such file or directory
ls: cannot read symbolic link /proc/62/exe: No such file or directory
ls: cannot read symbolic link /proc/81/exe: No such file or directory
ls: cannot read symbolic link /proc/113/exe: No such file or directory
ls: cannot read symbolic link /proc/124/exe: No such file or directory
ls: cannot read symbolic link /proc/296/exe: No such file or directory
ls: cannot read symbolic link /proc/298/exe: No such file or directory
ls: cannot read symbolic link /proc/301/exe: No such file or directory
ls: cannot read symbolic link /proc/304/exe: No such file or directory
ls: cannot read symbolic link /proc/307/exe: No such file or directory
ls: cannot read symbolic link /proc/308/exe: No such file or directory
ls: cannot read symbolic link /proc/309/exe: No such file or directory
ls: cannot read symbolic link /proc/310/exe: No such file or directory
ls: cannot read symbolic link /proc/312/exe: No such file or directory
ls: cannot read symbolic link /proc/316/exe: No such file or directory
ls: cannot read symbolic link /proc/322/exe: No such file or directory
ls: cannot read symbolic link /proc/323/exe: No such file or directory
ls: cannot read symbolic link /proc/325/exe: No such file or directory
ls: cannot read symbolic link /proc/332/exe: No such file or directory
ls: cannot read symbolic link /proc/333/exe: No such file or directory
ls: cannot read symbolic link /proc/334/exe: No such file or directory
ls: cannot read symbolic link /proc/394/exe: No such file or directory
ls: cannot read symbolic link /proc/397/exe: No such file or directory
ls: cannot read symbolic link /proc/398/exe: No such file or directory
ls: cannot read symbolic link /proc/409/exe: No such file or directory
ls: cannot read symbolic link /proc/410/exe: No such file or directory
ls: cannot read symbolic link /proc/423/exe: No such file or directory
ls: cannot read symbolic link /proc/424/exe: No such file or directory
ls: cannot read symbolic link /proc/425/exe: No such file or directory
ls: cannot read symbolic link /proc/426/exe: No such file or directory
ls: cannot read symbolic link /proc/427/exe: No such file or directory
ls: cannot read symbolic link /proc/428/exe: No such file or directory
ls: cannot read symbolic link /proc/429/exe: No such file or directory
ls: cannot read symbolic link /proc/430/exe: No such file or directory
ls: cannot read symbolic link /proc/431/exe: No such file or directory
ls: cannot read symbolic link /proc/432/exe: No such file or directory
ls: cannot read symbolic link /proc/533/exe: No such file or directory
ls: cannot read symbolic link /proc/575/exe: No such file or directory
ls: cannot read symbolic link /proc/589/exe: No such file or directory
ls: cannot read symbolic link /proc/590/exe: No such file or directory
ls: cannot read symbolic link /proc/591/exe: No such file or directory
ls: cannot read symbolic link /proc/592/exe: No such file or directory
ls: cannot read symbolic link /proc/593/exe: No such file or directory
ls: cannot read symbolic link /proc/594/exe: No such file or directory
ls: cannot read symbolic link /proc/619/exe: No such file or directory
ls: cannot read symbolic link /proc/620/exe: No such file or directory
ls: cannot read symbolic link /proc/621/exe: No such file or directory
ls: cannot read symbolic link /proc/622/exe: No such file or directory
ls: cannot read symbolic link /proc/623/exe: No such file or directory
ls: cannot read symbolic link /proc/624/exe: No such file or directory
ls: cannot read symbolic link /proc/625/exe: No such file or directory
ls: cannot read symbolic link /proc/627/exe: No such file or directory
ls: cannot read symbolic link /proc/629/exe: No such file or directory
ls: cannot read symbolic link /proc/632/exe: No such file or directory
ls: cannot read symbolic link /proc/633/exe: No such file or directory
ls: cannot read symbolic link /proc/641/exe: No such file or directory
ls: cannot read symbolic link /proc/642/exe: No such file or directory
ls: cannot read symbolic link /proc/643/exe: No such file or directory
ls: cannot read symbolic link /proc/644/exe: No such file or directory
ls: cannot read symbolic link /proc/645/exe: No such file or directory
ls: cannot read symbolic link /proc/646/exe: No such file or directory
ls: cannot read symbolic link /proc/647/exe: No such file or directory
ls: cannot read symbolic link /proc/653/exe: No such file or directory
ls: cannot read symbolic link /proc/871/exe: No such file or directory
ls: cannot access /proc/11850: No such file or directory
ls: cannot access /proc/11850/task: No such file or directory
ls: cannot access /proc/11850/fd: No such file or directory
ls: cannot access /proc/11850/fdinfo: No such file or directory
ls: cannot access /proc/11850/ns: No such file or directory
ls: cannot access /proc/11850/net: No such file or directory
ls: cannot access /proc/11850/attr: No such file or directory
Due of the failed update, the TS3UpdateScript has created a debug report in /20161228-1506-ts3us-debug-report.md
Update failed. Could not rollback, because no backup exists.

Cleaning up...

Summary of measured execution time for each step
Total script: 45s
Self-Test: 4s
Collecting Information: 9s
Validation: 0s
Execution Mechanism: 32s
Cleanup: 0s

Thanks for using this script! Support the development of this script and donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7ZRXLSC2UBVWE
TheBlackOne commented 7 years ago

20161228-1506-ts3us-debug-report.txt

TheBlackOne commented 7 years ago

From the output, seems to be similar to https://github.com/TS3Tools/TS3UpdateScript/issues/51

Sebbo94BY commented 7 years ago

Thanks for reporting this.

As you already said, it was fixed with a previous version and there were also some lines of codes added to prevent this issue.

It's confusing, that the script isn't detecting all information properly. Could you please re-run the script with the --debug parameter again? I need the debug file.

TheBlackOne commented 7 years ago

I sure can do run the script with --debug again. Will have to wait until the folks are done raiding tonight ;-) Will get back to you ASAP.

Edit: Out of curiousity, will that produce a different output from the one that already is in the attached debug report file?

Sebbo94BY commented 7 years ago

Yes, it does. This file shows all executed commands as well as their results.

TheBlackOne commented 7 years ago

Sorry for the late response, was enjoying the holidays :-)

There was something where it seems to wait for keyboard input regarding SQLite, that might be of interest...? Line 1237 in debug.txt.

20170102-2120-ts3us-debug-report.txt

debug.txt

Sebbo94BY commented 7 years ago

No problem - I'm still enjoying mine. ;)

Well, the script tried to download an archive, which simply does not exists: + TS3_SERVER_DOWNLOAD_LINK=http://dl.4players.de/ts/releases/3.0.13.6/teamspeak3-server__-3.0.13.6.tar.bz2

You may can see, that the platform and architecture like linux and amd64 is missing there.

Can you please add the following line between 2500-2501? cp TS3InstanceInfos.txt /tmp/TS3InstanceInfos.txt.dump

After this change, please re-run the script once again. You should now have a copy of this file in /tmp/TS3InstanceInfos.txt.dump. Please provide me the input of this file.

TheBlackOne commented 7 years ago

There you go:

TS3InstanceInfos.txt

Seems like InstalledTS3ServerBuild is set to unknown...?

TheBlackOne commented 7 years ago

Manual telnet to query port asking for version information:

[root@zbox TS3UpdateScript-5.4.3]# telnet 127.0.0.1 10011
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
TS3
Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.
version
version=3.0.12.4 build=1461597405 platform=Linux
error id=0 msg=ok
quit
error id=0 msg=ok
Connection closed by foreign host.
TheBlackOne commented 7 years ago

It seems that getBuildOfInstalledTS3Server() is called with 0 parameters, which makes it return "Unknown" in this case. Telnet is installed of course, sooo no sure what the reason is.

TheBlackOne commented 7 years ago

After [[ $(checkdeps telnet expect) -eq 0 ]]; SELF_TEST_STATUS.txt contains:

expect is not found. Please install this package
expect is not found. Please install this package
expect is not found. Please install this package
Sebbo94BY commented 7 years ago

Yeah, the build is unknown, but this information isn't required for the update.

The script needs to know following information:

The script is using telnet and expect to collect data like the build. The script tries to get this information and if it's not possible, it's just "unknown". Just install expect as well and you should get the build.

TheBlackOne commented 7 years ago

After installing the package expect, the script proceeds and seems to detect the build correctly. It still is not working though. New set of log files for you:

TS3InstanceInfos.txt 20170104-1715-ts3us-debug-report.txt debug.txt

TheBlackOne commented 7 years ago

On the topic of missing expect: Shouldn't the information that this package is missing jump in my face without having to debug for that information? Also, doesn't the script collect information on packages it needs in order to run first (I vaguely remember it doing that). Is expect missing there?

TheBlackOne commented 7 years ago

Debug.txt line 1720: TS3_SERVER_DOWNLOAD_LINK=http://dl.4players.de/ts/releases/3.0.13.6/teamspeak3-server__-3.0.13.6.tar.bz2

Seems to be the same problem still.

TheBlackOne commented 7 years ago

I've had the script quit after: INSTANCE_INFO_LINE=$(grep "${TS3_INSTANCE_ROOT_DIRECTORY}" TS3InstanceInfos.txt)

It seems there is no such file in /opt/teamspeak3-server_linux_amd64/? It is in the TS3UpdateScript directory though...

Sebbo94BY commented 7 years ago

Yes, the TS3UpdateScript tests this.

telnet and expect is only tested, if you're using the parameter --inform-online-clients:

        # Task/Parameter specific
        if [ "$PAR_INFORM_ONLINE_CLIENTS" -eq 1 ]; then
                if [[ $(checkdeps telnet expect) -eq 1 ]]; then
                        SELF_TEST_STATUS=1;
                fi
        fi

Ok, I've found the problem:

++ grep /opt/teamspeak3-server_linux_amd64/ TS3InstanceInfos.txt
+ INSTANCE_INFO_LINE=
++ echo ''
++ cut -d '|' -f 1
+ STATUS_FLAG=
++ echo ''
++ cut -d '|' -f 2
+ INSTANCE_PATH=
++ echo ''
++ cut -d '|' -f 3
+ INSTALLED_TS3_SERVER_VERSION=
++ echo ''
++ cut -d '|' -f 4
+ INSTALLED_TS3_SERVER_BUILD=
++ echo ''
++ cut -d '|' -f 5
++ tr '[:upper:]' '[:lower:]'
+ INSTALLED_TS3_SERVER_PLATFORM=
++ cut -d '|' -f 6
++ echo ''
+ TS3SERVER_INSTANCE_LOG_PATH=
++ echo ''
++ cut -d '|' -f 7
+ TS3SERVER_ARCHITECTURE=
++ echo ''
++ cut -d '|' -f 8
+ OWNER=
++ echo ''
++ cut -d '|' -f 9
+ OWNER_ID=
++ echo ''
++ cut -d '|' -f 10
+ GROUP=
++ echo ''
++ cut -d '|' -f 11
+ GROUP_ID=
++ echo ''
++ cut -d '|' -f 12
+ SERVERQUERY_IP=
++ echo ''
++ cut -d '|' -f 13
+ SERVERQUERY_PORT=
++ echo ''
++ cut -d '|' -f 14
+ DATABASE_TYPE=

The script tries to find the instance information for the instance /opt/teamspeak3-server_linux_amd64/, but unfortunately, it was saved without the ending slash in your TS3InstanceInfos.txt file: OK|/opt/teamspeak3-server_linux_amd64|3.0.12.4|Unknown|Linux|/var/log/ts3server|amd64|teamspeak|1003|root|0|||SQLite

Well... We need to make sure, that the slash is removed in the grep command.

Can you please test it once, to make sure, that it's also working for you? Just replace the line 1856 with this one: TS3_INSTANCE_ROOT_DIRECTORY=$(findRealTS3RootDirectory ${1} | sed 's/\/$//')

Thanks for your providing all the files.

Btw: You're very quick and good at debugging. 👍

TheBlackOne commented 7 years ago

Buuuut if telnet and expect are only tested when --inform-online-clients is passed, shouldn't it be an and instead of an or here? if [[ "$PAR_INFORM_ONLINE_CLIENTS" -eq 1 ]] || [[ $(checkdeps telnet expect) -eq 0 ]]; then

But well, that seems to be a different problem anyway. Hang on.

Ah and thanks, doing that for a living :-)

Sebbo94BY commented 7 years ago

No, because the script tries to collect some information with telnet and expect, if it's installed, even when the user has not used the parameter --inform-online-clients.

TheBlackOne commented 7 years ago

If the path was saved as /opt/teamspeak3-server_linux_amd64 (without a trailing /), why would I need to remove a trailing / (which is not there?)

There is no TS3InstanceInfo.txt in /opt/teamspeak3-server_linux_amd64/ anyway, nothing for grep to read.

TheBlackOne commented 7 years ago

Oh btw in case that was not clear: The TS3UpdateScript is in a different directory than the Teamspeak Server...

TheBlackOne commented 7 years ago

D'oh twisted thougts. grep does not try to read /opt/teamspeak3-server_linux_amd64/TS3InstanceInfo.txt, it tries to find something in TS3InstanceInfo.txt...

Hang on :-)

Sebbo94BY commented 7 years ago

I believe, you missunderstood me. The script collects the data and this data will be saved to a file called TS3InstanceInfo.txt.

While updating and doing some awesome stuff, the script is searching for specific information in the collected data. Well... This "searching" task is using a trailing slash and due of that, it can't find the correct information.

Yes, I know. The script is greping for /opt/teamspeak3-server_linux_amd64 in the file TS3InstanceInfos.txt, which is containing the information.

Just replace the mentioned line and try it again. :)

TheBlackOne commented 7 years ago

sed: -e expression #1, char 6: unknown option tos'`

running echo /opt/teamspeak3-server_linux_amd64/ | sed 's/\/$//' in the commad line works fine.

TheBlackOne commented 7 years ago

Did you edit that regular expression after you first posted it? ;-)

TheBlackOne commented 7 years ago

Script updated my server now with this line:

TS3_INSTANCE_ROOT_DIRECTORY=$(findRealTS3RootDirectory ${1} | sed 's/\/$//')

Sebbo94BY commented 7 years ago

Mhmm. Did you change my posted line now or is it now working? I'm confused. Your line looks like mine. :D

No, I didn't edit it.

Great, than I'll just use this line to hotfix this. :)

TheBlackOne commented 7 years ago

Thank you for the support!

Sebbo94BY commented 7 years ago

I'll check and may update something else and release it asap as v5.5.1 (Hotfix).

Sebbo94BY commented 7 years ago

Hotfix has been released.

Thumpxr commented 6 years ago

I got the same issue since a few days.

` bzip2: Compressed file ends unexpectedly; perhaps it is corrupted? Possible reason follows. bzip2: No such file or directory Input file = teamspeak3-server.tar.bz2, output file = teamspeak3-server.tar

It is possible that the compressed file(s) have become corrupted. You can use the -tvv option to test integrity of such files.

You can use the bzip2recover' program to attempt to recover data from undamaged sections of corrupted files.

I'm running the lastest version (25. Feb) and did not had the issue on the version before when i updated the server to 3.1