Could not register the local accounting service: The file already exists

No connection to the server possible. As soon as I want to connect, only the warning sound Error comes, and that permanently one after the other.

Here is the log:

2022-09-11 10:49:24.809621|INFO |ServerLibPriv | |TeamSpeak 3 Server 3.13.5 (2021-05-17 08:13:36)
2022-09-11 10:49:24.809703|INFO |ServerLibPriv | |SystemInformation: Linux 5.10.0-16-amd64 #1 SMP Debian 5.10.127-2 (2022-07-23) x86_64 Binary: 64bit
2022-09-11 10:49:24.809728|INFO |ServerLibPriv | |Uses hardware aes
2022-09-11 10:49:24.810322|INFO |DatabaseQuery | |dbPlugin Name: SQLite3 Plugin, Version 3, (c)TeamSpeak Systems GmbH
2022-09-11 10:49:24.810354|INFO |DatabaseQuery |dbPlugin Version: 3.11.1
2022-09-11 10:49:24.810620|INFO |DatabaseQuery | Database integrity check (may take a while)
2022-09-11 10:49:24.817238|INFO |SQL | |db_CreateTables() tables created
2022-09-11 10:49:24.839059|WARNING |Accounting | |Cannot open licensekey.dat, falls back to limited functionality
2022-09-11 10:49:24.839177|INFO |Accounting | |Licensing information
2022-09-11 10:49:24.839191|INFO |Accounting |Licensed to : Anonymous
2022-09-11 10:49:24.839199|INFO |Accounting | |Type : No license
2022-09-11 10:49:24.839214|INFO |Accounting | |Start Date : Thu Oct 1 00:00:00 2020
2022-09-11 10:49:24.839222|INFO |Accounting | |End date : Tue Nov 1 00:00:00 2022
2022-09-11 10:49:24.839228|INFO |Accounting | |max virtualservers: 1
2022-09-11 10:49:24.839234|INFO |Accounting | |max slots : 32
2022-09-11 10:49:25.339533|ERROR |Accounting | |could not register the local accounting service: The file already exists
2022-09-11 10:49:25.636773|INFO | |Puzzle precalculation time: 781
2022-09-11 10:49:25.639610|INFO |FileManager |Listening to 0.0.0.0:30033, [::]:30033
2022-09-11 10:49:25.640187|INFO |VirtualSvrMgr | Run monthly interval
2022-09-11 10:49:25.640294|INFO |VirtualSvrMgr | |Reset virtual server traffic statistics
2022-09-11 10:49:25.646170|INFO |Query | |Uses a query thread pool size of 2
2022-09-11 10:49:25.663759|INFO |Query | |Waits for query on 0.0.0.0:10011, [::]:10011
2022-09-11 10:49:25.663876|INFO |generates QUERY_SSH_RSA_HOST_KEY file: ssh_host_rsa_key
2022-09-11 10:49:25.749706|INFO |myTeamSpeak identifier blocking list was successfully downloaded - all related functions are enabled
2022-09-11 10:49:27.651441|INFO |Query | listens to ssh query on 0.0.0.0:10022, [::]:10022
2022-09-11 10:49:27.651569|INFO |Query | listens to http request on 0.0.0.0:10080, [::]:10080
2022-09-11 10:49:27.651750|INFO |CIDRManager | |updated query_ip_allowlist ips: 127.0.0.1/32, ::1/128,

Check if these steps help you

Was just about to restart the server because crashed.

Found ts3server.pid, but no server running. Possibly your previously started server crashed
Please see the log file for details.
Starting the TeamSpeak 3 server
TeamSpeak 3 server started, please see the logfile for details

Just checked all processes, no more for Teamspeak there

However, because TS did not respond, I also completely reinstalled the server. So there should really be all the data from gone

However, the 1st time the server was started via root, accidentally

Have you an old server running on another instance?

I think the old server is still running or was killed.

How can I find out if something is still running somewhere? Under active processes I see nothing

Your Server shows the following Error:

The Reason could be:

A file was created by root and can’t be used by your non-root user.

Fix:
Check for a cryptic file in /dev/shm/

ls -al /dev/shm/
total 39228
drwxrwxrwt 2 root root 1800 Dez 5 11:41 .
drwxr-xr-x 17 root root 3640 Nov 13 06:47 …
-rw-r–r-- 1 root root 128 Dez 5 11:41 7gbhujb54g8z9hu43jre8

And remove the cryptic file now with the following command:

rm /dev/shm/7gbhujb54g8z9hu43jre8

If you start your TeamSpeak Server now, the file will be created with the correct user.

6 Likes

I’ve updated my Teamspeak server to version 3.13.7 and now I’m trying to get it to run as a service under the user teamspeak as the previous version taht I’ve run before.

I’ve noticed that the server runs OK when I’m starting ./ts3server under the user root. It crashes when starting it under the user teamspeak. The ownership of the directory where I’ve extracted the .tar.bz2 to, are correctly set to teamspeak:teamspeak, so it is not a file permission problem.

I get the following output:

teamspeak@GoedelServer:/opt/teamspeak3-server_linux_amd64$ ./ts3server
2022-11-01 20:06:49.505292|INFO    |ServerLibPriv |   |TeamSpeak 3 Server 3.13.7 (2022-06-20 12:21:53)
2022-11-01 20:06:49.505593|INFO    |ServerLibPriv |   |SystemInformation: Linux 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 Binary: 64bit
2022-11-01 20:06:49.507077|INFO    |DatabaseQuery |   |dbPlugin name:    SQLite3 plugin, Version 3, (c)TeamSpeak Systems GmbH
2022-11-01 20:06:49.507206|INFO    |DatabaseQuery |   |dbPlugin version: 3.11.1
2022-11-01 20:06:49.507665|INFO    |DatabaseQuery |   |checking database integrity (may take a while)
2022-11-01 20:06:49.577192|WARNING |Accounting    |   |Unable to open licensekey.dat, falling back to limited functionality
2022-11-01 20:06:49.577561|INFO    |Accounting    |   |Licensing Information
2022-11-01 20:06:49.577613|INFO    |Accounting    |   |licensed to       : Anonymous
2022-11-01 20:06:49.577661|INFO    |Accounting    |   |type              : No License
2022-11-01 20:06:49.577717|INFO    |Accounting    |   |starting date     : Tue Feb  1 00:00:00 2022
2022-11-01 20:06:49.577768|INFO    |Accounting    |   |ending date       : Thu Jul  1 00:00:00 2027
2022-11-01 20:06:49.577816|INFO    |Accounting    |   |max virtualservers: 1
2022-11-01 20:06:49.577859|INFO    |Accounting    |   |max slots         : 32
2022-11-01 20:06:50.077926|ERROR   |Accounting    |   |failed to register local accounting service: File exists
2022-11-01 20:06:50.919765|INFO    |              |   |Puzzle precompute time: 1245
2022-11-01 20:06:50.920629|INFO    |FileManager   |   |listening on 0.0.0.0:30033, [::]:30033
2022-11-01 20:06:50.937943|INFO    |Query         |   |Using a query thread pool size of 2
2022-11-01 20:06:51.031931|INFO    |VirtualServerBase|1  |listening on 0.0.0.0:9987, [::]:9987
2022-11-01 20:06:51.032436|INFO    |Query         |   |listening for query on 0.0.0.0:10011, [::]:10011
2022-11-01 20:06:51.032910|INFO    |Query         |   |listening for ssh query on 0.0.0.0:10022, [::]:10022
2022-11-01 20:06:51.033238|INFO    |Query         |   |listening for http query on 0.0.0.0:10080, [::]:10080
2022-11-01 20:06:51.033455|INFO    |CIDRManager   |   |updated query_ip_allowlist ips: 127.0.0.1/32, ::1/128,
2022-11-01 20:06:51.033763|INFO    |VirtualServerBase|1  |stopped

ts3server has crashed. A crashdump has been generated at "/opt/teamspeak3-server_linux_amd64/crashdumps/ts3server_3_13_7_linux_amd64_7242-aa53-3909-da26.dmp"
Segmentation fault

