Cannot connect to MineOS server

I set up server everything seems fine, but when i try to connect to server in MC i get error “Failed to verify username!” or “com.mojang.authlib.GameProfile@384398f5[id=,name=Harwes,properties={},legacy=false] (/192.168.1.110:64717) lost connection: Disconnected”

Here is logs
[17:14:19] [main/INFO]: Environment: authHost=‘https://authserver.mojang.com’, accountsHost=‘https://api.mojang.com’, sessionHost=‘https://sessionserver.mojang.com’, servicesHost=‘https://api.minecraftservices.com’, name=‘PROD’
[17:14:22] [main/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[17:14:22] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[17:14:22] [main/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[17:14:22] [main/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[17:14:22] [main/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[17:14:22] [main/INFO]: Reloading ResourceManager: Default
[17:14:28] [Worker-Main-4/INFO]: Loaded 7 recipes
[17:14:30] [Worker-Main-4/INFO]: Loaded 927 advancements
[17:14:36] [Server thread/INFO]: Starting minecraft server version 1.16.5
[17:14:36] [Server thread/INFO]: Loading properties
[17:14:36] [Server thread/INFO]: Default game type: SURVIVAL
[17:14:36] [Server thread/INFO]: Generating keypair
[17:14:37] [Server thread/INFO]: Starting Minecraft server on 192.168.1.137:25572
[17:14:37] [Server thread/INFO]: Using default channel type
[17:14:38] [Server thread/INFO]: Preparing level “world”
[17:15:16] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
[17:15:18] [Worker-Main-6/INFO]: Preparing spawn area: 0%
[17:15:18] [Worker-Main-6/INFO]: Preparing spawn area: 0%
[17:17:13] [Worker-Main-4/INFO]: Preparing spawn area: 94%
[17:17:13] [Server thread/INFO]: Time elapsed: 116780 ms
[17:17:13] [Server thread/INFO]: Done (155.141s)! For help, type “help”
[17:17:16] [Server thread/WARN]: Can’t keep up! Is the server overloaded? Running 2886ms or 57 ticks behind
[17:17:45] [Server thread/WARN]: Can’t keep up! Is the server overloaded? Running 13887ms or 277 ticks behind
[17:21:27] [User Authenticator #1/INFO]: Disconnecting /192.168.1.110:64709: Failed to verify username!
[17:21:27] [User Authenticator #1/ERROR]: Username ‘Harwes’ tried to join with an invalid session
[17:21:27] [Server thread/INFO]: /192.168.1.110:64709 lost connection: Failed to verify username!
[17:21:42] [Server thread/INFO]: com.mojang.authlib.GameProfile@384398f5[id=,name=Harwes,properties={},legacy=false] (/192.168.1.110:64717) lost connection: Disconnected
[17:21:44] [User Authenticator #2/INFO]: Disconnecting /192.168.1.110:64720: Failed to verify username!
[17:21:44] [User Authenticator #2/ERROR]: Username ‘Harwes’ tried to join with an invalid session
[17:21:44] [Server thread/INFO]: /192.168.1.110:64720 lost connection: Failed to verify username!
[17:21:59] [Server thread/INFO]: Stopping the server
[17:21:59] [Server thread/INFO]: Stopping server
[17:21:59] [Server thread/INFO]: Saving players
[17:21:59] [Server thread/INFO]: Saving worlds
[17:21:59] [Server thread/INFO]: Saving chunks for level ‘ServerLevel[world]’/minecraft:overworld
[17:22:06] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[17:22:06] [Server thread/INFO]: Saving chunks for level ‘ServerLevel[world]’/minecraft:the_nether
[17:22:06] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[17:22:06] [Server thread/INFO]: Saving chunks for level ‘ServerLevel[world]’/minecraft:the_end
[17:22:06] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[17:22:06] [Server thread/INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[17:22:06] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[17:22:06] [Server thread/INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved

A few thouths:

  1. Are your MineOS server connected to the internet? Can it reach mojang for the username check?
  2. Is the connectiong account valid? If a minecraft client using an account not registered with Mojang/Microsoft it won’t verify
  3. has the account been migrated from mojang accoutn to microsoft account?
  1. Yes i have connection to internet i check that first.
  2. Yes i have original Minecraft
  3. I don’t migrated from mojang to Microsoft :sweat_smile:. Do you think ist meybe the problem?
    One of ten time’s I create server i can connect to it but when I restart the server it cannot verify the name.

Do you think if i dont migrated to minecrosoft from mojang it could make this problem?

No,
It should’nt make a difference, as long as you can authenticate into the Minecraft game launcher, Mojang say your username is valid, and the minecraft server validation should pass.

So it seems like a mistmatch between reigstered auth-sessions, or that you have connectivity issues to the mojang / microsoft servers. From only a “user not validated” this is somehwat hard to say which is.

A quick google gave me this post on the same problem: https://gaming.stackexchange.com/questions/174599/failed-to-login-invalid-session-try-restarting-your-game-minecraft-error . It suggests closing and restarting your java minecraft client since it usually happends if two clients are used at the same time with the same credentials. If this happends a lot, and you are sure you only use one minecraft client, change your password: https://help.minecraft.net/hc/en-us/articles/360035014051-Change-or-Forgot-Password

A not reccomended workaround to the validation error is to set the “online mode” variable to false. This means that your server DO NOT check if a username is reserved and valid. It also means that anyone can use that user name, and get access to your server with all privileges you have given that username. If youare the only player, or other players only play from your own local internet (in the same house / family) this shouldt be to much of a risk, but still.

I Will try it thank you very much. For help.