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

Internal URLs not being served in Browserstack #1008

Open
cimigree opened this issue Feb 26, 2025 · 0 comments
Open

Internal URLs not being served in Browserstack #1008

cimigree opened this issue Feb 26, 2025 · 0 comments

Comments

@cimigree
Copy link
Contributor

cimigree commented Feb 26, 2025

Describe the bug
When running our release-candidate APK on BrowserStack, the Mapbox style fails to load and we receive HTTP 502 errors in the logs.

To Reproduce

  1. Build the app with our release-candidate profile (not the test profile) and upload the APK to BrowserStack
  2. Open the app in a BrowserStack device session.
  3. Observe that the map never fully loads and continues to show errors in the logs.

Expected behavior
The map style should successfully load, displaying the custom layers and icons. Instead, the map surfaces repeated HTTP 502 errors when it tries to fetch the style.

Screenshots
Here you can see that the icons don't load either.
Image

Smartphone (please complete the following information):

  • Device/Platform on BrowserStack: e.g. Samsung Galaxy S22 w/ Android 12
  • App version: 1.3.0-pre (release-candidate)
  • Mapbox SDK: @rnmapbox/maps v10.1.33

Additional context

Logs and Observations

Here is a link to the full device logs from Browserstack

The logs in Browserstack show that the style URL returns a 502:

02-25 20:27:13.674 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502

02-25 20:27:13.677 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:13.687 I/ReactNativeJS( 1944): 'Style fetch status:', 502
02-25 20:27:13.705 I/ReactNativeJS( 1944): 'Style fetch body:', '<!DOCTYPE html>\n<html lang="en">\n  <head>\n    <meta charset="UTF-8" />\n    <meta\n      name="viewport"\n      content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0"\n    />\n    <title>Page not found</title>\n    <style>\n      * {\n        margin: 0;\n        padding: 0;\n        outline: 0;\n        box-sizing: border-box;\n      }\n\n      a {\n        color: #0070f0;\n      }\n\n      html {\n        background-color: #e9e7ea;\n        color: #333333;\n      }\n\n      h1 {\n        font-size: 26px;\n        line-height: 32px;\n        font-weight: 400;\n        text-align: center;\n        padding: 30px 20px;\n        padding-bottom: 20px;\n        margin-bottom: -12px;\n      }\n\n      p,\n      small {\n        padding: 0 32px;\n        line-height: 1.5;\n        font-weight: 400;\n        margin: 16px 0 0 0;\n      }\n\n      small {\n        font-size: 16px;\n        color: #666;\n        display: block;\n      }\n\n      p._footer {\n        border-top: 1px solid #eee;\n        padding: 20px 32px 20px 32px;\n        font-size: 14px;\n        color: #333;\n        background: #f9f9f9;\n        border-bottom-left-radius: 3px;\n        border-bottom-right-radius: 3px;\n      }\n\n      body {\n        padding: 20px;\n      }\n\n      .message-modal {\n        max-width: 520px;\n        margin: auto;\n        min-height: 410px;\n        border-radius: 3px;\n        background-color: #ffffff; /* can keep fff but well, old browsers might fail*/\n        box-shadow: 0 4px 7px rgba(0, 0, 0, 0.2);\n        font-family: Helvetica, Arial;\n        font-size: 16px;\n      }\n\n      @media (max-width: 600px) {\n        .message-modal {\n          margin-top: 0;\n          box-shadow: none;\n          min-height: 90vh;\n        }\n\n        body {\n          padding: 0;\n        }\n\n        p._footer {\n          box-shadow: 0px -1px 8px #ddd;\n          position: fixed;\n          bottom: 0;\n          z-index: 2;\n        }\n        h1 {\n          font-size: 23px;\n          font-weight: 400;\n        }\n\n        small ... [truncated]'


02-25 20:27:14.194 D/CompatibilityChangeReporter( 1944): Compat change id reported: 160794467; UID 10528; state: ENABLED
02-25 20:27:14.199 E/Mapbox  ( 1944): [common\DeviceLocationProvider]: Failed to stop: java.lang.Exception: Cannot stop Google device location provider. Invalid mode: NONE
02-25 20:27:14.805 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:14.806 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:15.929 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:15.934 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:16.544 W/System.err( 1944): android.os.DeadObjectException
02-25 20:27:16.545 W/System.err( 1944): 	at android.os.BinderProxy.transactNative(Native Method)
02-25 20:27:16.545 W/System.err( 1944): 	at android.os.BinderProxy.transact(BinderProxy.java:635)
02-25 20:27:16.545 W/System.err( 1944): 	at android.widget.directwriting.IDirectWritingService$Stub$Proxy.unregisterCallback(IDirectWritingService.java:560)
02-25 20:27:16.545 W/System.err( 1944): 	at android.widget.directwriting.DirectWritingServiceBinder.unregisterCallback(DirectWritingServiceBinder.java:371)
02-25 20:27:16.545 W/System.err( 1944): 	at android.widget.directwriting.DirectWritingServiceBinder.access$500(DirectWritingServiceBinder.java:26)
02-25 20:27:16.545 W/System.err( 1944): 	at android.widget.directwriting.DirectWritingServiceBinder$1.onServiceDisconnected(DirectWritingServiceBinder.java:64)
02-25 20:27:16.545 W/System.err( 1944): 	at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:2255)
02-25 20:27:16.545 W/System.err( 1944): 	at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2270)
02-25 20:27:16.545 W/System.err( 1944): 	at android.os.Handler.handleCallback(Handler.java:938)
02-25 20:27:16.561 W/System.err( 1944): 	at android.os.Handler.dispatchMessage(Handler.java:99)
02-25 20:27:16.561 W/System.err( 1944): 	at android.os.Looper.loopOnce(Looper.java:226)
02-25 20:27:16.561 W/System.err( 1944): 	at android.os.Looper.loop(Looper.java:313)
02-25 20:27:16.561 W/System.err( 1944): 	at android.app.ActivityThread.main(ActivityThread.java:8663)
02-25 20:27:16.561 W/System.err( 1944): 	at java.lang.reflect.Method.invoke(Native Method)
02-25 20:27:16.561 W/System.err( 1944): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
02-25 20:27:16.561 W/System.err( 1944): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
02-25 20:27:17.032 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:17.032 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:17.100 D/io_stats(  619): !@ Read_top(KB): ndroid.systemui(2494) 132 location.nsflp2(3941) 120 com.comapeo.rc(1944) 116
02-25 20:27:17.100 D/io_stats(  619): !@ Write_top(KB): com.comapeo.rc(1944) 736 f2fs_ckpt-254:1(659) 436 system_server(1224) 32
02-25 20:27:18.487 I/Mapbox  ( 1944): [tile_store]: Searching for stale partial downloads to clean up
02-25 20:27:18.492 I/Mapbox  ( 1944): [tile_store]: Cleanup of stray partial downloads complete
02-25 20:27:19.167 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:19.167 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:23.377 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:23.378 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:31.530 I/com.comapeo.rc( 1944): Explicit concurrent copying GC freed 631572(20MB) AllocSpace objects, 19(508KB) LOS objects, 49% free, 13MB/27MB, paused 396us,48us total 96.191ms
02-25 20:27:31.611 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:31.612 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:44.316 I/InputDispatcher( 1224): Delivering touch to (1944): action: 0x0, f=0x0, d=0, '7681e8e', t=1 
02-25 20:27:44.317 I/ViewRootImpl@f133d63[MainActivity]( 1944): ViewPostIme pointer 0
02-25 20:27:44.317 I/MSHandlerLifeCycle( 1944): isMultiSplitHandlerRequested: windowingMode=1 isFullscreen=true isPopOver=false isHidden=false skipActivityType=false isHandlerType=true this: DecorView@9e1ee7d[MainActivity]
02-25 20:27:44.332 I/InputDispatcher( 1224): Delivering touch to (1944): action: 0x1, f=0x0, d=0, '7681e8e', t=1 
02-25 20:27:44.333 I/ViewRootImpl@f133d63[MainActivity]( 1944): ViewPostIme pointer 1
02-25 20:27:44.333 I/MSHandlerLifeCycle( 1944): isMultiSplitHandlerRequested: windowingMode=1 isFullscreen=true isPopOver=false isHidden=false skipActivityType=false isHandlerType=true this: DecorView@9e1ee7d[MainActivity]
02-25 20:27:47.751 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:27:47.752 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:27:54.361 I/com.comapeo.rc( 1944): Explicit concurrent copying GC freed 128239(3963KB) AllocSpace objects, 6(120KB) LOS objects, 49% free, 13MB/26MB, paused 52us,48us total 66.819ms
02-25 20:28:17.244 I/com.comapeo.rc( 1944): Explicit concurrent copying GC freed 103407(2917KB) AllocSpace objects, 1(20KB) LOS objects, 49% free, 13MB/27MB, paused 196us,48us total 83.765ms
02-25 20:28:19.865 E/Mapbox  ( 1944): [maps-core]: {com.comapeo.rc}[Setup]: Failed to load style: HTTP status code 502
02-25 20:28:19.865 E/Mapbox  ( 1944): [maps-android\Mbgl-StyleObserver]: OnMapLoadError: Style, message: Failed to load style: HTTP status code 502, sourceID: null, tileID: null
02-25 20:28:25.540 I/InputDispatcher( 1224): Delivering touch to (1944): action: 0x0, f=0x0, d=0, '7681e8e', t=1 
02-25 20:28:25.554 I/ViewRootImpl@f133d63[MainActivity]( 1944): ViewPostIme pointer 0
02-25 20:28:25.554 I/MSHandlerLifeCycle( 1944): isMultiSplitHandlerRequested: windowingMode=1 isFullscreen=true isPopOver=false isHidden=false skipActivityType=false isHandlerType=true this: DecorView@9e1ee7d[MainActivity]

Relevant References

BrowserStack docs on managing local / internal connections
The style is hosted on a localhost endpoint. Here are the docs I found: https://www.browserstack.com/docs/app-automate/appium/test-on-internal-network/manage-incoming-connections

Additional context
Even after enabling Local Testing in BrowserStack, the device still returns 502 when requesting our internal style endpoint.
After some checking via logging, the Fastify server is definitely starting appropriately and is not stopping early.

Guesses
The on-device Node Server seems like it might not be responding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant