This repository has been archived by the owner. It is now read-only.

Unable to login (likely cause: timeout exceeded) #159

Closed
g0ukb opened this Issue Feb 3, 2017 · 9 comments

Comments

Projects
None yet
2 participants
@g0ukb
Copy link

g0ukb commented Feb 3, 2017

Ghost version: 0.11.4
App version: 1.5.2


Unable to login from Quill

I REALLY want to use this app - so much so I've just spent the last day installing Ghost on an old Raspberry Pi. Quill is not connecting to my account though. On the Android App I get the message "Could not connect to http://iambrian.raspberryweb.uk/ghost. Please try again" All I can see in Ghost is a GET request and then "POST /ghost/api/v0.1/authentication/token/ - - ms - -" (i.e no POST status code returned)

From my Chrome browser on the same phone I can browse to http://iambrian.raspberryweb.uk/ghost and sign in without problem

I'm a newcomer to Ghost and node.js in general so not sure where to find better diagnostics. Looking at Google Play I note 0.11.4 of Ghost is not supported.

@vickychijwani

This comment has been minimized.

Copy link
Owner

vickychijwani commented Feb 3, 2017

Hi @g0ukb! Installing Ghost on a Raspberry Pi eh? 😃 Love the effort you're putting into this 👍

First off, Ghost 0.11.4 is supported - I simply forgot to update the Play Store listing after the last release (thanks for pointing that out!). In any case there is no difference between 0.11.3 and 0.11.4 from the perspective of Quill.

Coming to the issue: does the "could not connect" message appear after ~10 seconds, or quickly after you tap the Sign In button? I suspect it's the former. I think you're hitting the connection timeout limit, which is currently set to 10 seconds. The "- - ms - -" after your POST request also hints at that, since it's supposed to print the response time there, so "- -" probably means the request was cancelled/aborted (?) maybe due to a timeout.

I speed-tested your blog's login page informally, here's what I'm seeing:

  • According to pingdom.com, it takes 11-13 seconds to load around the world, which is quite high. Cities I tested were Stockholm, New York, and Melbourne. Now I know you're self-hosting this so your device and the server are probably on the same LAN - I don't know what the load times for you are, but if it's > 10 sec then you might be hitting the timeout. Which might mean your Rπ is under high load?

  • When I try to login to your blog (with incorrect email/password of course - only for testing!), it takes a long time to respond, although I do get the message "There is no such user", which means the connection was made successfully.

For diagnostics, you'll get useful information from your phone's logs moreso than the server logs. If you're interested, you can simply download Android's debug tool adb from here (download "SDK Platform-Tools for Linux") and use adb logcat to view the logs - you will probably see an error like the one below when the login fails.

Let me know if I can help further!


java.net.SocketTimeoutException: timeout
         at okio.Okio$4.newTimeoutException(Okio.java:227)
         at okio.AsyncTimeout.exit(AsyncTimeout.java:284)
         at okio.AsyncTimeout$2.read(AsyncTimeout.java:240)
         at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)
         at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314)
         at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
         ...
   Caused by: java.net.SocketTimeoutException
         at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
         at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
         at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
         at okio.Okio$2.read(Okio.java:138)
         at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
         at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)
         ...
@g0ukb

This comment has been minimized.

Copy link

g0ukb commented Feb 3, 2017

@vickychijwani

This comment has been minimized.

Copy link
Owner

vickychijwani commented Feb 3, 2017

Glad to help however I can :). Your use-case does seem pretty interesting, and yes, Quill was designed for exactly the kind of offline scenarios that travellers encounter. However the login step must of course happen online - once the data is with Quill, most of it should work as well offline as it does online (except image uploading - it will take some sustained effort to support offline image "uploads").

Ghost is the only thing running and network latency is very little so the problem is purely lack of processing power of the old RPi

Ah, I see, that's unfortunate.

Don't suppose there's an easy way to up that timeout value??

Not without a new update - which means you'll need an internet connection to download the update :). However if you can get a stable-enough connection to download a few megabytes, I can up the timeout to, say, 20 seconds. Let me know if you want this.

Or... you can just try logging in a bunch of times, and one of those might succeed, since I am in fact able to connect to your blog and get a proper error response from Ghost ("no such user") from halfway across the world. Of course, after login the data download will be a few 100s of KBs so that also needs to succeed. It'll be a hit-or-miss situation.

the SOLE reason I decided to run Ghost was because I was looking around for an Android off-line blogging tool

Interesting. I never thought to market Quill to non-Ghost users, under the (seemingly false) assumption that nobody would go to the trouble of dealing with a whole new platform just to use the app. This gives me some ideas 🤔

I installed Ghost purely to try Quill! So, THANK YOU for all the effort you have put in to it

Brian, I'm humbled and motivated to know that you're interested enough in Quill to go to all this trouble!

@g0ukb

This comment has been minimized.

Copy link

g0ukb commented Feb 4, 2017

@vickychijwani

This comment has been minimized.

Copy link
Owner

vickychijwani commented Feb 4, 2017

I have a small campervan and my wife and I vacation in it for 4-5 months each year.

Now that is truly fascinating. I cannot imagine living off the grid for months on end - too reliant on modern technology.

Of course, that was before I realised what a huge stack node.js was, especially on a tiny machine like a Raspberry Pi.

For an old RPi, yes, Node is probably too much.

If it is easy to make a 20 sec timeout version I have no problem downloading.

I basically have to tweak the number and rebuild, that's all. Since you still have a month to go, I'm going to wait to make the next release until there are some other updates accumulated - I don't want to make 2 releases back-to-back and annoy people. Expect an update in the next 2 weeks or so - I hope that's ok.

As for Quill to non-Ghost users...

These are valuable thoughts, thanks for sharing.

I am looking forward to using Quill - your Play Store score of 4.8 suggests a phenomenal tool.

That 4.8 rating is from a small number of users (~60 total), so it's not such a big feat after all :). Half the battle is won merely by being responsive, and the other half by prioritizing issues reported in Play Store reviews ;)

BTW I did try multiple attempts to log-in but I think the basic bcryptjs module is designed to be CPU intensive deliberately to stop brute force attacks and on the RPi is just too much for the slow processor.

Makes sense. Do you have hard numbers on, for example, how long it actually takes to login from Chrome on your phone? Because if it's taking > 20 sec, we may need an even higher timeout?

I am a retired developer (actually I worked for IBM and was instrumental in bringing Java into the mainstream - although I've never written any Java code myself!)

Wow, you have the most intriguing stories :)

Maybe I need to start spending long nights in front of my keyboard with coffee and pizza rather than
vacationing in my campervan!!

And I should try camping for a few months some time because it does sound rather temping and peaceful!

@vickychijwani vickychijwani changed the title Unable to login Unable to login (likely cause: timeout exceeded) Feb 4, 2017

@vickychijwani

This comment has been minimized.

Copy link
Owner

vickychijwani commented Feb 4, 2017

I saw your Play Store review - thanks! I guess I can close this thread since there's nothing more to do.

@g0ukb

This comment has been minimized.

Copy link

g0ukb commented Feb 4, 2017

@vickychijwani

This comment has been minimized.

Copy link
Owner

vickychijwani commented Feb 4, 2017

If it makes sense to up the login time on a future release then I'll try the old v1 RPi again.

Duly noted - I think I'd like to wait for some more feedback on this. I'll have to weigh the UX cost of increasing the timeout against the value it will provide.

If you do ever decide to charge for Quill then more than happy to pay

Thanks for offering! For the moment I have no plans to turn this into a paid app - the satisfaction of knowing that this is solving problems in an under-served category is enough to keep me motivated :)

@g0ukb

This comment has been minimized.

Copy link

g0ukb commented Feb 5, 2017

vickychijwani added a commit that referenced this issue Feb 12, 2017

Increase connection/read/write timeouts from 10 sec => 30 sec.
30 sec is not so bad, given that we almost never block the user (except during
image uploads). A longer timeout provides big benefits with little downside.
There could be a lot of cases where a longer timeout would be beneficial for,
including core user scenarios like publishing over a poor connection.

Refs: #159
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.