Activity log for bug #2007794

Date Who What changed Old value New value Message
2023-02-20 01:13:12 wycitox incox bug added bug
2023-02-21 23:20:16 Bryce Harrington tags server-todo
2023-02-21 23:24:13 Bryce Harrington postgresql-common (Ubuntu): importance Undecided High
2023-02-21 23:24:13 Bryce Harrington postgresql-common (Ubuntu): status New Triaged
2023-02-24 20:30:44 Bryce Harrington bug added subscriber Ubuntu Server
2023-02-26 19:48:16 Athos Ribeiro postgresql-common (Ubuntu): assignee Athos Ribeiro (athos-ribeiro)
2023-03-09 13:27:15 Athos Ribeiro postgresql-common (Ubuntu): importance High Medium
2023-03-09 17:50:05 Athos Ribeiro summary pg_conftool does not "recognize" lines for logging_collector pg_conftool mistakes regular comments for commented config options
2023-03-09 18:10:50 Athos Ribeiro description While configuring Postgres for our Docker containers running Ubuntu/Postgres15 (new deployment) we have found a peculiar problem. When setting the "logging_collector = on/off" we have found pg_conftool uncomments the incorrect line, please note this does not happen to any other line, but very well may as we do not change all default settings. Here is an excerpt for /etc/postgresql/15/main/postgresql.conf referring to logging_collector: Default install: ------------------------------------ 446 # eventlog, depending on platform. 447 # csvlog and jsonlog require 448 # logging_collector to be on. 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- Please note this ONLY happens on PG15 which happens to have comments on line 447/448 in a separate line placing "logging_collector" in the start of the sentence. When running: ------------------------------------- # pg_conftool /etc/postgresql/15/main/postgresql.conf set logging_collector on ------------------------------------- It will modify the postgresql.conf but not how you would think it would; after setting logging_collector to on: ------------------------------------- 447 # csvlog and jsonlog require 448 logging_collector on 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- The incorrect line was uncommented (448), it should have uncommented line 451. Looking into the source code for pg_conftool we found the regex used for parsing postgresql.conf is the problem, it recognizes line 448 as a valid setting line when it is indeed a comment: ------------------------------------- 448 # logging_collector to be on ------------------------------------- Here is the snip for file ".\postgresql-common\PgCommon.pm" which handles parsing: ------------------------------------- my $found = 0; # first, search for an uncommented setting for (my $i=0; $i <= $#lines; ++$i) { if ($lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or $lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) { $lines[$i] = "$1$2$value$3\n"; $found = 1; last; } } # now check if the setting exists as a comment; if so, change that instead # of appending if (!$found) { for (my $i=0; $i <= $#lines; ++$i) { if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) { $lines[$i] = "$1$2$value$3\n"; $found = 1; last; } } ------------------------------------- [ Impact ] pg_conftool mistakes regular comments starting with a configuration option for actual commented configuration options. While the issue does not impact any software features or its usability, it may lead to the deletion of useful comments or documentation in configuration files. [ Test Plan ] The proposed change includes new tests to cover the most basic cases the regular expression was failing to deal with. On top of that, we can verify the fix by 0) Installing postgresql-$PG_VERSION 1) appending # test_config this is just a comment to the /etc/postgresql/$PG_VERSION/main/postgresql.conf file. 2) running pg_conftool /etc/postgresql/14/main/postgresql.conf set test_config on 3) checking that the end of the file contains # test_config this is just a comment test_config = on for fixed versions of the package, instead of just test_config = on as it happens for affected versions. [ Where problems could occur ] While the changed regular expression is being tested during autopkgtest runs, the proposed patch may change its parsing behavior for unaccounted use cases. If this happens, we will need to cover such cases and propose further fixes. [ Other info ] We already submitted a fix to Debian in https://salsa.debian.org/postgresql/postgresql-common/-/merge_requests/17 [ Original report ] While configuring Postgres for our Docker containers running Ubuntu/Postgres15 (new deployment) we have found a peculiar problem. When setting the "logging_collector = on/off" we have found pg_conftool uncomments the incorrect line, please note this does not happen to any other line, but very well may as we do not change all default settings. Here is an excerpt for /etc/postgresql/15/main/postgresql.conf referring to logging_collector: Default install: ------------------------------------ 446 # eventlog, depending on platform. 447 # csvlog and jsonlog require 448 # logging_collector to be on. 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- Please note this ONLY happens on PG15 which happens to have comments on line 447/448 in a separate line placing "logging_collector" in the start of the sentence. When running: ------------------------------------- # pg_conftool /etc/postgresql/15/main/postgresql.conf set logging_collector on ------------------------------------- It will modify the postgresql.conf but not how you would think it would; after setting logging_collector to on: ------------------------------------- 447 # csvlog and jsonlog require 448 logging_collector on 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- The incorrect line was uncommented (448), it should have uncommented line 451. Looking into the source code for pg_conftool we found the regex used for parsing postgresql.conf is the problem, it recognizes line 448 as a valid setting line when it is indeed a comment: ------------------------------------- 448 # logging_collector to be on ------------------------------------- Here is the snip for file ".\postgresql-common\PgCommon.pm" which handles parsing: ------------------------------------- my $found = 0;     # first, search for an uncommented setting     for (my $i=0; $i <= $#lines; ++$i) {  if ($lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or      $lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {      $lines[$i] = "$1$2$value$3\n";      $found = 1;      last;  }     }     # now check if the setting exists as a comment; if so, change that instead     # of appending     if (!$found) {  for (my $i=0; $i <= $#lines; ++$i) {      if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or   $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {   $lines[$i] = "$1$2$value$3\n";   $found = 1;   last;      }  } -------------------------------------
2023-03-09 18:11:06 Athos Ribeiro nominated for series Ubuntu Jammy
2023-03-09 18:11:06 Athos Ribeiro bug task added postgresql-common (Ubuntu Jammy)
2023-03-09 18:11:06 Athos Ribeiro nominated for series Ubuntu Lunar
2023-03-09 18:11:06 Athos Ribeiro bug task added postgresql-common (Ubuntu Lunar)
2023-03-09 18:11:15 Athos Ribeiro postgresql-common (Ubuntu Jammy): status New Triaged
2023-03-09 18:11:19 Athos Ribeiro postgresql-common (Ubuntu Jammy): assignee Athos Ribeiro (athos-ribeiro)
2023-03-09 18:51:04 Athos Ribeiro nominated for series Ubuntu Bionic
2023-03-09 18:51:04 Athos Ribeiro bug task added postgresql-common (Ubuntu Bionic)
2023-03-09 18:51:04 Athos Ribeiro nominated for series Ubuntu Kinetic
2023-03-09 18:51:04 Athos Ribeiro bug task added postgresql-common (Ubuntu Kinetic)
2023-03-09 18:51:04 Athos Ribeiro nominated for series Ubuntu Focal
2023-03-09 18:51:04 Athos Ribeiro bug task added postgresql-common (Ubuntu Focal)
2023-03-09 18:51:14 Athos Ribeiro postgresql-common (Ubuntu Kinetic): status New Triaged
2023-03-09 18:51:17 Athos Ribeiro postgresql-common (Ubuntu Focal): status New Triaged
2023-03-09 18:51:20 Athos Ribeiro postgresql-common (Ubuntu Bionic): status New Triaged
2023-03-09 18:51:24 Athos Ribeiro postgresql-common (Ubuntu Bionic): assignee Athos Ribeiro (athos-ribeiro)
2023-03-09 18:51:27 Athos Ribeiro postgresql-common (Ubuntu Focal): assignee Athos Ribeiro (athos-ribeiro)
2023-03-09 18:51:29 Athos Ribeiro postgresql-common (Ubuntu Kinetic): assignee Athos Ribeiro (athos-ribeiro)
2023-03-09 18:51:34 Athos Ribeiro postgresql-common (Ubuntu Kinetic): importance Undecided Low
2023-03-09 18:51:37 Athos Ribeiro postgresql-common (Ubuntu Jammy): importance Undecided Low
2023-03-09 18:51:40 Athos Ribeiro postgresql-common (Ubuntu Focal): importance Undecided Low
2023-03-09 18:51:43 Athos Ribeiro postgresql-common (Ubuntu Bionic): importance Undecided Low
2023-03-09 19:00:58 Launchpad Janitor merge proposal linked https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/438630
2023-03-09 19:06:43 Athos Ribeiro description [ Impact ] pg_conftool mistakes regular comments starting with a configuration option for actual commented configuration options. While the issue does not impact any software features or its usability, it may lead to the deletion of useful comments or documentation in configuration files. [ Test Plan ] The proposed change includes new tests to cover the most basic cases the regular expression was failing to deal with. On top of that, we can verify the fix by 0) Installing postgresql-$PG_VERSION 1) appending # test_config this is just a comment to the /etc/postgresql/$PG_VERSION/main/postgresql.conf file. 2) running pg_conftool /etc/postgresql/14/main/postgresql.conf set test_config on 3) checking that the end of the file contains # test_config this is just a comment test_config = on for fixed versions of the package, instead of just test_config = on as it happens for affected versions. [ Where problems could occur ] While the changed regular expression is being tested during autopkgtest runs, the proposed patch may change its parsing behavior for unaccounted use cases. If this happens, we will need to cover such cases and propose further fixes. [ Other info ] We already submitted a fix to Debian in https://salsa.debian.org/postgresql/postgresql-common/-/merge_requests/17 [ Original report ] While configuring Postgres for our Docker containers running Ubuntu/Postgres15 (new deployment) we have found a peculiar problem. When setting the "logging_collector = on/off" we have found pg_conftool uncomments the incorrect line, please note this does not happen to any other line, but very well may as we do not change all default settings. Here is an excerpt for /etc/postgresql/15/main/postgresql.conf referring to logging_collector: Default install: ------------------------------------ 446 # eventlog, depending on platform. 447 # csvlog and jsonlog require 448 # logging_collector to be on. 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- Please note this ONLY happens on PG15 which happens to have comments on line 447/448 in a separate line placing "logging_collector" in the start of the sentence. When running: ------------------------------------- # pg_conftool /etc/postgresql/15/main/postgresql.conf set logging_collector on ------------------------------------- It will modify the postgresql.conf but not how you would think it would; after setting logging_collector to on: ------------------------------------- 447 # csvlog and jsonlog require 448 logging_collector on 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- The incorrect line was uncommented (448), it should have uncommented line 451. Looking into the source code for pg_conftool we found the regex used for parsing postgresql.conf is the problem, it recognizes line 448 as a valid setting line when it is indeed a comment: ------------------------------------- 448 # logging_collector to be on ------------------------------------- Here is the snip for file ".\postgresql-common\PgCommon.pm" which handles parsing: ------------------------------------- my $found = 0;     # first, search for an uncommented setting     for (my $i=0; $i <= $#lines; ++$i) {  if ($lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or      $lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {      $lines[$i] = "$1$2$value$3\n";      $found = 1;      last;  }     }     # now check if the setting exists as a comment; if so, change that instead     # of appending     if (!$found) {  for (my $i=0; $i <= $#lines; ++$i) {      if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or   $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {   $lines[$i] = "$1$2$value$3\n";   $found = 1;   last;      }  } ------------------------------------- [ Impact ] pg_conftool mistakes regular comments starting with a configuration option for actual commented configuration options. While the issue does not impact any software features or its usability, it may lead to the deletion of useful comments or documentation in configuration files. [ Test Plan ] The proposed change includes new tests to cover the most basic cases the regular expression was failing to deal with. On top of that, we can verify the fix by 0) Installing postgresql-$PG_VERSION 1) appending # test_config this is just a comment to the /etc/postgresql/$PG_VERSION/main/postgresql.conf file. 2) running pg_conftool /etc/postgresql/14/main/postgresql.conf set test_config on 3) checking that the end of the file contains # test_config this is just a comment test_config = on for fixed versions of the package, instead of just test_config = on as it happens for affected versions. [ Where problems could occur ] While the changed regular expression is being tested during autopkgtest runs, the proposed patch may change its parsing behavior for unaccounted use cases. If this happens, we will need to cover such cases and propose further fixes. [ Other info ] We already submitted a fix to Debian in https://salsa.debian.org/postgresql/postgresql-common/-/merge_requests/17 Note that while lunar has one specific documentation line affected by this issue (as described below), the other affected series would only have this issue manifested for user specific crafted comments, AFAICT. This is why all SRUs for this bug are marked as low priority, differently from the lunar one. [ Original report ] While configuring Postgres for our Docker containers running Ubuntu/Postgres15 (new deployment) we have found a peculiar problem. When setting the "logging_collector = on/off" we have found pg_conftool uncomments the incorrect line, please note this does not happen to any other line, but very well may as we do not change all default settings. Here is an excerpt for /etc/postgresql/15/main/postgresql.conf referring to logging_collector: Default install: ------------------------------------ 446 # eventlog, depending on platform. 447 # csvlog and jsonlog require 448 # logging_collector to be on. 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- Please note this ONLY happens on PG15 which happens to have comments on line 447/448 in a separate line placing "logging_collector" in the start of the sentence. When running: ------------------------------------- # pg_conftool /etc/postgresql/15/main/postgresql.conf set logging_collector on ------------------------------------- It will modify the postgresql.conf but not how you would think it would; after setting logging_collector to on: ------------------------------------- 447 # csvlog and jsonlog require 448 logging_collector on 449 450 # This is used when logging to stderr: 451 #logging_collector = off # Enable capturing of stderr, jsonlog, 452 # and csvlog into log files. Required 453 # to be on for csvlogs and jsonlogs. ------------------------------------- The incorrect line was uncommented (448), it should have uncommented line 451. Looking into the source code for pg_conftool we found the regex used for parsing postgresql.conf is the problem, it recognizes line 448 as a valid setting line when it is indeed a comment: ------------------------------------- 448 # logging_collector to be on ------------------------------------- Here is the snip for file ".\postgresql-common\PgCommon.pm" which handles parsing: ------------------------------------- my $found = 0;     # first, search for an uncommented setting     for (my $i=0; $i <= $#lines; ++$i) {  if ($lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or      $lines[$i] =~ /^\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {      $lines[$i] = "$1$2$value$3\n";      $found = 1;      last;  }     }     # now check if the setting exists as a comment; if so, change that instead     # of appending     if (!$found) {  for (my $i=0; $i <= $#lines; ++$i) {      if ($lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)\w+\b((?:\s*#.*)?)/i or   $lines[$i] =~ /^\s*#\s*($key)(\s*(?:=|\s)\s*)'[^']*'((?:\s*#.*)?)/i) {   $lines[$i] = "$1$2$value$3\n";   $found = 1;   last;      }  } -------------------------------------
2023-03-22 15:11:33 Christian Ehrhardt  postgresql-common (Ubuntu Lunar): status Triaged Fix Released
2023-03-22 15:13:25 Athos Ribeiro tags server-todo
2023-04-10 22:09:36 Launchpad Janitor merge proposal linked https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/440665
2023-04-10 22:10:53 Launchpad Janitor merge proposal linked https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/440666
2023-04-10 22:11:32 Launchpad Janitor merge proposal linked https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/440667
2023-04-10 22:12:08 Launchpad Janitor merge proposal linked https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/440668
2023-05-12 20:35:56 Steve Langasek postgresql-common (Ubuntu Kinetic): status Triaged Incomplete
2023-05-12 20:35:59 Steve Langasek postgresql-common (Ubuntu Jammy): status Triaged Incomplete
2023-05-12 20:36:02 Steve Langasek postgresql-common (Ubuntu Focal): status Triaged Incomplete
2023-05-12 20:36:04 Steve Langasek postgresql-common (Ubuntu Bionic): status Triaged Incomplete
2023-05-12 23:43:08 Athos Ribeiro tags block-proposed-jammy block-proposed-kinetic
2023-05-12 23:43:20 Athos Ribeiro postgresql-common (Ubuntu Kinetic): status Incomplete Triaged
2023-05-12 23:43:23 Athos Ribeiro postgresql-common (Ubuntu Jammy): status Incomplete Triaged
2023-05-12 23:43:27 Athos Ribeiro postgresql-common (Ubuntu Focal): status Incomplete Won't Fix
2023-05-12 23:43:29 Athos Ribeiro postgresql-common (Ubuntu Bionic): status Incomplete Won't Fix
2023-05-13 00:04:14 Steve Langasek postgresql-common (Ubuntu Kinetic): status Triaged Fix Committed
2023-05-13 00:04:15 Steve Langasek bug added subscriber Ubuntu Stable Release Updates Team
2023-05-13 00:04:22 Steve Langasek bug added subscriber SRU Verification
2023-05-13 00:04:26 Steve Langasek tags block-proposed-jammy block-proposed-kinetic block-proposed-jammy block-proposed-kinetic verification-needed verification-needed-kinetic
2023-05-18 11:34:28 Athos Ribeiro tags block-proposed-jammy block-proposed-kinetic verification-needed verification-needed-kinetic block-proposed-jammy block-proposed-kinetic verification-done-kinetic verification-needed
2023-05-19 23:57:20 Steve Langasek postgresql-common (Ubuntu Jammy): status Triaged Fix Committed
2023-05-19 23:57:24 Steve Langasek tags block-proposed-jammy block-proposed-kinetic verification-done-kinetic verification-needed block-proposed-jammy block-proposed-kinetic verification-done-kinetic verification-needed verification-needed-jammy
2023-05-26 02:16:24 Athos Ribeiro tags block-proposed-jammy block-proposed-kinetic verification-done-kinetic verification-needed verification-needed-jammy block-proposed-jammy block-proposed-kinetic verification-done verification-done-jammy verification-done-kinetic