zadam / trilium-sender

Simple android application for sending images and notes to Trilium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Network error for logining in trilium server in trilium-sender

Magic-King opened this issue · comments

commented

I can't login in trilium server in trilium-sender downloaded by google play.
It shows me the network error after I input the necessary info.

And I found logs below, I want to know if there is a script which supported the trilium-sender.

Error: Router not found for request /api/sender
    at /usr/src/app/src/app.js:71:17
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:323:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:341:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:91:12)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:323:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:341:12) {
  status: 404
}
commented

Hi, there's no extra script or anything needed. Trilium Sender should work out of the box.

Are you sure you're configuring the correct URL/port? I'm not sure what that error means, /api/sender does not exist and is not called by Trilium Sender (but there's e.g. /api/sender/login and other services).

commented

Today I try to read the source code and use android logcat to find out what causes it.
I found that http transport is not supported higher than android 9, and I think this is the key problem.

$ adb logcat |grep UserLoginCoroutine
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: Can't connect to Trilium server
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: java.net.UnknownServiceException: CLEARTEXT communication to my_server not permitted by network security policy
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:188)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at io.github.zadam.triliumsender.LoginActivity$doLogin$2.invokeSuspend(LoginActivity.kt:173)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
01-25 10:30:11.663 25101 26313 E UserLoginCoroutine: 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
commented

Oh, I see, fix for that has been actually already merged in #18 but not yet released.

Oh, I see, fix for that has been actually already merged in #18 but not yet released.

Is there a way to get a preview? This is a show stopper on Android.

Oh, I see, fix for that has been actually already merged in #18 but not yet released.

Is there a way to get a preview? This is a show stopper on Android.

Any news about it?

Oh, I see, fix for that has been actually already merged in #18 but not yet released.

Is there a way to get a preview? This is a show stopper on Android.

Any news about it?

+1
No Update since Jan?
Perhaps it's a dead horse and we must use obsidian?
I've just migrated from DS Note and i miss the nativ app badly.

Releases to this app (meaning specifically the android version) are done rarely, as it's quite time-consuming. There has to be a strong driver/reason to make a release, using unsecure HTTP did not do it for me yet.

i cannot use the android app because of this issue. It simply won't connect to my self hosted trilium server. Desktop app syncs fine with the same settings. Also it asks for username and the Desktop app doesn't, I would not know what to enter there so i just wrote there trilium.

Same for me - wanted to integrate sending scans from the phone to my Trilium workflow - I get this error when trying to connect to the home server.

commented

I would like a lot to use the app but have the same problem.
Is there a workaround?