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

Video streaming fails when server URL is in ip:port format #8652

Closed
Drqf opened this issue Jul 3, 2021 · 11 comments
Closed

Video streaming fails when server URL is in ip:port format #8652

Drqf opened this issue Jul 3, 2021 · 11 comments
Labels

Comments

@Drqf
Copy link

Drqf commented Jul 3, 2021

Through the domain name connection, the video can be played normally. But can not play video via ip connection. ip connection is the LAN connection.

Environment data

Android version: 11

Device model: Redmi K30pro

Stock or customized system:

Nextcloud app version: dev 20210629

Nextcloud server version: 21.0.1

Reverse proxy:

No exception in the log.

@Drqf Drqf added the bug label Jul 3, 2021
@KapriQ
Copy link

KapriQ commented Nov 12, 2021

Is there any solution or at least any workaround? ... i am new to nextcloud but this issue is making no sense...

@Drqf
Copy link
Author

Drqf commented Nov 22, 2021

Is there any solution or at least any workaround? ... i am new to nextcloud but this issue is making no sense...

Customizing hosts on the router can temporarily solve this problem

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Nov 22, 2021

@Drqf @KapriQ are any of you able to post a logcat of the error? I am unfortunately unable to reproduce it.

@Drqf
Copy link
Author

Drqf commented Nov 25, 2021

@Drqf @KapriQ are any of you able to post a logcat of the error? I am unfortunately unable to reproduce it.

About the video playback, I have time to reproduce it tomorrow. Now there is another problem about logging in. Tomorrow I will change to port 443 and test the video playback after successful login

************ CAUSE OF ERROR ************

java.lang.IllegalArgumentException: Illegal character in scheme name at index 0: 192.168.0.188:888
at java.net.URI.create(URI.java:849)
at com.owncloud.android.authentication.AuthenticatorUrlUtils.normalizeScheme(AuthenticatorUrlUtils.java:103)
at com.owncloud.android.authentication.AuthenticatorActivity.checkOcServer(AuthenticatorActivity.java:774)
at com.owncloud.android.authentication.AuthenticatorActivity.lambda$initOverallUi$0$com-owncloud-android-authentication-AuthenticatorActivity(AuthenticatorActivity.java:543)
at com.owncloud.android.authentication.AuthenticatorActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7498)
at android.view.View.performClickInternal(View.java:7475)
at android.view.View.access$3600(View.java:833)
at android.view.View$PerformClick.run(View.java:28673)
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:7876)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0: 192.168.0.188:888
at java.net.URI$Parser.fail(URI.java:2894)
at java.net.URI$Parser.checkChars(URI.java:3067)
at java.net.URI$Parser.checkChar(URI.java:3077)
at java.net.URI$Parser.parse(URI.java:3093)
at java.net.URI.(URI.java:585)
at java.net.URI.create(URI.java:847)
... 15 more

************ APP INFORMATION ************
ID: com.nextcloud.android.beta
Version: 20211124
Build flavor: versionDev

************ DEVICE INFORMATION ************
Brand: Redmi
Device: lmipro
Model: Redmi K30 Pro Zoom Edition
Id: RKQ1.200826.002
Product: lmipro

************ FIRMWARE ************
SDK: 30
Release: 11
Incremental: V12.5.7.0.RJKCNXM

@AlvaroBrey
Copy link
Member

That gives me an idea of where the error may be coming from, thanks. The login issue should be fixed by #9354, but I'm guessing a similar thing is happening in video playback.

@Drqf
Copy link
Author

Drqf commented Nov 26, 2021

That gives me an idea of where the error may be coming from, thanks. The login issue should be fixed by #9354, but I'm guessing a similar thing is happening in video playback.

Thanks for reply. About the video playback, I reproduced it again today. Seems to be the cause of timeout.
Regarding the login, it still exists on the development version of 20211125, and logging in with 192.168.0.188:888 is still the previous exception.

2021-11-26T19:47:49.668+0800;I;OCFileListFragment;onCreateView() start
2021-11-26T19:47:49.668+0800;D;ExtendedListFragment;onCreateView
2021-11-26T19:47:49.713+0800;I;OCFileListFragment;onCreateView() end
2021-11-26T19:47:49.714+0800;I;OCFileListFragment;onActivityCreated() start
2021-11-26T19:47:49.968+0800;V;PreviewMediaFragment;onDestroyView
2021-11-26T19:47:49.968+0800;V;PreviewMediaFragment;onDestroy
2021-11-26T19:47:50.741+0800;V;PreviewMediaFragment;onCreateView
2021-11-26T19:47:50.772+0800;V;PreviewMediaFragment;onActivityCreated
2021-11-26T19:47:50.772+0800;V;PreviewMediaFragment;onStart
2021-11-26T19:47:50.781+0800;D;OwnCloudClient #5;REQUEST POST /ocs/v2.php/apps/dav/api/v1/direct
2021-11-26T19:47:50.782+0800;V;PreviewMediaFragment;onResume
2021-11-26T19:47:50.784+0800;D;AdvancedSslSocketFactory;Creating SSL Socket with remote 192.168.0.188:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@51e249f
2021-11-26T19:47:50.784+0800;D;AdvancedSslSocketFactory; ... with connection timeout 5000 and socket timeout 40000
2021-11-26T19:47:50.785+0800;I;ServerNameIndicator;SSLSocket implementation: org.conscrypt.Java8EngineSocket
2021-11-26T19:47:50.785+0800;I;ServerNameIndicator;SNI done, hostname: 192.168.0.188
2021-11-26T19:47:55.086+0800;V;PreviewMediaFragment;onPause
2021-11-26T19:47:55.086+0800;V;PreviewMediaFragment;onStop
2021-11-26T19:47:55.095+0800;I;OCFileListFragment;onCreateView() start
2021-11-26T19:47:55.095+0800;D;ExtendedListFragment;onCreateView
2021-11-26T19:47:55.141+0800;I;OCFileListFragment;onCreateView() end
2021-11-26T19:47:55.141+0800;I;OCFileListFragment;onActivityCreated() start
2021-11-26T19:47:55.411+0800;V;PreviewMediaFragment;onDestroyView
2021-11-26T19:47:55.412+0800;V;PreviewMediaFragment;onDestroy
2021-11-26T19:47:56.182+0800;V;PreviewMediaFragment;onCreateView
2021-11-26T19:47:56.221+0800;V;PreviewMediaFragment;onActivityCreated
2021-11-26T19:47:56.221+0800;V;PreviewMediaFragment;onStart
2021-11-26T19:47:56.230+0800;D;OwnCloudClient #5;REQUEST POST /ocs/v2.php/apps/dav/api/v1/direct
2021-11-26T19:47:56.231+0800;V;PreviewMediaFragment;onResume
2021-11-26T19:47:56.232+0800;D;AdvancedSslSocketFactory;Creating SSL Socket with remote 192.168.0.188:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@51e249f
2021-11-26T19:47:56.232+0800;D;AdvancedSslSocketFactory; ... with connection timeout 5000 and socket timeout 40000
2021-11-26T19:47:56.232+0800;I;ServerNameIndicator;SNI done, hostname: 192.168.0.188
2021-11-26T19:48:00.425+0800;V;PreviewMediaFragment;onPause
2021-11-26T19:48:00.425+0800;V;PreviewMediaFragment;onStop
2021-11-26T19:48:00.432+0800;I;OCFileListFragment;onCreateView() start
2021-11-26T19:48:00.432+0800;D;ExtendedListFragment;onCreateView
2021-11-26T19:48:00.478+0800;I;OCFileListFragment;onCreateView() end
2021-11-26T19:48:00.479+0800;I;OCFileListFragment;onActivityCreated() start
2021-11-26T19:48:00.778+0800;V;PreviewMediaFragment;onDestroyView
2021-11-26T19:48:00.779+0800;V;PreviewMediaFragment;onDestroy
2021-11-26T19:48:02.421+0800;D;RefreshFolderOperation;Checking changes in drqfadmin@192.168.0.188/视频/
2021-11-26T19:48:02.422+0800;D;OwnCloudClient #5;REQUEST PROPFIND /remote.php/dav/files/drqfadmin//%E8%A7%86%E9%A2%91/
2021-11-26T19:48:02.423+0800;D;AdvancedSslSocketFactory;Creating SSL Socket with remote 192.168.0.188:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@51e249f
2021-11-26T19:48:02.424+0800;D;AdvancedSslSocketFactory; ... with connection timeout 5000 and socket timeout 40000
2021-11-26T19:48:02.424+0800;I;ServerNameIndicator;SNI done, hostname: 192.168.0.188
2021-11-26T19:48:02.480+0800;D;OCFileListAdapter;sharees of 视频: [com.owncloud.android.lib.resources.shares.ShareeUser@e4bcaa8]
2021-11-26T19:48:02.601+0800;I;RefreshFolderOperation;Checked drqfadmin@192.168.0.188/视频/ : changed
2021-11-26T19:48:02.605+0800;D;OwnCloudClient #5;REQUEST PROPFIND /remote.php/dav/files/drqfadmin//%E8%A7%86%E9%A2%91/
2021-11-26T19:48:02.910+0800;D;OwnCloudClient #5;REQUEST GET /status.php
2021-11-26T19:48:02.911+0800;D;AdvancedSslSocketFactory;Creating SSL Socket with remote 192.168.0.188:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@956c614
2021-11-26T19:48:02.911+0800;D;AdvancedSslSocketFactory; ... with connection timeout 5000 and socket timeout 40000
2021-11-26T19:48:02.911+0800;I;ServerNameIndicator;SNI done, hostname: 192.168.0.188
2021-11-26T19:48:02.931+0800;I;ReadFolderRemoteOperation;Synchronized /视频/: Operation finished with HTTP status code 207 (success)
20
1637928297601
21

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Nov 26, 2021

