Closed Khaldi-Anouar closed 1 year ago
@Khaldi-Anouar Thanks for your report. Our team will see if this is something we can fix or maybe is a Unity 2021.3 bug.
@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?
@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?
Hello, I tried with unity 2021.3.8f1 (Empty project with moralis), it doesn't work can you try on different browsers please?
Which browser are you using? Does the introduction scene work?
@KoenRijpstra yeah everything works fine until I click on connect and I sign with Metamask this is the build link https://crimin.itch.io/newmoralis
Which browser are you testing on?
More than one browser! chrome, opera, edge, brave, in some computers it's working on them all, is some computers it working only in some of them, in some computers it doesn't work on all of them
@Khaldi-Anouar We tested on multiple browser and can't replicate the issue. If it is working on some computers and not on others what is the difference between those computers?
Same problem: https://forum.moralis.io/t/unity-moralis-v1-2-7-unauthorized-problem/19297/10 I am using Unity 2021.3.9f1 (latest stable) and i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. How can i fix? Note: I am trying on Unity Editor.
@Khaldi-Anouar I did a test with Unity 2021.3.8f1 and using Chrome version 105.0.5195.52 (Officiële build) (64-bits) and all seems to be working. Maybe Unity 2021.3.7f1 has a issue. Could you test with version 2021.3.8f1?
I installed 2021.3.8f1 and tried with moralis v1.2.7 sdk on Unity Editor. But it's not working. Wallet cannot connect.
@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard:
@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard: I am using v0.0.385 server version. Also, i tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).
@newbiedev1 same like you version, my version is v0.0.385
@Khaldi-Anouar @newbiedev1 Which version of the Moralis server is your dapp running? You can find it in your admin dashboard: I am using v0.0.385 server version. Also, i tried with moralis v1.1.0 and wallet connection is working on Unity Editor. But latest moralis sdks are not working (i tried with v1.2.5 and v1.2.7).
Unity version: 2021.3.8f1 Moralis SDK version: v1.2.7 Server version: v0.0.385 i created empty project. And i added moralis v1.2.7 (latest). Also, i created ropsten test server with moralis. But when i try to connect with my metamask wallet, it has many errors. I have no problem with moralis v1.1.0 sdk.
Isn't there a solution?
At this time we have tried every combination given to us and we have not been able to replicate this issue.
Please do this:
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
foreach (KeyValuePair<string, string> kvp in cmd.Headers)
{
Debug.Log($"{kvp.Key}: {kvp.Value}");
}
5a. If the Debug
is not found, add a using UnityEngine;
statement at the top of the file.
Thank you.
At this time we have tried every combination given to us and we have not been able to replicate this issue.
Please do this:
- Open your project in Visual Studio.
- In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
- Go to line 60
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
- Go to line 60:
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
- Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers) { Debug.Log($"{kvp.Key}: {kvp.Value}"); }
5a. If the
Debug
is not found, add ausing UnityEngine;
statement at the top of the file. 6. Run the app. 7. At authentication, if you receive the error, check the Console log. 8. If the headers were logged, please copy these as TEXT and post them in a new comment. 9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.Thank you.
Thank you for reply. Debug.log:
Content-Type: application/json
UnityEngine.Debug:Log (object)
MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisCommandRunner.cs:64) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner1/<RunCommandAsync>d__17<MoralisUnity.Platform.Objects.MoralisUser>, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21)
Cysharp.Threading.Tasks.UniTaskCompletionSourceCore1<System.Tuple
2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.UniversalWebClient/2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.UniversalWebClient/2<MoralisUnity.Platform.Services.UniversalWebClient/<ExecuteAsync>d__7, System.Tuple
2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313)
Cysharp.Threading.Tasks.Internal.PooledDelegate`1
I tested Unity 2021.3.3f1, 2021.3.4f1, 2021.3.8f1, 2021.3.9f1, 2020.3.0f1. Also, i used moralis sdk 1.2.5 and 1.2.7. Same error on all of them. But , i have tested with moralis old sdk (v1.1.0) and unity 2021.3.9f1, there is no problem. Wallet connection is working.
First error:
Target: https://dhwor46zhuia.usemoralis.com:2053/server/users
UnityEngine.Debug:LogError (object)
MoralisUnity.Platform.Services.UniversalWebClient/2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.Internal.PooledDelegate
1
Second error:
Error: HTTP/1.1 403 Forbidden
{"error":"unauthorized"}
UnityEngine.Debug:LogError (object)
MoralisUnity.Platform.Services.UniversalWebClient/2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.Internal.PooledDelegate
1
Warning error:
LogInAsync failed: {"error":"unauthorized"}
UnityEngine.Debug:Log (object)
MoralisUnity.Platform.Services.ClientServices.MoralisUserService1/<LogInAsync>d__19<MoralisUnity.Platform.Objects.MoralisUser>:MoveNext () (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/MoralisUserService.cs:106) Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask
2<MoralisUnity.Platform.Services.ClientServices.MoralisUserService1/<LogInAsync>d__19<MoralisUnity.Platform.Objects.MoralisUser>, MoralisUnity.Platform.Objects.MoralisUser>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21) Cysharp.Threading.Tasks.UniTaskCompletionSourceCore
1<System.Tuple2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner
1/2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner`1/2<MoralisUnity.Platform.Services.ClientServices.MoralisCommandRunner
1/2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.AwaiterActions:Continuation (object) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.cs:21) Cysharp.Threading.Tasks.UniTaskCompletionSourceCore
1<System.Tuple2<System.Net.HttpStatusCode, string>>:TrySetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTaskCompletionSource.cs:139)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2<MoralisUnity.Platform.Services.UniversalWebClient/2<System.Net.HttpStatusCode, string>>:SetResult (System.Tuple
2<System.Net.HttpStatusCode, string>) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:328)
MoralisUnity.Platform.Services.UniversalWebClient/2<System.Net.HttpStatusCode, string>>:Run () (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:313) Cysharp.Threading.Tasks.Internal.PooledDelegate
1
Third error:
NullReferenceException: Object reference not set to an instance of an object
MoralisUnity.Platform.Services.ClientServices.UserServiceExtensions.LogInWithAsync[TUser] (MoralisUnity.Platform.Abstractions.IServiceHub1[TUser] serviceHub, System.String authType, System.Collections.Generic.IDictionary
2[TKey,TValue] data, System.Threading.CancellationToken cancellationToken) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Platform/Services/ClientServices/UserServiceExtensions.cs:202)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342) MoralisUnity.MoralisClient.LogInAsync (System.Collections.Generic.IDictionary
2[TKey,TValue] data, System.Threading.CancellationToken cancellationToken) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/MoralisClient.cs:221)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342) MoralisUnity.Moralis.LogInAsync (System.Collections.Generic.IDictionary
2[TKey,TValue] authData, System.Int32 chainId) (at Packages/io.moralis.web3-unity-sdk/Runtime/Core/Moralis.cs:320)
Cysharp.Threading.Tasks.CompilerServices.AsyncUniTask`2[TStateMachine,T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/CompilerServices/StateMachineRunner.cs:342)
MoralisUnity.Kits.AuthenticationKit.AuthenticationKit.WalletConnect_SignAndLoginToMoralis (WalletConnectSharp.Unity.WalletConnectUnitySession session) (at Packages/io.moralis.web3-unity-sdk/Runtime/Kits/AuthenticationKit/Scripts/AuthenticationKit.cs:387)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.
At this time we have tried every combination given to us and we have not been able to replicate this issue.
Please do this:
- Open your project in Visual Studio.
- In the Solution Explorer, find and open this file: Packages / io.moralis.web3-unity-sdk / Runtime / Core / Platform / Services / MoralisCommandRunner.cs
- Go to line 60
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd); //, uploadProgress, downloadProgress, cancellationToken);
- Go to line 60:
Tuple<Status, string> cmdResult = await GetWebClient().ExecuteAsync(cmd);
- Add this code:
foreach (KeyValuePair<string, string> kvp in cmd.Headers) { Debug.Log($"{kvp.Key}: {kvp.Value}"); }
5a. If the
Debug
is not found, add ausing UnityEngine;
statement at the top of the file. 6. Run the app. 7. At authentication, if you receive the error, check the Console log. 8. If the headers were logged, please copy these as TEXT and post them in a new comment. 9. If the headers were not logged something else is going on. Please go to your Moralis Server logs. If there are errors please copy the last error logged in a new comment.Thank you.
Are there any solution 🙂
Hello @xactant
I tried what you ask then I took a WebGL build, the headers are correct in both devices (device A where we can and device B where we can't login)
both of them are giving the same debugs, but when I check the headers, there's some missing parameters x-parse-installation-id
and x-parse-application-id
This is the device A (or browser A) no missing headers:
This is the device B (or browser B) with missing headers
@Khaldi-Anouar Does this only happen with users on Turkish networks?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, we were using Moralis for 5-6 months, everything works fine, we're working on WebGL game, our builds was working fine with unity 2020 and above, till decided to upgrade the unity version to 2021, we're having a problem and we're trying to fix it long time ago! the problem is happening when we try to login we're getting this error:
the problem is this problem is not happening on all devices and all browsers, for example if there's a windows where this game can work finely on chrome, and this game couldn't be work on other windows on chrome we figures out that the
x-parse-application-id
(in request header) is missing in the browsers in which we're getting the error!Nb. when we create new empty project and we import the Moralis assets then we take build, we're getting the same error with Unity 2021.3.7f1, but it works fine with Unity 2020. Can you help us to fix the problem?
Unity version: 2021.3.7f1 Web3 Game Kit version: v1.2.7 Development platform: Windows Build platform: WebGL