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

Postgresql Persistence Exception : logconfiguration #1323

Closed
vvilerio opened this issue Mar 10, 2021 · 6 comments
Closed

Postgresql Persistence Exception : logconfiguration #1323

vvilerio opened this issue Mar 10, 2021 · 6 comments
Assignees
Labels
type/bug Something isn't working

Comments

@vvilerio
Copy link

vvilerio commented Mar 10, 2021

Hello,

i'm working on apicurio-registry (version : March, 9 2021), and in my (freshly generated) docker-compose stack, the following error appears :

ERROR:  relation "logconfiguration" does not exist at character 34
postgres_1           | 2021-03-10 14:39:32.013 UTC [27] STATEMENT:  SELECT l.logger, l.loglevel FROM logconfiguration l
apicurio-registry_1  | 2021-03-10 14:39:32,014 WARN  [io.api.reg.met.PersistenceExceptionLivenessCheck] (executor-thread-1) Liveness problem suspected in PersistenceExceptionLivenessCheck because of an exception: : io.apicurio.registry.storage.RegistryStorageException: org.jdbi.v3.core.statement.UnableToExecuteStatementException: org.postgresql.util.PSQLException: ERROR: relation "logconfiguration" does not exist
apicurio-registry_1  |   Position: 34 [statement:"SELECT l.logger, l.loglevel FROM logconfiguration l", arguments:{positional:{}, named:{}, finder:[]}]
apicurio-registry_1  | 	at io.apicurio.registry.storage.impl.sql.AbstractSqlRegistryStorage.withHandle(AbstractSqlRegistryStorage.java:154)

am I the only one ?

@EricWittmann EricWittmann added the type/bug Something isn't working label Mar 10, 2021
@EricWittmann
Copy link
Member

Possible issue either with the docker compose or with the DDL not being properly installed? Any thoughts @famartinrh or @carlesarnal ?

@famarting
Copy link
Contributor

I've just tested the docker compose files we provide

docker-compose -f compose-base-sql.yml up --abort-on-container-exit
$ curl -i http://localhost:8080/apis/registry/v2/admin/loggers
HTTP/1.1 200 OK
Date: Thu, 11 Mar 2021 11:26:13 GMT
Expires: Wed, 10 Mar 2021 11:26:13 GMT
Pragma: no-cache
Cache-control: no-cache, no-store, must-revalidate
Content-Type: application/json
Content-Length: 2

[]

@vvilerio maybe your postgres container was already initialized with old data from running the compose files in the past?

Anyway, I think the registry should update the schema... can you please share (in a gist or something) your logs of the registry? @vvilerio
you may have to add the env variable REGISTRY_LOG_LEVEL=DEBUG to the registry container for it to log useful info.

@vvilerio
Copy link
Author

vvilerio commented Mar 11, 2021

Beforehand, I had deleted my volume, image and docker container.

gist

@famarting
Copy link
Contributor

in your logs I can see , maybe there is a volume somewhere for your postgres container that you are missing? @vvilerio

postgres_1           | PostgreSQL Database directory appears to contain a database; Skipping initialization
apicurio-registry-psql-v2 | 2021-03-11 13:22:06,357 INFO  [io.api.reg.sto.imp.sql.AbstractSqlRegistryStorage] (executor-thread-1) Database was already initialized, skipping.

So that database was maybe initialized by an older version where the logconfiguration was not implemented, and because it is already initialized the registry does not apply the DDL.

@EricWittmann do you consider this a bug? should the registry apply the DDL anyway? wdyt?
AbstractSqlRegistryStorage#isDatabaseCurrent returns false, and that is actually correct. Because this is actually the first version of our sql storage.

@vvilerio
Copy link
Author

@famartinrh Eureka,

I had a stubborn volume, the "docker volume rm" command was not enough.

I had to do :
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)

@EricWittmann
Copy link
Member

Nice job figuring this out. This is not a bug because 2.0.0.Final is the first release of the SQL storage. After we release 2.0.0.Final, any schema changes in the DB will automatically be applied on startup of the application, even when just going from e.g. 2.0.1-SNAPSHOT to a newer 2.0.1-SNAPSHOT. But for right now, the auto-update of the DB schema doesn't happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants