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
Another "Failed to ping server" issue #781
Comments
Hey, are you using iOS or android? Where did you pull that log from with the response from the server on the mobile app? The ping is happening like this in the mobile app. I've been meaning to try to provide a better error response here but if you are using android and can see the logcat you may be able to see that error getting logged in return this.$axios
.$get(`${address}/ping`, options)
.then((data) => data.success)
.catch((error) => {
console.error('Server check failed', error)
this.error = 'Failed to ping server'
return false
}) |
Hey thanks for you answer, I am indeed using Android
But I do not seem to be getting the logs from the app? If I remove the GREP, the only thing I see that happens on click is 1805 tf_lite_classifier.cc:383] Event stream classified as kNone But I doubt this is related |
I have setup an isntance here if you want to give it a quick try @advplyr |
I tested on Android Pixel 6
|
OK I added a patch to prevent the origin server's headers to reach the client but I still see "failed to ping the server" Would you mind giving it another look when you can? Thanks! |
I think the origin will need to be |
I think you should disable that check from the mobile client no? It doesn't make sense to check the CORS header from mobile if you have no origin URL? EDIT: I think there might be more to this as googling this issue shows only Flutter Web response? Nothing about mobile. What library are you using? EDIT2: Are you using Flutter Web with a webview? I think that's the issue, because Flutter Mobile would not test for CORS. (PS: just out of curiosity why not use Flutter directly?) |
We had discussed this before about changing the web view http requests to native http requests. That was a bit over a year ago and I think this is a new addition to the core capacitor plugins. This is pretty great because it intercepts the outgoing web view requests and changes them to native requests without me needing to manually update every request. This worked in my testing to ping your server. An APK gets built for each commit if you want to test that when it is done. Hopefully this also works for all the static content. #254 might be able to get supported easier now |
Nice one!! |
I'm actually not seeing the logs for CapacitorHttp in logcat. Did you update the server to |
Ah bummer, then it's probably not that simple. The requests will likely need to get changed manually then |
The APK is built https://github.com/advplyr/audiobookshelf-app/actions/runs/5536923526 The artifact at the bottom of the page |
I reverted the CORS settings and tried with the new APK it does work now! |
Nice! Thanks for testing, this is an improvement. |
no more "failed to ping server" problem with this apk . Thanks Edit: but ebooks does not be loaded.. |
This is partially updated in 0.9.66-beta. I couldn't fully implement this because of a limitation in that plugin that didn't allow for loading ebooks so you may still get cover loading issues. You shouldn't have issues logging in anymore though so let me know. |
Updated all requests EXCEPT the ereader in v0.9.67-beta I'm not sure yet how the ereader will be handled |
Hello, I am the dev of Cosmos, and using it as a reverse proxy seems to not work with the ABS app and I cannot see why.
Steps to reproduce
Actual behavior
More info
First of all I have spent significant amount of time searching this and here's what I can gather:
Despite of the app not working, the server receives the ping without any issues.
If I try to go to /ping directly in the browser, it works:
And finally, I have noticed that when the mobile app requests the URL, the ABS server returns a 304 instead of a 200?
Any pointer as to what needs to be done for it to work would be appreciated as there are not additional hints / errors / etc... anywhere
The text was updated successfully, but these errors were encountered: