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

Javascript promise error on dashboard #30768

Closed
shootie22 opened this issue Apr 29, 2024 · 9 comments · Fixed by #30771
Closed

Javascript promise error on dashboard #30768

shootie22 opened this issue Apr 29, 2024 · 9 comments · Fixed by #30771
Labels

Comments

@shootie22
Copy link

shootie22 commented Apr 29, 2024

Description

Hi, I'm facing an issue with Gitea after a fresh install.
I freshly installed Gitea version 1.22.0+rc1-3-gd07019f539 from binary and adopted a repository.

The main page shows this error and shows no content on the main body of the page:
JavaScript promise rejection: Cannot read properties of null (reading 'State'). Open browser console to see more details.

image

In my browser's console I can see:

DashboardRepoList.vue:254 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'State')
    at DashboardRepoList.vue:254:76
    at Array.map (<anonymous>)
    at Proxy.searchRepos (DashboardRepoList.vue:251:32)

The Gitea logs don't seem to show any errors. I tried looking around online but I couldn't find anything too useful D:
Any help is appreciated. Thanks.

Gitea Version

1.22.0+rc1-3-gd07019f539

Can you reproduce the bug on the Gitea demo site?

No

Screenshots

image

Git Version

git version 2.34.1

Operating System

Ubuntu 24.04 LTS

How are you running Gitea?

Binary downloaded from https://dl.gitea.com/gitea/1.22/

Database

MySQL/MariaDB

@silverwind
Copy link
Member

Comes from here:

latest_commit_status_state: webSearchRepo.latest_commit_status.State,

It does not seem to not be a recent regression.

@silverwind
Copy link
Member

silverwind commented Apr 29, 2024

@shootie22 can you open browser devtools, network tab, find the last GET request to /repo/search and post the response JSON?

@surinara
Copy link

surinara commented Apr 29, 2024

I get the same error in the same version. It seems to be happening in "size: 16".

image
image

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 30, 2024

I think it is related to a recent change, the latest_commit_status could be nil. @lunny

By this:

@wxiaoguang
Copy link
Contributor

-> Fix dashboard commit status null access #30771

@lunny
Copy link
Member

lunny commented Apr 30, 2024

I think it is related to a recent change, the latest_commit_status could be nil. @lunny

By this:

* [Cache repository default branch commit status to reduce query on commit status table #29444](https://github.com/go-gitea/gitea/pull/29444)

It's weird. #30700 should have resolve the problem.

@wxiaoguang
Copy link
Contributor

The backend bug has been fixed, but the nil/null is still passed to frontend.

@shootie22
Copy link
Author

Thanks for being so fast to reply, everyone. 🙂
I'm at work now, but I will provide more details as soon as I get home.

GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Apr 30, 2024
wxiaoguang added a commit that referenced this issue Apr 30, 2024
Backport #30771 by wxiaoguang

Fix #30768

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@shootie22
Copy link
Author

@shootie22 can you open browser devtools, network tab, find the last GET request to /repo/search and post the response JSON?

I think one of these two should be the response:
{"success_fraction":0,"report_to":"cf-nel","max_age":604800}

{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=mLkdCyVnBspjjfnAacUgzJaS8uzopX5dqjc%2BQV9Wm%2F6eF%2F1g9aJkCCC7yGsYyvgJk6H1t5ochGRMtHTRKfOwV%2F6W5g014ClukG7nObTHZ%2FN6W5feDBJ8yv8w26iZDUlXBI9n"}],"group":"cf-nel","max_age":604800}

It's worth mentioning that I am routing this install through Cloudflare. Even so, I get the same behavior through the local address.

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants