MessagingService: Service disconnected

Reproduction Steps
This has happened a few times when I play my project in development, in Studio: I get this error:

MessagingService: Service disconnected

But this occurs many lines after the service has been started.
For example, in the first lines of my script I have:

local MessagingService = game:GetService("MessagingService")

And at the end of the script, I have:

MessagingService:SubscribeAsync('MyMsg', function(Msg)

and here I (rarely) get this error.

But if I run the project again, no errors.

What could it be?
Any way to avoid this?

Expected Behavior
No error, since MessagingService = game:GetService("MessagingService") is correctly declared.

Actual Behavior
Described above

Line 1454 of log file (sent in PM), shows:

2022-03-21T18:34:10.770Z,1956.770142,4bd4,6 [FLog::Error] Error: MessagingService: Service disconnected.

Workaround
As described, I have to stop and play the project again.

Issue Area: Studio
Issue Type: Other
Impact: Moderate
Frequency: Rarely
A private message is associated with this bug report

4 Likes

I suppose you can use a PCall here. Some stuff like this is destined to error regardless if documented or not, probably is a bug, but have a go at using a PCall on it.

GetService will never make a remote call or have transient failures, all that does is get the Lua object, so it makes sense that you never see any errors there.

So, this error is not a bug?


I think it’s still a bug that you’re getting that non-descriptive error on SubscribeAsync, I’m just pointing out the above because your post implied you might be under the impression GetService does any special logic (like remote calls or async stuff), which it does not.

1 Like

Thanks for the report! We’ll follow up when we have an update for you.

4 Likes

Hey @thirdtakeonit, are there any updates on this front?

I’ve just encountered the same error:
image

2 Likes

Getting this error now as well.

Getting a large number of errors with MessagingService with the following error message, related?

This problem has not happened for a long time, so I’m closing this topic.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.