Error 1305: FUNCTION gitea.strftime does not exist #2627

Closed
opened 2025-11-02 04:42:41 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @haytoo1 on GitHub (Dec 6, 2018).

docker use gitea/gitea:latest

visit /api/v1/users/haytoo/heatmap
error message:

{"message":"Error 1305: FUNCTION gitea.strftime does not exist","url":"https://godoc.org/github.com/go-gitea/go-sdk/gitea"}
Originally created by @haytoo1 on GitHub (Dec 6, 2018). docker use `gitea/gitea:latest` visit `/api/v1/users/haytoo/heatmap` error message: ``` {"message":"Error 1305: FUNCTION gitea.strftime does not exist","url":"https://godoc.org/github.com/go-gitea/go-sdk/gitea"} ```
GiteaMirror added the type/bug label 2025-11-02 04:42:41 -06:00
Author
Owner

@zeripath commented on GitHub (Dec 19, 2018):

Hmm... Could you check whether this still happens?

@zeripath commented on GitHub (Dec 19, 2018): Hmm... Could you check whether this still happens?
Author
Owner

@mnieto156 commented on GitHub (Dec 22, 2018):

¿which database engine are you using? if I use postgresql my error is this one:
"message":"pq: function strftime(unknown, bigint, unknown) does not exist","url":"https://godoc.org/github.com/go-gitea/go-sdk/gitea"
and my docker log:
[SQL] SELECT strftime('%s', strftime('%Y-%m-%d', created_unix, 'unixepoch')) AS timestamp, count(user_id) as contributions FROM "action" WHERE (user_id = $1) AND (created_unix > $2) GROUP BY timestamp ORDER BY timestamp []interface {}{1, 1513899654} => that's sqlite code, not psql. Tomorrow I'll try with a new install using sqlite

@mnieto156 commented on GitHub (Dec 22, 2018): ¿which database engine are you using? if I use postgresql my error is this one: `"message":"pq: function strftime(unknown, bigint, unknown) does not exist","url":"https://godoc.org/github.com/go-gitea/go-sdk/gitea"` and my docker log: ` [SQL] SELECT strftime('%s', strftime('%Y-%m-%d', created_unix, 'unixepoch')) AS timestamp, count(user_id) as contributions FROM "action" WHERE (user_id = $1) AND (created_unix > $2) GROUP BY timestamp ORDER BY timestamp []interface {}{1, 1513899654}` => that's sqlite code, not psql. Tomorrow I'll try with a new install using sqlite
Author
Owner

@mnieto156 commented on GitHub (Dec 22, 2018):

rebuilt with latest docker image, now it seems to be fixed

@mnieto156 commented on GitHub (Dec 22, 2018): rebuilt with latest docker image, now it seems to be fixed
Author
Owner

@zeripath commented on GitHub (Dec 22, 2018):

@mnieto156 - I think your problem was Gitea was speaking sqlite dialect to postgres - not sure why. It might have been a configuration issue or an issue with the way it was built.

@haytoo1 's problem seems to imply that the strftime function hadn't been compiled into the embedded sqlite - which is probably an issue with the build - so a simple redownload the image and retry might solve the issue and if it's still there after a redownload when Gitea was supposed to have been rebuilt - then it says that there is a consistent problem with the docker build process rather than an intermittent one that might have had something to do with the change of go version that also affected drone's continuous build earlier last week.

@zeripath commented on GitHub (Dec 22, 2018): @mnieto156 - I think your problem was Gitea was speaking sqlite dialect to postgres - not sure why. It might have been a configuration issue or an issue with the way it was built. @haytoo1 's problem seems to imply that the strftime function hadn't been compiled into the embedded sqlite - which is probably an issue with the build - so a simple redownload the image and retry might solve the issue and if it's still there after a redownload when Gitea was supposed to have been rebuilt - then it says that there is a consistent problem with the docker build process rather than an intermittent one that might have had something to do with the change of go version that also affected drone's continuous build earlier last week.
Author
Owner

@mnieto156 commented on GitHub (Dec 26, 2018):

Yeah, thanks, probably my issue was in my config, i've tried a fresh install + docker restart and now it works as expected

@mnieto156 commented on GitHub (Dec 26, 2018): Yeah, thanks, probably my issue was in my config, i've tried a fresh install + docker restart and now it works as expected
Author
Owner

@jnlin commented on GitHub (Jan 3, 2019):

Hi,

I have the same problem. I use MySQL instead of sqlite. No bugs in sqlite installation.

@jnlin commented on GitHub (Jan 3, 2019): Hi, I have the same problem. I use MySQL instead of sqlite. No bugs in sqlite installation.
Author
Owner

@lunny commented on GitHub (Jan 3, 2019):

@jnlin have you restarted gitea?

@lunny commented on GitHub (Jan 3, 2019): @jnlin have you restarted gitea?
Author
Owner

@jnlin commented on GitHub (Jan 3, 2019):

After restart gitea, it works! Thank you @lunny

@jnlin commented on GitHub (Jan 3, 2019): After restart gitea, it works! Thank you @lunny
Author
Owner

@zeripath commented on GitHub (Jan 3, 2019):

Ah. @lunny - is it that you can change the database backend but the dialect won't change with it until a restart?

@zeripath commented on GitHub (Jan 3, 2019): Ah. @lunny - is it that you can change the database backend but the dialect won't change with it until a restart?
Author
Owner

@lunny commented on GitHub (Jan 3, 2019):

If you changed custom/app.ini, you have to restart the docker. @zeripath I don't think there is any options to change the database settings on UI after installation UI finished.

@lunny commented on GitHub (Jan 3, 2019): If you changed `custom/app.ini`, you have to restart the docker. @zeripath I don't think there is any options to change the database settings on UI after installation UI finished.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2627