mmmaxwwwell / space-engineers-dedicated-docker-linux

Space Engineers Dedicated Server running in Docker for Linux
MIT License
177 stars 43 forks source link

Error: No IP assigned. #25

Open mmmaxwwwell opened 3 years ago

mmmaxwwwell commented 3 years ago

Sometimes when I start the container, I see a few messages in the logs, and the server fails to start.

The messages are:

space-engineers-dedicated-docker-linux | 2021-10-02 23:03:44.920: CPU Info: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
space-engineers-dedicated-docker-linux | 2021-10-02 23:03:46.556: Bind IP : 0.0.0.0:27016
space-engineers-dedicated-docker-linux | dbus[71]: arguments to dbus_connection_send_with_reply_and_block() were incorrect, assertion "connection != NULL" failed in file ../../../dbus/dbus-connection.c line 3544.
space-engineers-dedicated-docker-linux | This is normally a bug in some application using the D-Bus library.
space-engineers-dedicated-docker-linux | 
space-engineers-dedicated-docker-linux |   D-Bus not built with -rdynamic so unable to print a backtrace
space-engineers-dedicated-docker-linux | wine: Assertion failed at address 00007FA7050F37BB (thread 006c), starting debugger...
space-engineers-dedicated-docker-linux | 2021-10-02 23:03:59.363: Error: No IP assigned.

Just restarting the server doesn't seem to help.

sudo docker-compose down && sudo service containerd restart && ./start seems to resolve it most of the time, however sometimes it doesn't. Changing the container to/from host networking mode seems to resolve it sometimes also.

I'm not sure whats going on here, but I suspect it has to do with docker.

whodat commented 3 years ago

Yeah I have been getting this randomly as well for ..hmm...the last few months?.... Posted about it here: https://github.com/Devidian/docker-spaceengineers/issues/19 (which appears to be a fork of this one?)

I just keep restarting the docker until it works. Sometimes takes a couple restarts, sometimes more. The fact that I restart the server every day at 4am componds the issue. Considering changing the cron job script so that it re-tries about 10 times until the docker is successfully running.

mmmaxwwwell commented 3 years ago

I can't really say the container is mine persay, but I've been the driving force of why this exists currently. This could change in the future, I found lots of abandoned, once working but now broken docker containers on my way here. I started off based on others work, got it most of the way, and then devidian jumped in and connected the last piece I was missing. Since then I redid the entire thing to use wine6 so we didn't need devidian's workaround for the winetricks stuff, which was great when we needed it but added complexity. Just like the people that are 'self taught' are really just learning from others and riding the coat tails of those that came before them. I'm super thankful and grateful for devidian's and everyone else's contribution to this project.

I'd really like to get a fix for this, this docker container is step 1 of this far fetched idea I have that involves multiple worlds that are networked together. I know torch can do some of this stuff, but I've had some bad experiences with torch servers in the past, and I really want to limit the number of vendors I depend on here.

Imagine you and some friends join my world, get bases set up and then everyone brings a grid to some NPC or admin station, then presses a button. A new docker container with a prebuilt scenario is spun up, and the players and grids in the area are moved to the new docker instance where they will work to complete an objective and their performance could be evaluated and quantified.

This isn't just a moonshoot, I've actually implemented a POC plugin, webserver and single page application that let users control the functional block's control panel settings. It was terribly coded and probably full of security holes, but it worked great. I'm just now embarking on the journey to make this next step toward my vision a reality.

That being said, if I want to spin up a new networked world and it doesn't go for a minute or so, that's a problem for the users. Its going to ruin the experience. It needs to be rock solid if I'm going to depend on it.

I'm at a loss for what to do, maybe we can try stepping through the docker container with a disassembler somehow and see what the DS is evaluating before it emits that no IP error.

Devidian commented 3 years ago

I write it down here too, seems that keen has implemented some magic "find my external ip" into the dedicated server that is causing this error sometimes. So in this case we can do nothing to fix this.

https://support.keenswh.com/spaceengineers/pc/topic/error-no-ip-assigned

Also this topic seems to be abandoned and not yet fixed.

@mmmaxwwwell your multi-server idea sounds like my idea i had for years for several games (including se). In my case i had the idea to connect servers through a modified stargate-mod, but with servers already up - because spin up time is long enougth even without this damn bug.

Devidian commented 3 years ago

I've opened an issue in the official github

https://github.com/KeenSoftwareHouse/SpaceEngineers/issues/611

i know they dont update the code there but maybe if we get enough loudness on this issue, they may fix it for the current code!

msansen commented 2 years ago

