go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.39k stars 5.43k forks source link

Heatmap never loads (since introduced) #6709

Closed jamiew0w closed 5 years ago

jamiew0w commented 5 years ago

Description

Since the heatmap has been introduced, it has never loaded correctly on my instance.

I read through previous issues surrounding this and tested - it's not related to only users pre-introduction. I made a new one, created repo - still infinitely loading. I am using remote mysql but it's setup correctly in the app.ini. Lastly, the reverse proxy settings are correct and the logs don't have any errors. I'm unsure if the xorm logs will be useful, if they're needed let me know and I'd be happy to attach.

I'm also not using mysql 8 - mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64).

All requests at the reverse proxy are 200s also, no errors in browser console either. ...

Screenshots

^ The screenshot is a little misleading by the way, I've waited minutes and nothing ever loads.

Logs

Reverse proxy - [redacted]

Nothing in error logs. Cloudflare IP also, that's the full login and to where it loads forever.

Gitea - [redacted]

Nothing suspect.

serv.log is just this repeated, don't think it will be related (all from 2018 for what it's worth)

2018/10/27 18:22:30 [T] UpdatePublicKeyUpdated: http://localhost:3000/api/internal/ssh/1/update

The xorm.log does have some more info, I'm not sure how relevant it'll be. I just redacted the email;

[redacted]

The only thing I can think of is my app.ini is a bit dated and missing a bunch of the options, however I don't see anything (apart from the show heatmap option) which would be related.

jolheiser commented 5 years ago

Have you tried with a fresh install of Gitea? (No need to delete other data, just temp move it perhaps)
Alternatively, have you tried with another DB or local connection to a DB?

Just trying to narrow down causes since the logs don't seem to have anything pointing to an error.

jamiew0w commented 5 years ago

@jolheiser Just tested with stopping gitea - swapping to sqlite3 and restarting. Made a new user, didn't work, made a new repo - continued to load endlessly. I've swapped the logs to debug mode, is there anything in particular you'd be looking for?

I can whip up another VM tomorrow and try with a fresh install also, little late for that tonight though lol.

jolheiser commented 5 years ago

No problem, no rush.

As for anything specific, unfortunately right now I'm not sure what to look for.
I would assume the reason it is eterna-loading is because it never gets a response back from the API, but I'm not sure why yet.

jamiew0w commented 5 years ago

Okay, I tested with copying the binary and specifying a new config with different port and the heatmap worked after this - that's with using sqlite3 too.

That does mean the app.ini works fine though, so I'm guessing it must be something with mysql but I have no idea what.

I ruled out the reverse proxy also - tested with naked IP and port and still occurs.

jolheiser commented 5 years ago

This is the URL that Gitea hits to get Heatmap data: https://github.com/go-gitea/gitea/blob/master/public/js/index.js#L2494

What happens if you curl the API? Would look something like https://mydomain.com/api/v1/users/<username>/heatmap

If you need to play with the parameters a bit, you can hit your Swagger endpoint at https://mydomain.com/api/swagger which gives a nice GUI to use.

Here is the link to https://try.gitea.io swagger, for example: https://try.gitea.io/api/swagger#/user/userGetHeatmapData

jamiew0w commented 5 years ago

Unfortunately I do get the same output on swagger on my instance as I do get on the try.gitea.io setup. Full json with timestamps and contributions. When logged in I can load the json just fine by manually browsing to https://domain.whatever/api/v1/users/jamie/heatmap

jolheiser commented 5 years ago

This is with your initial MySQL setup?

jamiew0w commented 5 years ago

Correct, yup! (bizarre right?)

edit; I think because this does work on a fresh install with sqlite3 that I'll re-install from scratch tomorrow just in-case something's awry. If everything works (with mysql) it won't take long to create and push up all the repos again anyway.

jolheiser commented 5 years ago

Very odd. If the endpoint is working, the Vue component must be silently dying on something? I am not incredibly familiar with the heatmap component's internals, but it seems like we've narrowed it down to somewhere in there.
I'm a little surprised there's nothing in the browser console, though. Can you see where it is making the call to the API, and whether it is actually returning on the page?

jamiew0w commented 5 years ago

Son of a ___, it's something to do with the styling.

If I swap it back to the default it works.

@jolheiser Thanks very much for your help with this, I appreciate it. Thanks also to you and the team for their work on Gitea, it really is brilliant.

jolheiser commented 5 years ago

oh well that's also interesting, I can't imagine why the other style would mess it up. Perhaps there was a caching issue. Regardless, glad to see it's working!

Thank you very much! 😄

ramlev commented 5 years ago

Dont know if its ok to post here, but i have same issue, have installed gitea 1.9.0 on a docker container, and my heatmap doesnt work.

When i try the endpoint in swagger the response is


{
  "message": "Error 1305: FUNCTION gitea.strftime does not exist",
  "url": "https://my.host.com/api/swagger"
}
lunny commented 5 years ago

@ramlev Please fire another issue with more detail there.

ramlev commented 5 years ago

i just restarted the docker container, then everything worked.