Web page not available

The sample web application throws an error message when launched on a mobile phone types Huawei P30 with android 10.
The error message is:

Webseite nicht verfügbar
Die Website unter http://localhost:31337/apps/com.example.myapp/index.html konnte nicht geladen, weil:
net::ERR_CONNECTION_REFUSED

Steps to reproduce

Go through the steps for Building and Running Web App in the manuals

After the app is correctly deployed and launched on the phone, it will not launch.
The error message is:

Note: Deployment on Sumsung Tablet with android 9 works fine

My Configuration

  • Huawei P30 Lite New Edition with android 10.
  • ActyxOS 1.1.1
    • installed from Google Play Store with default settings
  • ax Actyx CLI 1.1.2

Hey @Mugdin, thanks for reporting this.

Could you also please provide the logs from the device?
Either via adb logcat , or ax logs tail ; preferably from the start of the application until the error is observed.

Thanks so much!

App is stopped

ax apps ls --local 192.168.178.35

+----------------+-------------------+---------+----------+---------+----------+---------+---------+
| NODE ID        | APP ID            | VERSION | ENABLED  | STATE   | SETTINGS | LICENSE | STARTED |
+----------------+-------------------+---------+----------+---------+----------+---------+---------+
| 192.168.178.35 | com.example.myapp | 1.0.0   | DISABLED | STOPPED | VALID    | VALID   |         |
+----------------+-------------------+---------+----------+---------+----------+---------+---------+

Start App:
ax apps start com.example.myapp --local 192.168.178.35

ax apps ls --local 192.168.178.35

+----------------+-------------------+---------+---------+---------+----------+---------+-------------------------------------+
| NODE ID        | APP ID            | VERSION | ENABLED | STATE   | SETTINGS | LICENSE | STARTED                             |
+----------------+-------------------+---------+---------+---------+----------+---------+-------------------------------------+
| 192.168.178.35 | com.example.myapp | 1.0.0   | ENABLED | RUNNING | VALID    | VALID   | 2021-03-15T16:29:47.614977056+00:00 |
+----------------+-------------------+---------+---------+---------+----------+---------+-------------------------------------+

Corresponding LOG File

2021-03-15 16:27:24.579 UTC INFO axosnode::android::android_handler App state change: ToAndroid { payload: Some(StartApp(StartApp { app_id: "com.example.myapp", settings: "", url: "" })) }; 
2021-03-15 16:29:47.549 UTC INFO axosnode::android::android_handler Received message from Android: ToNative { payload: Some(AppEnabled(AppEnabled { app_id: "com.example.myapp" })) }; 
2021-03-15 16:29:47.550 UTC INFO axosnode::android::android_handler App state change: ToAndroid { payload: Some(StartApp(StartApp { app_id: "com.example.myapp", settings: "", url: "" })) }; 
2021-03-15 16:29:47.614 UTC INFO axosnode::android::android_handler Received message from Android: ToNative { payload: Some(AppStarted(AppStarted { app_id: "com.example.myapp" })) }; 

[NOTE]

it take a lot of time until app change state from ‘stopped’ to ‘running’ and vice versa

1 Like

Hey @Mugdin,

thanks for your explanation! Would be very helpful to get the logs from the moment ActyxOS started until the moment the error with the app is observed. You could also just paste all logs you have with ax logs tail --all-entries --local 192.168.178.35, that would be very helpful!

Thanks,
Oliver

Hi Oliver,
here as requested the whole LOG-File created with

ax logs tail --all-entries --local 192.168.178.35 >> actyxos.log

regards
Mugdin

(Attachment actyxos.log is missing)

Got the logs (thanks @Mugdin) and attached to our internal issue tracker so @wngr can access them.

Hey Mugdin,

thanks for the logs. Before we dive deeper, it seems that the port is already allocated on the device you’re using (and ActyxOS is not gracefully handling that case, which would be a bug!):

2021-03-13 17:42:51.478 UTC ERROR NIO java.net.BindException: Address already in use
2021-03-13 17:42:51.479 UTC ERROR NIO at sun.nio.ch.Net.bind0(Native Method)
2021-03-13 17:42:51.479 UTC ERROR NIO at sun.nio.ch.Net.bind(Net.java:442)
2021-03-13 17:42:51.480 UTC ERROR NIO at sun.nio.ch.Net.bind(Net.java:434)
2021-03-13 17:42:51.481 UTC ERROR NIO at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
2021-03-13 17:42:51.482 UTC ERROR NIO at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
2021-03-13 17:42:51.482 UTC ERROR NIO at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67)
2021-03-13 17:42:51.485 UTC ERROR NIO at n1.f.a.f.run(Unknown Source:35)
2021-03-13 17:42:51.490 UTC ERROR NIO at n1.f.a.d$b.run(Unknown Source:2)
2021-03-13 17:42:51.491 UTC ERROR NIO at n1.f.a.d.a(Unknown Source:46)
2021-03-13 17:42:51.495 UTC ERROR NIO at n1.f.a.d.g(Unknown Source:0)
2021-03-13 17:42:51.500 UTC ERROR NIO at n1.f.a.d.d(Unknown Source:0)
2021-03-13 17:42:51.501 UTC ERROR NIO at n1.f.a.d$a.run(:1)

Now that could either be caused by a bug in ActyxOS, or another process is running which bound to that port. Could you check the port 31337 on that device?
This could be done for example via adb shell netstat -tuln (please paste the output!).

I can’t find anything suspicious. Here are my steps:

adb devices
List of devices attached
FUNDU20907000347	device

adb shell netstat -tuln | grep  31337
[empty]
adb shell netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:4001            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:4454          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:4457            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:4458            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:4243          0.0.0.0:*               LISTEN     
tcp        0      0 192.168.178.35:62110    0.0.0.0:*               LISTEN     
tcp        0      0 192.168.178.35:4001     192.168.178.31:59632    ESTABLISHED
tcp        0      1 192.168.178.35:38460    142.250.186.67:443      SYN_SENT   
tcp        0      0 192.168.178.35:57322    142.250.185.196:443     CLOSE_WAIT 
tcp        0      1 192.168.178.35:38462    142.250.186.67:443      SYN_SENT   
tcp      130      0 192.168.178.35:50502    142.250.185.106:443     CLOSE_WAIT 
tcp      130      0 192.168.178.35:34340    142.250.186.138:443     CLOSE_WAIT 
tcp6       0      0 ::ffff:192.168.17:45498 ::ffff:64.233.167.:5228 ESTABLISHED
tcp6       0      1 2001:16b8:1edb:b6:41044 2a00:1450:4001:808::443 SYN_SENT   
tcp6       0      0 ::ffff:192.168.17:51346 ::ffff:213.198.10.:5061 ESTABLISHED
tcp6       0      1 2001:16b8:1edb:b6:41046 2a00:1450:4001:808::443 SYN_SENT   
tcp6       0      0 ::ffff:192.168.17:32994 ::ffff:80.158.32.9:5223 ESTABLISHED
udp        0      0 0.0.0.0:32775           0.0.0.0:*                          
udp        0      0 192.168.178.35:68       192.168.178.1:67        ESTABLISHED
udp        0      0 0.0.0.0:5353            0.0.0.0:*                          
udp        0      0 0.0.0.0:5684            0.0.0.0:*                          

We could not reproduce the behaviour on an Android 10 device running ActyxOS 1.1.1, unfortunately. We assume there are some device specific restrictions on your phone in place.
I’ll be in touch directly to help you debug this further on your device.