{"record":{"id":"9ef71be4a6578e07","repo":"gibbed/SteamAchievementManager","slug":"failed-to-connect-to-global-user","errorCode":null,"errorMessage":"failed to connect to global user","messagePattern":"failed to connect to global user","errorType":"exception","errorClass":"ClientInitializeException","httpStatus":null,"severity":"error","filePath":"SAM.API/Client.cs","lineNumber":77,"sourceCode":"                throw new ClientInitializeException(ClientInitializeFailure.Load, \"failed to load SteamClient\");\n            }\n\n            this.SteamClient = Steam.CreateInterface<Wrappers.SteamClient018>(\"SteamClient018\");\n            if (this.SteamClient == null)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.CreateSteamClient, \"failed to create ISteamClient018\");\n            }\n\n            this._Pipe = this.SteamClient.CreateSteamPipe();\n            if (this._Pipe == 0)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.CreateSteamPipe, \"failed to create pipe\");\n            }\n\n            this._User = this.SteamClient.ConnectToGlobalUser(this._Pipe);\n            if (this._User == 0)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.ConnectToGlobalUser, \"failed to connect to global user\");\n            }\n\n            this.SteamUtils = this.SteamClient.GetSteamUtils004(this._Pipe);\n            if (appId > 0 && this.SteamUtils.GetAppId() != (uint)appId)\n            {\n                throw new ClientInitializeException(ClientInitializeFailure.AppIdMismatch, \"appID mismatch\");\n            }\n\n            this.SteamUser = this.SteamClient.GetSteamUser012(this._User, this._Pipe);\n            this.SteamUserStats = this.SteamClient.GetSteamUserStats013(this._User, this._Pipe);\n            this.SteamApps001 = this.SteamClient.GetSteamApps001(this._User, this._Pipe);\n            this.SteamApps008 = this.SteamClient.GetSteamApps008(this._User, this._Pipe);\n        }\n\n        ~Client()\n        {\n            this.Dispose(false);\n        }","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/gibbed/SteamAchievementManager/blob/de8b71048a0cee3c3e97cd8535e0f55ca86513e4/SAM.API/Client.cs#L59-L95","documentation":"Client.Initialize throws ClientInitializeException with failure code ConnectToGlobalUser when SteamClient.ConnectToGlobalUser(pipe) returns 0, meaning the pipe was created but the library could not authenticate/attach to Steam's global user session on that pipe.","triggerScenarios":"Calling Client.Initialize(appId) when Steam is running but not logged in (offline/anonymous state), the session is in a transitional state, or the pipe is valid but the global user handle cannot be established.","commonSituations":"Steam open only at the login prompt; Steam in offline mode; Steam client restarting after an update; permission/elevation mismatch between Steam and the calling process.","solutions":["Ensure Steam is fully logged in to an account before initializing","Take Steam out of offline mode / complete any pending update or login","Restart Steam and retry","Run the app with the same privileges as the Steam process"],"exampleFix":"// before\nclient.Initialize(appId);\n// after\ntry { client.Initialize(appId); }\ncatch (ClientInitializeException e) when (e.Failure == ClientInitializeFailure.ConnectToGlobalUser)\n{\n    Console.Error.WriteLine(\"Steam is not logged in; log in and retry.\");\n    RetryAfterDelay(TimeSpan.FromSeconds(5));\n}","handlingStrategy":"try-catch","validationCode":"var steamRunning = System.Diagnostics.Process.GetProcessesByName(\"steam\").Length > 0; // and ensure user is logged in","typeGuard":null,"tryCatchPattern":"try { client.Initialize(appId); }\ncatch (ClientInitializeException e) when (e.Failure == ClientInitializeFailure.ConnectToGlobalUser)\n{\n    // Steam not logged in; ask user to log in then retry\n}","preventionTips":["Log in to Steam before running the tool","Disable offline mode / complete pending updates","Restart Steam if the session appears stuck"],"tags":["steam","session","authentication"],"backgroundTag":"authentication-required","analyzedSha":"de8b71048a0cee3c3e97cd8535e0f55ca86513e4","analyzedAt":"2026-09-12T09:05:06.619Z","contentChangedAt":"2026-09-12T09:05:06.619Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}