vickychijwani / quill

:ghost: [MOVED TO https://github.com/TryGhost/Ghost-Android] The beautiful Android app for your Ghost blog.
MIT License
553 stars 84 forks source link

There is no Ghost Blog at {blogUrl} #116

Closed charany1 closed 8 years ago

charany1 commented 8 years ago

System details : Android Lollipop

Steps to reproduce :

  1. Put in blog url and other details
  2. Click Sign-in
  3. A screen with circular progress bar appears 4.Back to Login Activity with a message "There is no Ghost blog at http://quill-debug-blog.ghost.io/ghost."
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: <--- HTTP 200 http://quill-debug-blog.ghost.io/ghost/api/v0.1/authentication/token (7823ms)
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: OkHttp-Selected-Protocol: h2
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: server: cloudflare-nginx
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: date: Thu, 31 Mar 2016 18:16:46 GMT
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: content-type: text/html; charset=utf-8
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: set-cookie: __cfduid=dc0c5396a5b679c9ec6e6e9f8819c11ae1459448199; expires=Fri, 31-Mar-17 18:16:39 GMT; path=/; domain=.ghost.io; HttpOnly
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: cache-control: no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: cf-railgun: 81ee2c71bb stream 0.000000 0210 3350
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: last-modified: Thu, 31 Mar 2016 19:16:46 GMT
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: status: 200 OK
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: vary: Accept-Encoding
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: x-ghost-cache-status: From Backend - Not Cached
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: x-powered-by: Express
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: cf-ray: 28c5cb2e903f2f0b-DEL
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: OkHttp-Sent-Millis: 1459448149266
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: OkHttp-Received-Millis: 1459448156372
03-31 23:45:56.375 19714-32588/me.vickychijwani.spectre.debug D/Retrofit: <--- END HTTP (-1-byte body)
03-31 23:45:56.405 19714-19714/me.vickychijwani.spectre.debug E/LoginActivity: retrofit.RetrofitError: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
                                                                                   at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
                                                                                   at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
                                                                                   at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
                                                                                   at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                                   at retrofit.Platform$Android$2$1.run(Platform.java:142)
                                                                                   at java.lang.Thread.run(Thread.java:818)
                                                                                Caused by: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
                                                                                   at retrofit.converter.GsonConverter.fromBody(GsonConverter.java:67)
                                                                                   at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:367)
                                                                                   at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220) 
                                                                                   at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278) 
                                                                                   at retrofit.CallbackRunnable.run(CallbackRunnable.java:42) 
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                                   at retrofit.Platform$Android$2$1.run(Platform.java:142) 
                                                                                   at java.lang.Thread.run(Thread.java:818) 
                                                                                Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
                                                                                   at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:200)
                                                                                   at com.google.gson.Gson.fromJson(Gson.java:810)
                                                                                   at com.google.gson.Gson.fromJson(Gson.java:775)
                                                                                   at retrofit.converter.GsonConverter.fromBody(GsonConverter.java:63)
                                                                                   at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:367) 
                                                                                   at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220) 
                                                                                   at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278) 
                                                                                   at retrofit.CallbackRunnable.run(CallbackRunnable.java:42) 
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                                   at retrofit.Platform$Android$2$1.run(Platform.java:142) 
                                                                                   at java.lang.Thread.run(Thread.java:818) 
                                                                                Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
                                                                                   at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:387)
                                                                                   at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:189)
                                                                                   at com.google.gson.Gson.fromJson(Gson.java:810) 
                                                                                   at com.google.gson.Gson.fromJson(Gson.java:775) 
                                                                                   at retrofit.converter.GsonConverter.fromBody(GsonConverter.java:63) 
                                                                                   at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:367) 
                                                                                   at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220) 
                                                                                   at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278) 
                                                                                   at retrofit.CallbackRunnable.run(CallbackRunnable.java:42) 
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
                                                                                   at retrofit.Platform$Android$2$1.run(Platform.java:142) 
                                                                                   at java.lang.Thread.run(Thread.java:818) 
03-31 23:45:56.411 1066-1106/? W/ActivityManager: getRunningAppProcesses: caller 10169 does not hold REAL_GET_TASKS; limiting output

I've enabled Beta Public API access from Settings in Admin Pannel.

vickychijwani commented 8 years ago

Hi! Thanks for filing these issues! I'll get to them as soon as I'm able (travelling a lot these days).

EDIT: please ignore what I said below. My bad for not reading the issue details properly. I'll have to look into this more closely.

This particular issue is occurring because we're always appending "/ghost/" to the URL without checking if the user has already added it (NetworkService.java line 779).

Should be simple enough to fix, but I'm concerned about an edge case where someone actually has a blog at example.org/ghost/ghost. To handle that we'd have to try both URLs (i.e., first try example.org/ghost, and if that doesn't work try falling back to example.org/ghost/ghost).

vickychijwani commented 8 years ago

You should be able to login with the latest commit on master. Ghost 0.7 made the client secret dynamic for better security, Quill now supports that. It's backwards-compatible with Ghost 0.6.

charany1 commented 8 years ago

It worked . Thanks .