Send failed since rewinding of the data stream...

More
7 years 2 weeks ago - 7 years 2 weeks ago #2608 by pete
I just installed the plugin and followed the video to create a goggle drive access.
I pasted the link in the Web Service URL, can validate it, can create new spreadsheet, can access them, can see them, etc.

When I do translate all, I have this error : Send failed since rewinding of the data stream failed.

I don't know if this is linked or not (and I'm not sure I should create another thread), but I can't add term to source from the menu (when I click on the item), I need to click at the bottom of the language source to make it work ...
NullReferenceException: Object reference not set to an instance of an object
I2.Loc.LocalizationEditor.OnGUI_Keys_Languages (System.String Key, I2.Loc.Localize localizeCmp, Boolean IsPrimaryKey) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:181)
I2.Loc.LocalizationEditor.OnGUI_KeyList_ShowKeyDetails () (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:40)
I2.Loc.LocalizationEditor.OnGUI_KeysList (Boolean AllowExpandKey, Single Height, Boolean ShowTools) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms.cs:130)
I2.Loc.LocalizationEditor.OnGUI_Main () (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:64)
I2.Loc.LocalizationEditor.OnInspectorGUI () (at Assets/I2/Localization/Scripts/Editor/Inspectors/LanguageSourceInspector.cs:160)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1240)
UnityEditor.DockArea:OnGUI()

Error for stream failed:
Send failed since rewinding of the data stream failed
UnityEngine.Debug:LogError(Object)
I2.Loc.LocalizationEditor:ShowMessage(String, MessageType, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:215)
I2.Loc.LocalizationEditor:ShowError(String, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:200)
I2.Loc.<OnGUI_Keys_Languages>c__AnonStorey1:<>m__0(String, String) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:255)
I2.Loc.<Translate>c__AnonStorey1:<>m__0(Dictionary`2, String) (at Assets/I2/Localization/Scripts/Google/GoogleTranslation.cs:52)
I2.Loc.<WaitForTranslation>c__Iterator0:MoveNext() (at Assets/I2/Localization/Scripts/Google/GoogleTranslation_Post.cs:108)
I2.Loc.<Start>c__AnonStorey1:<>m__0() (at Assets/I2/Localization/Scripts/Utils/CoroutineManager.cs:39)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Also,

If I do a Replace or Merge from Export, it says : Unable to access google.
Last edit: 7 years 2 weeks ago by pete.

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #2609 by Frank
Hi,
What version of Unity are you using?
There is was a unity bug in one of the releases (was fixed in later versions and patches), where doing a web POST call where the website does a redirect (like the one Google does), was not properly managed by Unity WWW class. And it gave an error related to the rewinding.

I solve that for the Translate by doing first a POST call and if that failed, fallback to a GET. But I haven't implemented a workaround for that bug in the Export/Import from Spreadsheets.

Please, let me know what Unity version is that so that I could try it there and find a workaround for that as well.

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #2610 by pete
Hi Frank,

Thanks for the quick answer.

Here are the infos:
I use Unity 5.6.3p1 (personal edition - patched version)
I have the latest version of your plugin (2.8.1f1)
I have a clean project.

About the "Unable to access google", I still can see that my sheet is updated, but I still have the error popping in Unity ...

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #2611 by Frank

I don't know if this is linked or not (and I'm not sure I should create another thread), but I can't add term to source from the menu (when I click on the item),


I found the issue for the first problem, what happens its that on the last release I added support for autodetecting the term type based on the context (Font, Sprite, Text, etc).
The code that does that, is reused for both the Language Source and the Localize component, but I didn't test it in the language Source, just the Localize component. Sorry!

To fix the issue, just add
localizeCmp!=null &&
to the if at Assets\I2\Localization\Scripts\Editor\Localization\LocalizationEditor_Terms_Description.cs line 181

It should look like:
                        var termType = eTermType.Text;
                        if (localizeCmp!=null && localizeCmp.mLocalizeTarget != null)
                        {
                            termType = IsPrimaryKey ? localizeCmp.mLocalizeTarget.GetPrimaryTermType(localizeCmp)
                                                    : localizeCmp.mLocalizeTarget.GetSecondaryTermType(localizeCmp);
                        }

Will be adding that fix to 2.8.2a2 later today, and upload it to the beta folder.

About the "Unable to access google", I still can see that my sheet is updated, but I still have the error popping in Unity ...


That's the expected behavior (well, the expected result considering the Unity bug :-( )
What happens its that on Export, I send all the data to google using a POST call.
The Google Webservice reads the data correctly and updates the spreadsheet. But when it finishes, Google finalizes the POST call and sends back to unity an empty result. But it does that using a redirect to that empty data.
When unity receives that, it sees the redirect url, but that unity version has a bug that fails when there is a redirect. So, you get the error message.
I'm not doing anything with the result, I DONT WANT THE RESULT! haha, but still the www fails and unity complains about that.

I'm going to see if I can make an override in my code, to not report the unity error in that case if its a redirect error, given that I'm not doing anything with the returning data.

Will include the fix in 2.8.2a2 as well.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #2612 by pete
Thanks,

That was fast. I don't mind bugs (well, not when you want to ship), it happens, we just need to make sure they don't stay in the way for too long.
I'll wait for the beta version :) I'm not in a rush anyway, just exploring the plugin.

So just to confirm with you as I receive two kind of message log with the same issue:
I get this message in the regular (Debug)Log: Send failed since rewinding of the data stream failed... UnityEngine.Debug:Log(Object) ... when I want to Export something (which is what you talk about).

But I receive it as a (Debug)LogError when I try to use Translate All.

Both are related?

Thanks again.

Please Log in or Create an account to join the conversation.

More
7 years 2 weeks ago #2618 by Frank
Hi,
Both errors are related (happen through different code paths, but the same issue).

Here is a fix: inter-illusion.com/forum/i2-localization...data-stream-fai#2617

I also uploaded v2.8.2a2 to the beta folder.
Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The following user(s) said Thank You: pete

Please Log in or Create an account to join the conversation.

Time to create page: 0.217 seconds
Template by JoomlaShine