[3.5.0-beta.1] Avatar upload fails on Linux Editor
available in future release
ミツアミめがね
Hello, trying out the 2022 Editor on Linux.
After updating the packages, I verified both
com.vrchat.avatars
and com.vrchat.base
showing 3.5.0-beta.1
in their own package.json
files respectively.However, the VRC SDK "Validations" section is still complaining that I should be using Unity 2019.4.31f1.
This is a clean project that I've imported assets into. I'm not trying to upgrade a project from Unity 2019.
Building locally works, but uploading fails on a POST request:
NullReferenceException: Object reference not set to an instance of an object
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Values () (at <bb088ab5ef6b437f85ed9cbe6066127e>:0)
System.Reflection.RuntimePropertyInfo.GetterAdapterFrame[T,R] (System.Reflection.RuntimePropertyInfo+Getter`2[T,R] getter, System.Object obj) (at <bb088ab5ef6b437f85ed9cbe6066127e>:0)
System.Reflection.RuntimePropertyInfo.GetValue (System.Object obj, System.Object[] index) (at <bb088ab5ef6b437f85ed9cbe6066127e>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimePropertyInfo.GetValue (System.Object obj, System.Object[] index) (at <bb088ab5ef6b437f85ed9cbe6066127e>:0)
System.Reflection.PropertyInfo.GetValue (System.Object obj) (at <bb088ab5ef6b437f85ed9cbe6066127e>:0)
VRC.SDKBase.Editor.Api.VRCTools.IncreaseSendBuffer (System.Uri targetUrl, System.Threading.Tasks.Task sendRequest, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs:111)
VRC.SDKBase.Editor.Api.VRCApi.MakeRequestWithResponse[T,TResponse] (System.String requestUrl, System.Net.Http.HttpMethod method, System.Collections.Generic.Dictionary`2[TKey,TValue] queryParams, System.Boolean forceRefresh, T body, System.String contentType, System.Byte[] contentMD5, System.Int32 contentLength, System.Int32 timeout, System.Action`1[T] onProgress, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCApi.cs:268)
VRC.SDKBase.Editor.Api.VRCApi.MakeRequest[T,TResponse] (System.String requestUrl, System.Net.Http.HttpMethod method, System.Collections.Generic.Dictionary`2[TKey,TValue] queryParams, System.Boolean forceRefresh, T body, System.String contentType, System.Byte[] contentMD5, System.Int32 contentLength, System.Int32 timeout, System.Action`1[T] onProgress, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCApi.cs:340)
VRC.SDKBase.Editor.Api.VRCApi.Post[T,TResponse] (System.String requestUrl, T body, System.Collections.Generic.Dictionary`2[TKey,TValue] queryParams, System.Boolean forceRefresh, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCApi.cs:385)
VRC.SDKBase.Editor.Api.VRCApi.UploadFile (System.String filename, System.String fileId, System.String friendlyFileName, System.Action`2[T1,T2] onProgress, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCApi.cs:765)
VRC.SDKBase.Editor.Api.VRCApi.CreateNewAvatar (System.String id, VRC.SDKBase.Editor.Api.VRCAvatar data, System.String pathToBundle, System.String pathToImage, System.Action`2[T1,T2] onProgress, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCApi.cs:660)
VRC.SDK3A.Editor.VRCSdkControlPanelAvatarBuilder.BuildAndUpload (UnityEngine.GameObject target, VRC.SDKBase.Editor.Api.VRCAvatar avatar, System.String thumbnailPath, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/VRCSdkControlPanelAvatarBuilder.cs:2321)
Rethrow as UploadException: Exception has been thrown by the target of an invocation.
VRC.SDK3A.Editor.VRCSdkControlPanelAvatarBuilder.BuildAndUpload (UnityEngine.GameObject target, VRC.SDKBase.Editor.Api.VRCAvatar avatar, System.String thumbnailPath, System.Threading.CancellationToken cancellationToken) (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/VRCSdkControlPanelAvatarBuilder.cs:2363)
VRC.SDK3A.Editor.VRCSdkControlPanelAvatarBuilder+<>c__DisplayClass104_0.<CreateBuildGUI>b__4 () (at ./Packages/com.vrchat.avatars/Editor/VRCSDK/SDK3A/VRCSdkControlPanelAvatarBuilder.cs:1817)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <bb088ab5ef6b437f85ed9cbe6066127e>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:153)
UnityEngine.UnitySynchronizationContext.Exec () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:83)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:107)
Log In
Fax
available in future release
Thank you for reporting this issue! It will be fixed in the next SDK release.
ミツアミめがね
As of
3.5.0
(non-beta), I'm no longer able to even locally build the avatar, the entire Unity editor crashes with segfault, with the last on-screen message being "Building Manifest". (Same thing applies to Build & Publish)MisutaaAsriel
ミツアミめがね: See this: Avatar Upload Crashes Unity On Non-Windows Platforms
I thought it was exclusive to the Apple Silicon versions of Unity Editor, but if you are on Linux using an Intel machine, then these means the fault is on more than just Apple platforms.
MisutaaAsriel
ミツアミめがね: do you use Poiyomi, or the Thry Editor tools per chance, either or?
ミツアミめがね
MisutaaAsriel: I only use avatar SDK and LilToon
MisutaaAsriel
ミツアミめがね: Then your issue is probably different from mine. Turns out an issue with Thry Editor (part of Poiyomi) was the blame for my crash, it just behaved in a similar fashion. I'll leave my report open since there is still relevance to it, I feel, but my issue alone was resolved.
Shhasum
Same on OSX. I was able to work around the issue by patching VRCTools.cs.
I don't know if the code actually works properly. It is trying to dig around in the internals of Mono, but I suspect that things may have changed around. The whole block is digging around in things without taking a lock. Seems racy.
--- /Users/bdragon/Documents/VRCTools.cs.bak.txt 2023-12-08 20:31:09
+++ Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs 2023-12-08 20:51:28
@@ -108,7 +108,12 @@ namespace VRC.SDKBase.Editor.Api
{
continue;
}
- var groups = (IEnumerable)groupsList?.GetValue(servicePointGroups.GetValue(scheduler));
+ var servicePointGroup = servicePointGroups?.GetValue(scheduler);
+ if (servicePointGroup == null)
+ {
+ continue;
+ }
+ var groups = (IEnumerable)groupsList?.GetValue(servicePointGroup);
// we're going to retry finding the active service point
if (groups == null)
Shhasum
Interestingly, I just checked my Player settings and noticed that the API Compatibility Level was set to ".NET Framework" instead of ".NET Standard 2.1." I don't know if that has any bearing on the issue, but I would have expected the Player settings to be updated.
ミツアミめがね
Shhasum: I can't seem to be able to get it on .NET Standard. Selecting it from the drop down causes it to re-compile scripts but then it changes back to .NET Framework on its own.
Edit: As soon as
com.vrchat.base
is installed, it's stuck on .NET FrameworkMisutaaAsriel
ミツアミめがね: Same.
Shhasum
MisutaaAsriel: That was just a theory as to why this is somehow working on Windows without breaking in the same way. The patch I posted above is how I fixed it locally. Can also just return from IncreaseSendBuffer() in VRCTools.cs early, because it's just a speed optimization that tries to poke around in the networking internals to speed up file uploads.
MisutaaAsriel
Shhasum: Can confirm this change works under Rosetta 2.
MisutaaAsriel
Shhasum: https://feedback.vrchat.com/sdk-bug-reports/p/350bug-race-condition-in-vrctoolscs Provided a separate bug report that's a little more direct; credited you with finding the information.
ミツアミめがね
Update: with
3.5.0
(non-beta) it no longer complains about the Unity version, but the upload still fails.MisutaaAsriel
ミツアミめがね: I'm having a similar issue on macOS. It returns no errors except that the upload failed.