Misleading/inaccurate error message from pg_basebackup

Поиск
Список
Период
Сортировка
От c@osss.net
Тема Misleading/inaccurate error message from pg_basebackup
Дата
Msg-id 8C23AFD9-4FCA-4FFD-8611-1B81BACCD25A@osss.net
обсуждение исходный текст
Ответы Re: Misleading/inaccurate error message from pg_basebackup  (Daniel Gustafsson <daniel@yesql.se>)
Re: Misleading/inaccurate error message from pg_basebackup  (Christoph Berg <myon@debian.org>)
Список pgsql-bugs
pg_basebackup can throw an error which is inaccurate and misleading:

$ mkdir /var/lib/postgresql/14
$ ls -ld /var/lib/postgresql/14
drwxr-x--- 2 postgres postgres 6 Jan 22 16:08 /var/lib/postgresql/14
$ pg_basebackup --version
Error: /var/lib/postgresql/14/main is not accessible; please fix the directory permissions (/var/lib/postgresql/14/
shouldbe world readable) 

Reading that error suggests that I need to make the directory /var/lib/postgresql/14 world-readable, but doing so does
notfix the problem, as the actual problem is that the main subdirectory does not exist: 

$ chmod a+rx /var/lib/postgresql/14
$ ls -ld /var/lib/postgresql/14
drwxr-xr-x 2 postgres postgres 6 Jan 22 16:08 /var/lib/postgresql/14
$ pg_basebackup --version
Error: /var/lib/postgresql/14/main is not accessible; please fix the directory permissions (/var/lib/postgresql/14/
shouldbe world readable) 

In fact it does not need to be world readable at all - the subdirectory just needs to be created:

$ chmod o-rx /var/lib/postgresql/14
$ mkdir /var/lib/postgresql/14/main
$ ls -ld /var/lib/postgresql/14{,/main}
drwxr-x--- 3 postgres postgres 19 Jan 22 16:14 /var/lib/postgresql/14
drwxr-x--- 2 postgres postgres  6 Jan 22 16:14 /var/lib/postgresql/14/main
$ pg_basebackup --version
pg_basebackup (PostgreSQL) 14.10 (Ubuntu 14.10-1.pgdg20.04+1)

This check is being done in cases where it's unnecessary, as it shouldn't matter at all when running a simple --version
or--help, anyways. 

--
Regards,
Casey


В списке pgsql-bugs по дате отправления:

Предыдущее
От: feichanghong
Дата:
Сообщение: Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: BUG #18297: Error when adding a column to a parent table with complex inheritance