Regarding the login, it still exists on the development version of 20211125, and logging in with 192.168.0.188:888 is still the previous exception.

Yes, the PR I referenced isn't merged yet. It will be fixed when it's merged and released.

2021-11-26T19:48:02.911+0800;D;AdvancedSslSocketFactory;Creating SSL Socket with remote 192.168.0.188:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@956c614

Judging by this, the problem is that your server is on 192.168.0.188:888 but the video player is trying to connect to port 443 (ssl) instead. I will investigate this when I have time.

@AlvaroBrey AlvaroBrey changed the title Video can not play Video streaming fails when server URL is in ip:port format Nov 26, 2021
@Drqf
Copy link
Author

Drqf commented Nov 26, 2021

Yes, the PR I referenced isn't merged yet. It will be fixed when it's merged and released.

Thanks, I will try again in a few days.

2021-11-26T19:48:02.911+0800;D;AdvancedSslSocketFactory;Creating SSL Socket with remote 192.168.0.188:443, local null:0, params: org.apache.commons.httpclient.params.HttpConnectionParams@956c614

Judging by this, the problem is that your server is on 192.168.0.188:888 but the video player is trying to connect to port 443 (ssl) instead. I will investigate this when I have time.

not like this. I failed to login with 192.168.0.188:888. When testing video playback, I used https://192.168.0.188 to login, and the port was 443.

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Nov 26, 2021

not like this. I failed to login with 192.168.0.188:888. When testing video playback, I used https://192.168.0.188 to login, and the port was 443.

And are you actually serving valid HTTPS traffic on 192.168.0.188:443? I find that very unlikely unless you have your own CA and have installed its certificates in your phone.

Have you tried port 80? as in just 192.168.0.188, it should default to http

@Drqf
Copy link
Author

Drqf commented Nov 26, 2021

And are you actually serving valid HTTPS traffic on 192.168.0.188:443? I find that very unlikely unless you have your own CA and have installed its certificates in your phone.

Have you tried port 80? as in just 192.168.0.188, it should default to http

Yes, I configured the CA certificate, and the CA certificate points to my domain name. I'm trying to disable https, but I can't find a way to disable it. HTTP requests will be automatically redirected to https

@Drqf
Copy link
Author

Drqf commented Nov 26, 2021

not like this. I failed to login with 192.168.0.188:888. When testing video playback, I used https://192.168.0.188 to login, and the port was 443.

And are you actually serving valid HTTPS traffic on 192.168.0.188:443? I find that very unlikely unless you have your own CA and have installed its certificates in your phone.

Have you tried port 80? as in just 192.168.0.188, it should default to http

Thank you very very very much. You are right. I just found a way to disable https. I can play the video normally with http, and I can log in normally with http://192.168.0.188:81, and no error is reported.

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

No branches or pull requests

3 participants