Launcher icon indicating copy to clipboard operation
Launcher copied to clipboard

Mojang accounts experiencing issues when offline for too long

Open debwoink opened this issue 3 years ago • 20 comments

Operating System

Windows

Description of bug

Mojang accounts are timing out and requiring a full removal and re-add of Mojang credentials to play offline SP instead of allowing unlimited offline/no-internet offline SP as older versions of both MultiMC and the Mojang Launcher allow.

Steps to reproduce

Wait 24-48 hours Attempt to launch a game offline - will not launch, pops error "The account has expired and needs to be logged into manually again" Attempt to launch a game online - same as above Attempt to refresh credentials - status goes from "Expired" to "working" and near-instantly returns to "Expired" Remove account and re-add via Mojang credentials Account will now work for another 24-48 hours.

Suspected cause

Chunks from error log:

    2.290 W QCoreApplication::postEvent: Unexpected null receiver
    2.290 D Task "LaunchController(0x6754db0)" starting for the first time
    3.893 C Task "LaunchController(0x6754db0)" failed:  "The account has expired and needs to be logged into manually again."
    3.893 W QCoreApplication::postEvent: Unexpected null receiver
  346.067 W QCoreApplication::postEvent: Unexpected null receiver
  346.068 D Task "LaunchController(0x67544b0)" starting for the first time
  384.062 C Task "LaunchController(0x67544b0)" failed:  "The account has expired and needs to be logged into manually again."
  384.062 W QCoreApplication::postEvent: Unexpected null receiver
 1303.810 W QCoreApplication::postEvent: Unexpected null receiver
 1303.810 D Task "LaunchController(0x67544b0)" starting for the first time
 1304.737 C Task "LaunchController(0x67544b0)" failed:  "The account has expired and needs to be logged into manually again."
 1304.737 W QCoreApplication::postEvent: Unexpected null receiver

Sterile account.json w/o expiration element:

{
    "accounts": [
        {
            "active": true,
            "canMigrateToMSA": true,
            "profile": {
                "capes": [
                ],
                "id": "",
                "name": "",
                "skin": {
                    "data": "",
                    "id": "",
                    "url": "",
                    "variant": "CLASSIC"
                }
            },
            "type": "Mojang",
            "ygg": {
                "extra": {
                    "clientToken": "",
                    "userName": ""
                },
                "iat": 1640578529,
                "token": ""
            }
        }
    ],
    "formatVersion": 3
}

Potential change responsible: https://github.com/MultiMC/Launcher/blob/d37003b1de68a74fc1dbe83128faae76f15e03d2/launcher/minecraft/auth/MinecraftAccount.cpp#L211

This issue is unique

  • [X] I have searched the issue tracker and did not find an issue describing my bug.

debwoink avatar Dec 27 '21 05:12 debwoink

This looks like an expired account, and that's about it. Actually, it looks outright invalid.

Are you copying your accounts file to multiple machines?

What exactly do you mean by offline?

peterix avatar Dec 27 '21 17:12 peterix

I removed any potentially identifying or account-compromising information from the JSON before posting it to this public issue tracker, and left the structure intact, if that's what you meant by outright invalid. I'm not copying my account to other devices, or doing anything with files in the MultiMC directory at all. By offline I mean using the "launch offline" option in MultiMC.

debwoink avatar Dec 31 '21 18:12 debwoink

I just opened MultiMC after a few months of not playing, updated MultiMC and got this error too... I was confused about how I'm meant to fix it. I'm sure in older versions you just got prompted to enter your password again and away you went.

I didn't want to go and delete my account profile, so I tried re-adding the same account without deleting it. MultiMC seemed OK with this, and changed the existing account in the list to "online". If this is the correct way to fix it, could you change the error to explain this? Or bring back the old password prompt instead?

supertin avatar Jan 11 '22 10:01 supertin

I'm having a similar issue. (I'm not sure it's the same as reported in this thread, so please let me know if I should post it as a new issue.)

My Mojang accounts regularly "expire," even if I've used them less than 24 hours ago. The following screenshot shows an example of what I saw in my MultiMC GUI this morning, even though I used the account last night.

Screenshot 2022-01-21-090005

To get an expired account working again, I'm forced to click Remove, and then Add Mojang. It would be nice if the Refresh button prompted me to re-enter the password or something, but I guess that is a separate feature request, :-)

ejm554 avatar Jan 21 '22 15:01 ejm554

I see this is marked as "needs-repro" - I can reproduce this consistently by trying to connect on my school network, which blocks the Mojang auth servers. MultiMC tries to connect multiple times then marks the account as expired, at which point I can't play offline again. I'll upload a video to demonstrate

Heath123 avatar Jan 28 '22 09:01 Heath123

Here is a video: https://youtu.be/kfdnclRS1eo

Heath123 avatar Jan 28 '22 09:01 Heath123

I actually managed to get it back to "online" by just deleting the account and re-adding it.

joernott avatar Jan 30 '22 15:01 joernott

I actually managed to get it back to "online" by just deleting the account and re-adding it.

Me too. But I hope we agree that can be annoying, especially when you have to do it frequently. One of our Mojang accounts recently started expiring every day. I'm not clear if this is a MultiMC bug or something else. Can anyone shed light on why accounts expire?

ejm554 avatar Jan 30 '22 15:01 ejm554

Tried MultiMC today (after many months of not using it or playing Minecraft).

Auth did not work. Account was listed as Type:Legacy and Status:Expired. Refreshing did not help.

Re-adding the account fixed it. I used the "Add Mojang" button and entered my legacy credentials (username, not email address). It's now Type:Mojang and Status:Online; and I'm able to download and play new versions.

Veyrdite avatar Feb 10 '22 00:02 Veyrdite

I am getting a similar issue, I have to relog every day. For me it's with microsoft account, on top of that it has trouble reconnecting to microsoft for some reason, while microsoft says I'm logged in and MultiMC is allowed to use my account, MultiMc just gives an error (not really a related issue I think but I'm trying to fix that by using the dev updates)...

Kerrghan avatar Feb 10 '22 11:02 Kerrghan

Same issue here, its annoying af image

nicecraftz avatar Feb 10 '22 14:02 nicecraftz

I fixed this for myself with some code tweaks but it's not really clean enough to PR because it duplicates code, I can post it anyway though

Heath123 avatar Feb 10 '22 16:02 Heath123

This was done on CENSORED (as that was easier and doesn't make me have no branding if I need to make custom patches like this) and not tested on MultiMC, but it should work here too. At https://github.com/MultiMC/Launcher/blob/develop/launcher/LaunchController.cpp#L213:

CENSORED

I need to properly understand how this loop works so I can do it without duplicating code

Heath123 avatar Feb 10 '22 16:02 Heath123

This only works for launching in offline mode, it doesn't refresh the account or stop it from expiring, but I thought it would be better to post it here in case anyone wants it

Heath123 avatar Feb 10 '22 16:02 Heath123

Code from CENSORED will not be merged here without a signed agreement from the author agreeing to re-license it from GPL to Apache v2.

Forkk avatar Feb 10 '22 17:02 Forkk

I have removed the poisoned code.

peterix avatar Feb 10 '22 17:02 peterix

The code in question was a patch that I wrote, it was not copied from XXX, I just meant that I only tested it there

Well I did copy/paste some code from another part of the file but I don't think that code is any different to the code already in MultiMC

Heath123 avatar Feb 11 '22 09:02 Heath123

Well, in any case, Mojang login will be getting removed from the launcher.

Starting on 10 March 2022, your Mojang account, which is used to play Minecraft: Java Edition, must be migrated to a Microsoft account to continue playing. Don't worry – everything about your game and how you play will remain the same, including your in-game username, progress, creations and skins. The only change is how you'll log in. Plus, we'll give you a special cape just for migrating!

We're a month away from that.

peterix avatar Feb 14 '22 11:02 peterix

This happens for me with my Microsoft account, I didn't see the title

My issue is a probably a separate thing to the main one

Heath123 avatar Feb 14 '22 13:02 Heath123

Same thing is happening with MS accounts. Mine came up expired last night. Only converted it yesterday.

supertin avatar Feb 17 '22 12:02 supertin

Closing for inactivity.

peterix avatar Aug 12 '22 11:08 peterix