Skip to content
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

Loading articles failed #11

Open
unstablemaple opened this issue Sep 20, 2023 · 1 comment
Open

Loading articles failed #11

unstablemaple opened this issue Sep 20, 2023 · 1 comment

Comments

@unstablemaple
Copy link

I am running my own instance inside a docker image and articles don't load. I get the following error whenever I click an article link:
INFO[0067] Error unmarshalling body from response invalid character '<' looking for beginning of value

I have to note that I am running an ARM system, so I had to modify the Dockerfile a little bit. Any idea how to fix this?

@dave0003
Copy link

I did a manual build and install, and get the same error.

INFO[0014] Error unmarshalling body from response invalid character '<' looking for beginning of value

In the browser it says:

invalid character '<' looking for beginning of value

It looks like pkg/client/medium_client.go is producing the error, at the end (I added the "2 - ").

        mr, err := entities.UnmarshalMediumResponse(body)
        if err != nil {
                log.Printf("2 - Error unmarshalling body from response %v\n", err)
                return nil, err
        }

It appears it doesn't like the response it's getting back from the API request. When I look at the body:

        body, err := io.ReadAll(res.Body)
        log.Printf(string(body))

It is returning a body that includes these sorts of things:

<title>Just a moment...</title>
#challenge-success-text
#challenge-error-text
<span id="challenge-error-text">Enable JavaScript and cookies to continue</span>

Not the sort of thing an API should return. It looks like the request is being blocked, or put behind a captcha.

I'm not sure if it's the IP address of the server, or if there's something that can be configured to get it to work (like an API key).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants