Unterminated quoted string when creating read user#371
Conversation
|
There are no tests, but I can confirm this works. I am checking out the situation with the tests. |
smortex
left a comment
There was a problem hiding this comment.
It looks like the format depend on the actual role names: puppetdb-read is quoted but puppetdb is not:
puppetdb=# SELECT pg_default_acl.defaclacl::text FROM pg_default_acl;
defaclacl
----------------------------------
{"\"puppetdb-read\"=U/puppetdb"}
{"\"puppetdb-read\"=X/puppetdb"}
{"\"puppetdb-read\"=r/puppetdb"}
(3 lignes)
I think the - in puppetdb-read trigger the quoting. I suggested some changes to make the matching more robust in any circumstances.
|
Out of curiosity, I do not alter the default roles and have not hit this issue. Can you share the configuration you use that trigger the issue? |
We are seeing this on Ubuntu 22.04, Puppet Agent 7.26.0, Puppet Server 7.13.0. Node hiera is pretty simple A puppet run with -d shows the following: Please let me know if you need more information on replicating this. Thanks for your help! |
|
lol, I was forgetting that the unbalanced quote was the reason for this PR 🤦. In our infra, we have The file was introduced with the mismatch in #330. The lack of unit tests seems to allow a broken default config for 5 minor releases in a row… Let's fix the code at least, can you check the suggested regexp changes I proposed and if they work as expected adjust the PR? |
|
I have replied on the suggestions you gave, and added a commit with your change. Thanks for looking at this. I have taken a look at the tests and #344 was done some time ago and the logs are lost. If you can resurrect it, maybe we can all chip in to get tests working again. |
smortex
left a comment
There was a problem hiding this comment.
Let's give this another try. Can you try these suggestions?
|
lol So I should adjust my comment #371 (comment)
Cc @austb. I feel like you are a bit alone to try to do something with this module, I am working on fixing CI, I'll at-you to be sure you not miss it. |
|
@smortex your suggestions are good. I've added them to the PR. |
|
Hey @waipeng! I see you replaced |
|
My fault due to inexperience with Github PR. Do you have preference on keeping the commits you suggested, or is it OK if I squash them all into one commit and put you as co-author? I am having a hard time tracing through the commits in the current form. |
|
Feel free to squash everything ;-) |
ed1cbe1 to
1c576af
Compare
|
Hi, can this be merged and a new version be cut please? |
|
Hello, no news on this ? permissions are checked every time without this patch. Thanks ! |
|
@waipeng can you rebase on main please? |
1c576af to
1486744
Compare
|
Somebody fixed the test suite 😱. We need to update the tests according to the code changes 😁 @waipeng the "Files changed" tab shows the offending tests (beware, the view lacks some Thanks! |
1486744 to
2d8d597
Compare
|
@waipeng tests are failing due to unrelated CI changes. Rebase on main again should get past that. |
2d8d597 to
2391456
Compare
puppetdb in default config will create a read-only user, however there is a bug[1] with the syntax to set the default read grant. Fix it with help from comments[2]. [1] puppetlabs#330 (comment) [2] puppetlabs#339 (comment) Co-authored-by: Romain Tartière <romain@blogreen.org> Signed-off-by: Jake Yip <jake.yip@ardc.edu.au>
2391456 to
f26d826
Compare

puppetdb in default config will create a read-only user, however there is a bug[1] with the syntax to set the default read grant.
Fix it with help from comments[2].
[1] #330 (comment)
[2] #339 (comment)