As a workaround, setting the actual public ip in SpaceEngineers-Dedicated.cfg + setting the se-server network to host mode did the trick for me, only thing i'm still haven't figured out was the remote api. Great job to (all of) you :)

services:
  se-server:
    image: mmmaxwwwell/space-engineers-dedicated-docker-linux:latest
    container_name: space-engineers-dedicated-docker-linux
    restart: unless-stopped
    network_mode: "host"
mmmaxwwwell commented 2 years ago

When i'm developing using this container, switching between host and a few forwarded ports fixes it most times for a bit. Then it breaks again in a few mins, but I wasn't setting the external IP in the config file.

Restarting containerd and docker help sometimes too, but every fix seems to encounter the same error after a few restarts, in my experience.

I expect you to run into the same problrm again soon. Please report back if you do, and if you run it for a few days and its fine, please report that back too!

whodat commented 2 years ago

Yeah great work on keeping this going! I did end up disabling my SE container and running it under a VM for now. Were too many minor issues (No remote admin, this "No IP assigned" error, and then started getting "given key was not present in the directionary" errors).

With that last error, my world would not load, but I can load new worlds. It seems to happen when the world gets more complex as we play on it for a few weeks. (I clean a bunch of stuff up, removing entities, etc, and still no go).

The same exact world on a Wndows VM SE server works great. So yeah am back with running it on a Windows VM for now (sigh). I do like having my remote admin back though! Will definately keep an eye on this docker container though, great work! And your idea with the dynamically spawned instances on seperate containers sounds pretty durn cool!

Devidian commented 2 years ago

Hey Guys, they have closed the issue on their forum but said it should be re-opened when someone else encounters it, ... so i did: https://support.keenswh.com/spaceengineers/pc/topic/23166-error-no-ip-assigned

Would need some votes of course, so feel free to support that ticket

Merith-TK commented 2 years ago

having the issue myself lol

mmmaxwwwell commented 2 years ago

Go vote and leave a comment on the keen site above if you have some time! Would really appreciate it!

Merith-TK commented 2 years ago

image

cant, sadly, I get a 401 error

Devidian commented 2 years ago

You have to be logged in on their site to see the forum. Anyway ticket seems to be opened now, maybe it finally gets fixed

Devidian commented 2 years ago

I had to reopen it again https://support.keenswh.com/spaceengineers/pc/topic/23390-error-no-ip-assigned

pyro000 commented 2 years ago

In this old source code of SE

            UInt32 ip = 0;
            UInt64 id = 0;

            int timeout = 100;
            while (ip == 0 && timeout > 0)
            {
                SteamSDK.SteamServerAPI.Instance.GameServer.RunCallbacks();

                Thread.Sleep(100);
                timeout--;

                ip = SteamSDK.SteamServerAPI.Instance.GameServer.GetPublicIP();
                id = SteamSDK.SteamServerAPI.Instance.GameServer.GetSteamID();
            }

            MySandboxGame.Services.SteamService.UserId = id;

            if (ip == 0)
            {
                MyLog.Default.WriteLineAndConsole("Error: No IP assigned.");
                return;
            }

            var ipAddress = IPAddressExtensions.FromIPv4NetworkOrder(ip);

It seems like Steam is handling the Public IP recognition, which is unnecesary when we define the ip in SpaceEngineersDedicated.cfg.

RandomExplosion commented 1 year ago

Has anyone found a way to fix this? Or is the only reliable way to delete the server and start over?

xyadelaide commented 1 year ago

Has anyone found a way to fix this? Or is the only reliable way to delete the server and start over?

I think that the best way to do this is to just use a Windows VM unfortunately. I can't get this to work after trying a few fixes.

Merith-TK commented 1 year ago

I am going to be forking the container to make my own take on this, I suspect some things may not be entirely up to date,

Already have some improved entry point scripts that help with permission issues and various setup tasks that are not defined in the Readme (fetching steamed for example)

On Mon, Nov 27, 2023, 11:55 PM xyadelaide @.***> wrote:

Has anyone found a way to fix this? Or is the only reliable way to delete the server and start over? I think that the best way to do this is to just use a Windows VM unfortunately. I can't get this to work after trying a few fixes.

— Reply to this email directly, view it on GitHub https://github.com/mmmaxwwwell/space-engineers-dedicated-docker-linux/issues/25#issuecomment-1829282553, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPQOXWE5VZMWK7TSRF4AQ3YGWKF5AVCNFSM5FG5BSQKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSHEZDQMRVGUZQ . You are receiving this because you commented.Message ID: <mmmaxwwwell/space-engineers-dedicated-docker-linux/issues/25/1829282553@ github.com>