Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException: JSON Parse error: Unexpected end of input #16842

Closed
AliSoftware opened this issue Jun 30, 2022 · 7 comments
Closed

RuntimeException: JSON Parse error: Unexpected end of input #16842

AliSoftware opened this issue Jun 30, 2022 · 7 comments
Labels
[Deprecated] gutenberg-mobile Deprecated label, use "Gutenberg" instead. [Type] Crash

Comments

@AliSoftware
Copy link
Contributor

AliSoftware commented Jun 30, 2022

Sentry Url: https://sentry.io/share/issue/b392449ada9e45049409392eb4c502af/
User Count: 164
Count: 428
First Release: 19.9-rc-2
First Seen: 2022-05-22T15:53:57.358000Z
Last Seen: 2022-06-30T09:16:32Z
24 Hours: 22
30 Days: 429

RuntimeException: JSON Parse error: Unexpected end of input

SyntaxError: JSON Parse error: Unexpected end of input
    at com.swmansion.reanimated.AndroidErrorHandler.raise(AndroidErrorHandler.java:6)
    at com.swmansion.reanimated.Scheduler.triggerUI(Scheduler.java)
    at com.swmansion.reanimated.Scheduler$1.run(Scheduler.java:24)
    at com.swmansion.reanimated.Scheduler$2.runGuarded(Scheduler.java:43)
    at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:31)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:236)
    at android.app.ActivityThread.main(ActivityThread.java:7889)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

Seems to be related to the reanimated library again (cc @fluiddot ?), yet it's apparently also appearing in 20.1-rc-* and 20.2-rc-1 (while I think we updated the lib recently).


PS: Reporting here in WPAndroid repo rather than gutenberg-mobile, because (1) I couldn't find a similar "JSON Parse error" in Sentry for WPiOS and (2) I think the groundskeeper (cc @twstokes) mostly triage issues in WPiOS/WPAndroid but they might not think to look and triage issues in gutenberg-mobile, so decided to report it here for visibility after all. Let me know if you prefer I do otherwise for cases like this in the future.

@fluiddot
Copy link
Contributor

Definitely, the issue looks related to Reanimated library hence the Gutenberg Mobile side. I did a quick check on the Sentry event and noticed that this crash has more events in version 19.9 than 20.0, however, the adoption for 19.9 is now way lower than 20.0. It's not clear to me the reason for having fewer events on 20.0 because, as far as I checked, we didn't introduce either a dependency update or fix that could have helped reduce the crash 🤔 . In version 20.1, we have introduced an upgrade on react-native-gesture-handler that might help but still, not totally confident that would address it.

Being this said, we should investigate it further in case we can't provide a fix, although I'd like to share that this error is also being reported in the react-native-reanimated repository, and there's no workaround for it yet.

Screenshot 2022-06-30 at 12 19 39

@fluiddot fluiddot added the [Deprecated] gutenberg-mobile Deprecated label, use "Gutenberg" instead. label Jun 30, 2022
@fluiddot fluiddot added this to Triage in Mobile Gutenberg via automation Jun 30, 2022
@fluiddot fluiddot moved this from Triage to Backlog (unscheduled/unassigned) in Mobile Gutenberg Jun 30, 2022
@fluiddot
Copy link
Contributor

@fluiddot
Copy link
Contributor

cc @geriux in case you could take a look at some point and/or provide further insights, thanks 🙇 !

@twstokes
Copy link
Contributor

Thank you all for triaging this! 🙇 If I can help in any way, just let me know.

@geriux
Copy link
Member

geriux commented Jun 30, 2022

cc @geriux in case you could take a look at some point and/or provide further insights, thanks 🙇 !

I'll check it out 👍

@mkevins mkevins self-assigned this Sep 14, 2022
@mkevins
Copy link
Contributor

mkevins commented Sep 14, 2022

I was not able to reproduce this. I wondered whether localization could be a factor in this somehow, or characters being improperly handled during parsing, but I did not see a pattern by locale in Sentry 🤷‍♂️ , so I don't think that is a good hint.

One thing that could be a clue is that I did not see any events reported for Android 12, but did see events for Android 11, 10, 9, and 8.1.0. Perhaps something in the library code is using non-backward-compatible APIs without properly conditioning OS version?

@mkevins mkevins removed their assignment Sep 14, 2022
@ravishanker
Copy link
Contributor

I'm not able to reproduce this. I'm going to close this for now. It can always be opened if there are new instances found.

Mobile Gutenberg automation moved this from Backlog (unscheduled/unassigned) to Done (keep clean, manually) Sep 27, 2022
tomekzaw added a commit to software-mansion/react-native-reanimated that referenced this issue Feb 7, 2023
## Summary

This PR should fix "JSON Parse error: Unexpected end of input" error
from Hermes VM happening when `JSON.parse` invoked by
`jsi::Value::createFromJsonUtf8` (see
[here](https://github.com/facebook/react-native/blob/62fa6d9dac185add0b8998fe1a443beaef3a49bc/ReactCommon/jsi/jsi/jsi.cpp#L139-L144))
fails due to malformed payload.

Related issues:
* Expensify/App#14878
* wordpress-mobile/WordPress-Android#16842
*
#2823

## Test plan

Run Example and FabricExample app on Android.
tomekzaw added a commit to software-mansion/react-native-reanimated that referenced this issue Feb 10, 2023
This PR should fix "JSON Parse error: Unexpected end of input" error
from Hermes VM happening when `JSON.parse` invoked by
`jsi::Value::createFromJsonUtf8` (see
[here](https://github.com/facebook/react-native/blob/62fa6d9dac185add0b8998fe1a443beaef3a49bc/ReactCommon/jsi/jsi/jsi.cpp#L139-L144))
fails due to malformed payload.

Related issues:
* Expensify/App#14878
* wordpress-mobile/WordPress-Android#16842
*
#2823

Run Example and FabricExample app on Android.
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this issue Jun 5, 2023
## Summary

This PR should fix "JSON Parse error: Unexpected end of input" error
from Hermes VM happening when `JSON.parse` invoked by
`jsi::Value::createFromJsonUtf8` (see
[here](https://github.com/facebook/react-native/blob/62fa6d9dac185add0b8998fe1a443beaef3a49bc/ReactCommon/jsi/jsi/jsi.cpp#L139-L144))
fails due to malformed payload.

Related issues:
* Expensify/App#14878
* wordpress-mobile/WordPress-Android#16842
*
software-mansion#2823

## Test plan

Run Example and FabricExample app on Android.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated] gutenberg-mobile Deprecated label, use "Gutenberg" instead. [Type] Crash
Projects
Mobile Gutenberg
  
Done (keep clean, manually)
Development

No branches or pull requests

6 participants