Gitea: Error 1305: FUNCTION gitea.strftime does not exist

Created on 6 Dec 2018  路  10Comments  路  Source: go-gitea/gitea

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"}
kinbug

All 10 comments

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

驴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

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

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

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

Hi,

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

@jnlin have you restarted gitea?

After restart gitea, it works! Thank you @lunny

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorise7 picture jorise7  路  3Comments

internalfx picture internalfx  路  3Comments

thehowl picture thehowl  路  3Comments

lunny picture lunny  路  3Comments

kifirkin picture kifirkin  路  3Comments