#1033005 puppetdb: "fresh" installion results in "permission denied for table schema_migrations"

Package:
puppetdb
Source:
puppetdb
Submitter:
CSights
Date:
2023-03-21 13:51:06 UTC
Severity:
normal
Tags:
#1033005#5
Date:
2023-03-15 15:31:01 UTC
From:
To:
Greetings,

Setting up puppetdb with a empty database seems to not succeed.  puppetdb fails to start and issues
the message:

"Execution error (PSQLException) at org.postgresql.core.v3.QueryExecutorImpl/receiveErrorResponse (QueryExecutorImpl.java:2676).\nERROR: permission denied for table schema_migrations\n",

The reason why I put "fresh" in quotes is that actually what I'm doing is purging puppetdb,
installing puppetdb, then running 'dpkg-reconfigure puppetdb'.  During the purge of puppetdb
dbconfig prompts whether to remove the old DB and I choose "yes".  I keep the default answers
when running 'dpkg-reconfigure puppetdb'.

I haven't attempted to look at the DB permissions for the table schema_migrations, but it seems
likely the puppetdb user doesn't have access.

Thanks for your time!
C.

#1033005#8
Date:
2023-03-17 13:49:47 UTC
From:
To:
Hello,

The puppetdb package wasn't part of the last Debian release, bullseye.

Are you upgrading from puppetdb 6.2.0-3 which was in Debian buster? I
need to know precisely what were the steps you took here, so I can
figure out how to reproduce the problem.

But nonetheless, if you install puppetdb on a clean system (really
fresh), you should not hit this bug, so I'm reducing the severity to
non-release critical.

If I can figure out how to reproduce and fix this I'll upload a fix, but
since we're very close to the release I'm not sure if it'll get through.

Thanks,

#1033005#15
Date:
2023-03-17 14:53:59 UTC
From:
To:
Le 2023-03-17 à 10 h 49, Chad W Seys a écrit :

This is because Debian 12 is not released yet. Debian 'bookworm' is
actually the testing release right now, and will be until Debian 12
(bookworm) is officially released, likely in a few weeks.

So am I correct to understand that this problem occurred on a new Debian
bookworm installation?

Or was the system upgraded from a previous release? What was the version
of the puppetdb package when it was purged the first time?

Thanks,

#1033005#20
Date:
2023-03-17 14:49:12 UTC
From:
To:
Hi Jérôme,
  Possibly bugzilla had some difficulty with my submission.  This is from bookworm, but I messed with /etc/issue and other files to report Debian 12 to our configuration management tool.  It didn't understand bookworm/sid or whatever string was in place of normal integer.

Thanks!
C.

#1033005#23
Date:
2023-03-17 14:49:12 UTC
From:
To:
Hi Jérôme,
  Possibly bugzilla had some difficulty with my submission.  This is from bookworm, but I messed with /etc/issue and other files to report Debian 12 to our configuration management tool.  It didn't understand bookworm/sid or whatever string was in place of normal integer.

Thanks!
C.

#1033005#28
Date:
2023-03-17 16:23:25 UTC
From:
To:
I installed bullseye without puppetdb, then upgraded to bookworm, then installed puppetdb, then purged / dpkg-reconfigure puppetdb (b/c the initial install didn't work also).

7.12.1-3

Thanks!
C.

#1033005#31
Date:
2023-03-17 16:23:25 UTC
From:
To:
I installed bullseye without puppetdb, then upgraded to bookworm, then installed puppetdb, then purged / dpkg-reconfigure puppetdb (b/c the initial install didn't work also).

7.12.1-3

Thanks!
C.

#1033005#34
Date:
2023-03-18 14:56:20 UTC
From:
To:
I've tried to reproduce this problem, but am unable to.

Installing, purging, and reinstalling puppetdb on bookworm works without
issues on a fresh installation (in container).

Do you have postgresql installed on this machine? Are there are other
services using this instance of postgresql, any other databases? Was
there a past installation of PuppetDB at some point on this postgresql
instance?

My guess is there could have been some left over installation of
PuppetDB in postgresql, and since the puppetdb user/role is already
existing (with missing rights) it's not recreating it.

Would it be possible for you to test on another bookworm machine, and
provide the exact steps needed to reproduce this problem?

Thanks,

#1033005#39
Date:
2023-03-21 13:48:42 UTC
From:
To:
Hello Jérôme,

Hmm.  Thanks for trying! :/

AFAIK, this was a fresh VM on which I installed bullseye without puppetdb, then upgraded to bookworm, then installed puppetdb which pulled in postgresql.

You're probably correct in general.  I may have lost track of all that happened.  Shouldn't purging puppetdb allow a fresh start?  Or maybe it's the case the purging successfully sometimes depends on having installed successfully?

I guess for now we can assume I went down a strange path that isn't worth checking into.  I do plan to upgrade a working Debian 10 installation to bookworm when I have time.  Will file a report if that isn't smooth :).

Thanks for your time!
C.

#1033005#42
Date:
2023-03-21 13:48:42 UTC
From:
To:
Hello Jérôme,

Hmm.  Thanks for trying! :/

AFAIK, this was a fresh VM on which I installed bullseye without puppetdb, then upgraded to bookworm, then installed puppetdb which pulled in postgresql.

You're probably correct in general.  I may have lost track of all that happened.  Shouldn't purging puppetdb allow a fresh start?  Or maybe it's the case the purging successfully sometimes depends on having installed successfully?

I guess for now we can assume I went down a strange path that isn't worth checking into.  I do plan to upgrade a working Debian 10 installation to bookworm when I have time.  Will file a report if that isn't smooth :).

Thanks for your time!
C.