However, when starting it as root, it seems to work fine:

root@GoedelServer:/opt/teamspeak3-server_linux_amd64# ./ts3server
2022-11-01 20:07:59.225328|INFO    |ServerLibPriv |   |TeamSpeak 3 Server 3.13.7 (2022-06-20 12:21:53)
2022-11-01 20:07:59.225632|INFO    |ServerLibPriv |   |SystemInformation: Linux 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 Binary: 64bit
2022-11-01 20:07:59.227078|INFO    |DatabaseQuery |   |dbPlugin name:    SQLite3 plugin, Version 3, (c)TeamSpeak Systems GmbH
2022-11-01 20:07:59.227208|INFO    |DatabaseQuery |   |dbPlugin version: 3.11.1
2022-11-01 20:07:59.227689|INFO    |DatabaseQuery |   |checking database integrity (may take a while)
2022-11-01 20:07:59.297496|WARNING |Accounting    |   |Unable to open licensekey.dat, falling back to limited functionality
2022-11-01 20:07:59.297865|INFO    |Accounting    |   |Licensing Information
2022-11-01 20:07:59.297920|INFO    |Accounting    |   |licensed to       : Anonymous
2022-11-01 20:07:59.297970|INFO    |Accounting    |   |type              : No License
2022-11-01 20:07:59.298034|INFO    |Accounting    |   |starting date     : Tue Feb  1 00:00:00 2022
2022-11-01 20:07:59.298095|INFO    |Accounting    |   |ending date       : Thu Jul  1 00:00:00 2027
2022-11-01 20:07:59.298140|INFO    |Accounting    |   |max virtualservers: 1
2022-11-01 20:07:59.298183|INFO    |Accounting    |   |max slots         : 32
2022-11-01 20:08:01.051500|INFO    |              |   |Puzzle precompute time: 1656
2022-11-01 20:08:01.052337|INFO    |FileManager   |   |listening on 0.0.0.0:30033, [::]:30033
2022-11-01 20:08:01.070074|INFO    |Query         |   |Using a query thread pool size of 2
2022-11-01 20:08:01.165606|INFO    |VirtualServerBase|1  |listening on 0.0.0.0:9987, [::]:9987
2022-11-01 20:08:01.166081|INFO    |Query         |   |listening for query on 0.0.0.0:10011, [::]:10011
2022-11-01 20:08:01.166606|INFO    |Query         |   |listening for ssh query on 0.0.0.0:10022, [::]:10022
2022-11-01 20:08:01.166892|INFO    |Query         |   |listening for http query on 0.0.0.0:10080, [::]:10080
2022-11-01 20:08:01.167110|INFO    |CIDRManager   |   |updated query_ip_allowlist ips: 127.0.0.1/32, ::1/128,

I would attach the crashdump file here but I can’t, it accepts image files only.

I’m running Debian Linux Linux Server 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 GNU/Linux on a Intel(R) Celeron(R) CPU J1900 @ 1.99GHz with 4 cores on 8GB RAM.

It might have to do with the line

2022-11-01 20:06:50.077926|ERROR   |Accounting    |   |failed to register local accounting service: File exists

which I don’t get when I start it as root. But which file exists? Where is it located? I would delete it if I would know which one…

Sorry to bother you, I finally found the solution here:

I had the problem because after the update to the new version I started the program from user root and this created a file in /dev/shm with root permissions and only read access for other users. After having deleted this file, the server starts now also as teamspeak user.

Maybe others have the same problem and are as slow as I am finding the solution with Google.

Otherwise, sorry for bothering you with my unnecessary question.

Cheers

1 Like

Fixed my transfer from root to user as well. Thanks!

1 Like

Thank you!
This is precisely what I needed.

1 Like

hi, I know there are tons of unofficial guides, I’m already able to install and make it works, but I’m 200% sure I’m doing it in the wrong way, I mean, I always use root account and sudo commands, and I always grant full permission to all folders and files for avoid problems, and also, I surely put the teamspeak folder in a random wrong place.

this morning I decided to start from scratch by install ts3 server on a clean ubuntu server machine, then I downloaded last version of the server, and making few searches, I found out I have to create a dedicated user, then I created it, giving him “teamspeak” name and folder under “otp”.

finally, I also created a service in order to avoid having start it manually every time.

now, I don’t know if is that the proper and safest way to do it, if yes, I want say I’m getting error

“|Unable to open licensekey.dat, falling back to limited functionality”

and this not happen if I run the .sh script with “sudo”, I don’t know where this file is located, but I just followed online guides, so I have no idea why am I getting this error.

I’m using free version with 32 slots for now, so, no, I didn’t put any “licensekey.dat” file in the wrong place since I don’t have.

if that way is wrong too, I would just ask you how should I install ts3 server properly?

I want make something clean, respecting max safe rules.

last question, but I already know answers I could get, is ubuntu good distro for teamspeak server? if not which one should I use?

thanks to all in advance.

Ok, so I see a few questions here.

Probably the most pressing: The Unable to open licensekey.dat [...] log line is normal and expected, you most likely just missed it when running as root.

Running as root is absolutely discouraged and the way it sounds like what you are doing now is a better way. Whether it’s perfect is debatable, but it is definitely fine.

When you are talking about Ubuntu I guess you mean Ubuntu server. This is also perfectly fine, I always uninstall snap, but that’s just personal preference :P.

Another few ideas for even more security:

  • Implement a proper firewall with restrictive rules (e.g. ufw / iptables)
  • containerize the TeamSpeak server (e.g. docker / podman)
1 Like

about the licensekey.dat error I really have no idea on how to fix it.

it comes only when I run as normal user.

and forgot to say, the only file I had to create, was the blank file for accept the license.
I’m using ubuntu server, yeah.

I thought ovh firewall was already enough, but btw y, I’d like to set max security, I know a bit iptables, is it enough to just install it, and decide ports to unlock, or I’ll have to add much other rules?

about docker, yeah, I know tons of people use it, but in my case, I’m having to host only 1 ts3 server, not multiples, is still recommended to use docker? if y, why?

finally, consider the final place will be a vps, so an already virtualized environment.

The line about the licensekey is just a warning. It tells you that the server is using the built-in 32 slot license. As long as you don’t provide your own licensekey.dat file the line ALWAYS shows.

Yeah, it should definitely be. Nested firewalls don’t practically have any benefit. So you should be fine.

The main benefit of containerization is the encapsulation of the service. Thus if there is e.g. an RCE in a service an attack can only access things (files / processes) in the container and not on the host. But if TeamSpeak is the only service the security benefit is negligible. From a sysadmin perspective docker container are easier to update (as long as there is a prebuilt image) than bare-metal installs.

if I execute as normal user it says that, and ts3 server istantly die
if I run as root with sudo log file does not show errors and ts3 server stay up
edit: I think the real error is that one

ERROR |Accounting | |failed to register local accounting service: File exists

ts3server has crashed. A crashdump has been generated at “/opt/teamspeak/crashdumps/ts3server_3_13_7_linux_amd64_5659-fa9f-f9b3-7a1a.dmp”
Aborted (core dumped)

so you’ll recommend me to use docker even for a single instance of ts3, or in my case I can just skip it?

I see. The license is still not the problem though.

Yes, the error is with an existing file. I’m not too sure, but I guess that the offending file belongs to the root user and can not be deleted by the other user.

And I don’t think you need docker in your case.

I noticed at the end of the log it says:

ts3server has crashed. A crashdump has been generated at “/opt/teamspeak/crashdumps/ts3server_3_13_7_linux_amd64_5659-fa9f-f9b3-7a1a.dmp”
Aborted (core dumped)

Im gonna try open this .dmp hoping it will be readable

https://community.teamspeak.com/search?q=failed%20to%20register%20local%20accounting%20service%3A%20File%20exists

Looking through the forum there seems to be a file created in /dev/shm with a random ID. Removing that should allow the server to start as non root.

yeah, there was a blank file in, named 7gbhujb54g8z9hu43jre8
removed it and it works
for the rest, you think I installed it in the right way and folder?
did I miss some best practice?