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

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

Closed
haytoo1 opened this issue Dec 6, 2018 · 10 comments · Fixed by #13796
Closed

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

haytoo1 opened this issue Dec 6, 2018 · 10 comments · Fixed by #13796
Labels

Comments

@haytoo1
Copy link

haytoo1 commented 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"}
@lunny lunny added the type/bug label Dec 8, 2018
@zeripath
Copy link
Contributor

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

@mnieto156
Copy link

¿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
Copy link

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

@zeripath
Copy link
Contributor

@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.

@mnieto156
Copy link

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

@jnlin
Copy link
Contributor

jnlin commented Jan 3, 2019

Hi,

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

@lunny
Copy link
Member

lunny commented Jan 3, 2019

@jnlin have you restarted gitea?

@jnlin
Copy link
Contributor

jnlin commented Jan 3, 2019

After restart gitea, it works! Thank you @lunny

@zeripath
Copy link
Contributor

zeripath commented 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?

@lunny
Copy link
Member

lunny commented 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.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
zeripath added a commit to zeripath/gitea that referenced this issue Dec 2, 2020
One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix go-gitea#13788
Fix go-gitea#5480

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick added a commit that referenced this issue Dec 3, 2020
One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix #13788
Fix #5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath added a commit to zeripath/gitea that referenced this issue Dec 3, 2020
…3796)

Backport go-gitea#13796

One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix go-gitea#13788
Fix go-gitea#5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
6543 pushed a commit that referenced this issue Dec 3, 2020
…13811)

Backport #13796

One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix #13788
Fix #5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
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