Too much warning "cannot get cache context when getting data" #10348

Closed
opened 2025-11-02 09:04:57 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @adlternative on GitHub (Feb 26, 2023).

Originally assigned to: @lunny on GitHub.

Description

A large number of cache warnings appear after pushing a large number of tags (about 2,000)

Gitea Version

1.20.0+dev (90a7bba1)

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

2.39.0.198

Operating System

archlinux

How are you running Gitea?

a command-line

gitea web

Database

MySQL

Originally created by @adlternative on GitHub (Feb 26, 2023). Originally assigned to: @lunny on GitHub. ### Description A large number of cache warnings appear after pushing a large number of tags (about 2,000) ### Gitea Version 1.20.0+dev (90a7bba1) ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![image](https://user-images.githubusercontent.com/58138461/221407735-aff3fcdf-db74-465c-bb12-36ba09767363.png) ### Git Version 2.39.0.198 ### Operating System archlinux ### How are you running Gitea? a command-line ``` gitea web ``` ### Database MySQL
GiteaMirror added the type/bug label 2025-11-02 09:04:57 -06:00
Author
Owner

@lunny commented on GitHub (Feb 26, 2023):

I think this has been fixed in #23054

@lunny commented on GitHub (Feb 26, 2023): I think this has been fixed in #23054
Author
Owner

@adlternative commented on GitHub (Feb 27, 2023):

I think this has been fixed in #23054

image

Well, I think it still triggered warns with Gitea latest version "1.20.0+dev-34-gb9a9b8e46 built with GNU Make 4.4, go1.20.1 : bindata"

@adlternative commented on GitHub (Feb 27, 2023): > I think this has been fixed in #23054 ![image](https://user-images.githubusercontent.com/58138461/221501525-6c7d49b8-a882-4ef4-a911-e5c5618cb8e6.png) Well, I think it still triggered warns with Gitea latest version "1.20.0+dev-34-gb9a9b8e46 built with GNU Make 4.4, go1.20.1 : bindata"
Author
Owner

@yp05327 commented on GitHub (Feb 28, 2023):

In https://github.com/go-gitea/gitea/pull/23054,

getting the system settings will not try from the cache but will read from the database directly.

It seems that cache will read from database directly when server starts. So is it possible that this context data is just not existed in the database?

@yp05327 commented on GitHub (Feb 28, 2023): In https://github.com/go-gitea/gitea/pull/23054, > getting the system settings will not try from the cache but will read from the database directly. It seems that cache will read from database directly when server starts. So is it possible that this context data is just not existed in the database?
Author
Owner

@adlternative commented on GitHub (Feb 28, 2023):

In #23054,

getting the system settings will not try from the cache but will read from the database directly.

It seems that cache will read from database directly when server starts. So is it possible that this context data is just not existed in the database?

Agree, maybe so.

@adlternative commented on GitHub (Feb 28, 2023): > In #23054, > > > getting the system settings will not try from the cache but will read from the database directly. > > It seems that cache will read from database directly when server starts. So is it possible that this context data is just not existed in the database? Agree, maybe so.
Author
Owner

@lunny commented on GitHub (Feb 28, 2023):

In #23054,

getting the system settings will not try from the cache but will read from the database directly.

It seems that cache will read from database directly when server starts. So is it possible that this context data is just not existed in the database?

The warning is not because of the record is not exist in database but cannot get the context cache key. I think #23186 will fix this.

@lunny commented on GitHub (Feb 28, 2023): > In #23054, > > > getting the system settings will not try from the cache but will read from the database directly. > > It seems that cache will read from database directly when server starts. So is it possible that this context data is just not existed in the database? The warning is not because of the record is not exist in database but cannot get the context cache key. I think #23186 will fix this.
Author
Owner

@adlternative commented on GitHub (Mar 1, 2023):

Thanks, I think it has been fixed!

@adlternative commented on GitHub (Mar 1, 2023): Thanks, I think it has been fixed!
Author
Owner

@karolyi commented on GitHub (Mar 28, 2023):

In what version should this have been fixed? I'm still getting them with 1.19.0:

2023/03/28 16:21:22 ...les/cache/context.go:71:SetContextData() [W] [6422f3fa-46] cannot get cache context when setting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46}
2023/03/28 16:21:22 ...les/cache/context.go:62:GetContextData() [W] [6422f3fa-46] cannot get cache context when getting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46}
2023/03/28 16:21:22 ...les/cache/context.go:71:SetContextData() [W] [6422f3fa-46] cannot get cache context when setting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46}
2023/03/28 16:21:22 ...les/cache/context.go:62:GetContextData() [W] [6422f3fa-46] cannot get cache context when getting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46}
2023/03/28 16:21:22 ...les/cache/context.go:71:SetContextData() [W] [6422f3fa-46] cannot get cache context when setting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46}
@karolyi commented on GitHub (Mar 28, 2023): In what version should this have been fixed? I'm still getting them with 1.19.0: ``` 2023/03/28 16:21:22 ...les/cache/context.go:71:SetContextData() [W] [6422f3fa-46] cannot get cache context when setting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46} 2023/03/28 16:21:22 ...les/cache/context.go:62:GetContextData() [W] [6422f3fa-46] cannot get cache context when getting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46} 2023/03/28 16:21:22 ...les/cache/context.go:71:SetContextData() [W] [6422f3fa-46] cannot get cache context when setting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46} 2023/03/28 16:21:22 ...les/cache/context.go:62:GetContextData() [W] [6422f3fa-46] cannot get cache context when getting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46} 2023/03/28 16:21:22 ...les/cache/context.go:71:SetContextData() [W] [6422f3fa-46] cannot get cache context when setting data: &{context.Background.WithCancel.WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer"}).WithCancel.WithValue(type pprof.labelContextKey, val {"graceful-lifecycle":"with-hammer", "pid":"6422f3fa-46", "ppid":"", "process-description":"Incoming Email", "process-type":"system"}) 6422f3fa-46} ```
Author
Owner

@karolyi commented on GitHub (Mar 28, 2023):

Oh, 1.20.0, supposedly. Let's wait a bit more then.

@karolyi commented on GitHub (Mar 28, 2023): Oh, 1.20.0, supposedly. Let's wait a bit more then.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10348