[GH-ISSUE #613] I'm encountering a "JSON Parse Error: Unexpected character: <" when attempting to log in through the iOS app. #388

Closed
opened 2026-03-02 11:49:25 +03:00 by kerem · 7 comments
Owner

Originally created by @ghost on GitHub (Nov 4, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/613

Describe the Bug

When logging in to the iOS app both with username&password or API key I get the following error.
Logging in from the web browser works fine.

JSON Parse error: Unexpected character: <

image

Steps to Reproduce

  1. Go to the iOS App
  2. Login with username & password or API key
  3. Press Sign in

Expected Behaviour

Successful login.

Screenshots or Additional Context

The only error I see in the container is this the following.
_hoarder_logs.txt

Device Details

iOS 18.1

Exact Hoarder Version

v0.18.0

Originally created by @ghost on GitHub (Nov 4, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/613 ### Describe the Bug When logging in to the iOS app both with username&password or API key I get the following error. Logging in from the web browser works fine. **JSON Parse error: Unexpected character: <** ![image](https://github.com/user-attachments/assets/92e9233a-e471-44f0-88dd-0ae96547d01d) ### Steps to Reproduce 1. Go to the iOS App 2. Login with username & password or API key 3. Press Sign in ### Expected Behaviour Successful login. ### Screenshots or Additional Context The only error I see in the container is this the following. [_hoarder_logs.txt](https://github.com/user-attachments/files/17616586/_hoarder_logs.txt) ### Device Details iOS 18.1 ### Exact Hoarder Version v0.18.0
kerem 2026-03-02 11:49:25 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@MohamedBassem commented on GitHub (Nov 4, 2024):

Can you go back to the previous page and and use the connection debugging tool and share its logs?

<!-- gh-comment-id:2454318909 --> @MohamedBassem commented on GitHub (Nov 4, 2024): Can you go back to the previous page and and use the connection debugging tool and share its logs?
Author
Owner

@ghost commented on GitHub (Nov 4, 2024):

Here you go, this is all I get when I copy diagnostic result:

Running connection test ...

Using address: *redacted*

ALL GOOD
<!-- gh-comment-id:2454324888 --> @ghost commented on GitHub (Nov 4, 2024): Here you go, this is all I get when I copy diagnostic result: ``` Running connection test ... Using address: *redacted* ALL GOOD ```
Author
Owner

@MohamedBassem commented on GitHub (Nov 4, 2024):

can you make sure you're on the newly released app version (1.6.5). I've improved the connection debugging tool since then?

<!-- gh-comment-id:2454329387 --> @MohamedBassem commented on GitHub (Nov 4, 2024): can you make sure you're on the newly released app version (1.6.5). I've improved the connection debugging tool since then?
Author
Owner

@ghost commented on GitHub (Nov 4, 2024):

Ah cool, downloaded it and I see the error now. My website is exposed through a Cloudflare tunnel which requires login.
The diagnostic log in the app shows this:

Running connection test ...

Using address: *redacted*

Failed to parse response as JSON: SyntaxError: JSON Parse error: Unexpected character: <

Got the following response:

<!DOCTYPE html>
<html>
  <head>
    <title>Sign in ・ Cloudflare Access</title>
    <meta charset="utf-8" />
    <meta name="robots" content="noindex" />
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width" />
    <article id="data"
      data-auto-redirect-to-identity="false"
      data-auto-redirect-url=""
      data-message="">
    </article>

Is it possible to use Hoarder iOS app with the website exposed through Cloudflare tunnel which requires a sign in?

<!-- gh-comment-id:2454343624 --> @ghost commented on GitHub (Nov 4, 2024): Ah cool, downloaded it and I see the error now. My website is exposed through a Cloudflare tunnel which requires login. The diagnostic log in the app shows this: ``` Running connection test ... Using address: *redacted* Failed to parse response as JSON: SyntaxError: JSON Parse error: Unexpected character: < Got the following response: <!DOCTYPE html> <html> <head> <title>Sign in ・ Cloudflare Access</title> <meta charset="utf-8" /> <meta name="robots" content="noindex" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width" /> <article id="data" data-auto-redirect-to-identity="false" data-auto-redirect-url="" data-message=""> </article> ``` Is it possible to use Hoarder iOS app with the website exposed through Cloudflare tunnel which requires a sign in?
Author
Owner

@kamtschatka commented on GitHub (Nov 4, 2024):

no, this is not supported. maybe you can make an exception for the /api endpoints to not require a sign in?

<!-- gh-comment-id:2454574381 --> @kamtschatka commented on GitHub (Nov 4, 2024): no, this is not supported. maybe you can make an exception for the /api endpoints to not require a sign in?
Author
Owner

@ghost commented on GitHub (Nov 4, 2024):

Creating a bypass rule for the api endpoint worked, but is it safe to expose?

For anyone else facing the same issue, you can create a bypass rule by following these steps:

  1. Navigate to Zero Trust in Cloudflare.
  2. Under Access, go to Applications and click on "Add a new application".

Example for https://hoarder.yourdomain.tld, the configuration would be as follows:

  • Subdomain: "hoarder"
  • Domain: "yourdomain.tld"
  • Path: "api"
  1. On the Policies page, enter a name for the policy. In the Action section, select "Bypass," and in the Configure rules section, choose the "Everyone" selector.
<!-- gh-comment-id:2454722326 --> @ghost commented on GitHub (Nov 4, 2024): Creating a bypass rule for the api endpoint worked, but is it safe to expose? For anyone else facing the same issue, you can create a bypass rule by following these steps: 1. Navigate to Zero Trust in Cloudflare. 2. Under Access, go to Applications and click on "Add a new application". Example for https://hoarder.yourdomain.tld, the configuration would be as follows: - **Subdomain:** "hoarder" - **Domain:** "yourdomain.tld" - **Path:** "api" 3. On the Policies page, enter a name for the policy. In the Action section, select "Bypass," and in the Configure rules section, choose the "Everyone" selector.
Author
Owner

@kamtschatka commented on GitHub (Nov 20, 2024):

closing this issue, as it was a config issue

<!-- gh-comment-id:2487995351 --> @kamtschatka commented on GitHub (Nov 20, 2024): closing this issue, as it was a config issue
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#388
No description provided.