PDA

View Full Version : postgresql-14 error



kopepoc
2022-11-11, 20:27
Error when upgrading:
Errors were encountered while processing: /tmp/apt-dpkg-install-ffEC4W/77-postgresql-14_14.5-3_arm64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

kopepoc
2022-11-16, 07:44
Still getting lots of errors:

Preparing to unpack .../12-pci.ids_0.0~2022.10.28-1_all.deb ...
Unpacking pci.ids (0.0~2022.10.28-1) over (0.0~2022.10.22-1) ...
Preparing to unpack .../13-postgresql-14_14.5-3_arm64.deb ...
invoke-rc.d: could not determine current runlevel
Stopping PostgreSQL 14 database server: mainError: Data directory /var/lib/postgresql/14/main must not be owned by root ... failed!
failed!
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: warning: old postgresql-14 package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
invoke-rc.d: could not determine current runlevel
Stopping PostgreSQL 14 database server: mainError: Data directory /var/lib/postgresql/14/main must not be owned by root ... failed!
failed!
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: error processing archive /tmp/apt-dpkg-install-5mPYuE/13-postgresql-14_14.5-3_arm64.deb (--unpack):
new postgresql-14 package pre-removal script subprocess returned error exit status 1
Preparing to unpack .../14-python3-yaml_6.0-3+b1_arm64.deb ...
Unpacking python3-yaml (6.0-3+b1) over (5.4.1-1+b2) ...
Preparing to unpack .../15-xdg-dbus-proxy_0.1.4-2_arm64.deb ...
Unpacking xdg-dbus-proxy (0.1.4-2) over (0.1.4-1) ...
Preparing to unpack .../16-xl2tpd_1.3.18-1_arm64.deb ...
Unpacking xl2tpd (1.3.18-1) over (1.3.17-1) ...
Errors were encountered while processing:
/tmp/apt-dpkg-install-5mPYuE/13-postgresql-14_14.5-3_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

kopepoc
2022-11-16, 07:53
Can't uninstall it either:

# apt remove postgresql-14
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libatk1.0-data libexporter-tiny-perl
libflac8 libgs9-common libgssdp-1.2-0
libgupnp-1.2-1 libilmbase25 libjs-terser
liblerc3 liblist-moreutils-perl
liblist-moreutils-xs-perl libllvm13
libnode93 libopenexr25 libopenh264-6
libperl5.34 libplacebo192 libpoppler118
libpython3.9 libpython3.9-minimal
libpython3.9-stdlib libsigsegv2
libsvtav1enc0 libwebsockets16 libwireshark15
libwiretap12 libwsutil13 libx264-163
node-ampproject-remapping node-source-map
node-terser openjdk-11-jdk
openjdk-11-jdk-headless openjdk-11-jre
perl-modules-5.34 ruby2.7 ruby2.7-dev
ruby2.7-doc
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
postgresql-14
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
248 not fully installed or removed.
After this operation, 54.0 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 389071 files and directories currently installed.)
Removing postgresql-14 (14.5-2) ...
invoke-rc.d: could not determine current runlevel
Stopping PostgreSQL 14 database server: mainError: Data directory /var/lib/postgresql/14/main must not be owned by root ... failed!
failed!
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: error processing package postgresql-14 (--remove):
installed postgresql-14 package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
postgresql-14
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

Fred Sheehan
2022-11-18, 16:00
You need to be sudo to remove that with apt...

try updating your cluster instead;

https://www.paulox.net/2022/04/28/upgrading-postgresql-from-version-13-to-14-on-ubuntu-22-04-jammy-jellyfish/

kopepoc
2022-11-20, 19:59
You need to be sudo to remove that with apt...

try updating your cluster instead;

https://www.paulox.net/2022/04/28/upgrading-postgresql-from-version-13-to-14-on-ubuntu-22-04-jammy-jellyfish/

Unfortunately does not work. Remember that's kali inside Termux:

# pg_dropcluster 14 main --stop
Error: Data directory /var/lib/postgresql/14/main must not be owned by root

kopepoc
2022-11-20, 20:19
Fixed with latest updates.

rachelgomez123
2022-11-29, 05:55
exit_on_error (boolean)
If on, any error will terminate the current session. By default, this is set to off, so that only FATAL errors will terminate the session.


restart_after_crash (boolean)
When set to on, which is the default, PostgreSQL will automatically reinitialize after a backend crash. Leaving this value set to on is normally the best way to maximize the availability of the database. However, in some circumstances, such as when PostgreSQL is being invoked by clusterware, it may be useful to disable the restart so that the clusterware can gain control and take any actions it deems appropriate.


This parameter can only be set in the postgresql.conf file or on the server command line.


data_sync_retry (boolean)
When set to off, which is the default, PostgreSQL will raise a PANIC-level error on failure to flush modified data files to the file system. This causes the database server to crash. This parameter can only be set at server start.


On some operating systems, the status of data in the kernel's page cache is unknown after a write-back failure. In some cases it might have been entirely forgotten, making it unsafe to retry; the second attempt may be reported as successful, when in fact the data has been lost. In these circumstances, the only way to avoid data loss is to recover from the WAL after any failure is reported, preferably after investigating the root cause of the failure and replacing any faulty hardware.


If set to on, PostgreSQL will instead report an error but continue to run so that the data flushing operation can be retried in a later checkpoint. Only set it to on after investigating the operating system's treatment of buffered data in case of write-back failure.


recovery_init_sync_method (enum)
When set to fsync, which is the default, PostgreSQL will recursively open and synchronize all files in the data directory before crash recovery begins. The search for files will follow symbolic links for the WAL directory and each configured tablespace (but not any other symbolic links). This is intended to make sure that all WAL and data files are durably stored on disk before replaying changes. This applies whenever starting a database cluster that did not shut down cleanly, including copies created with pg_basebackup.


On Linux, syncfs may be used instead, to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files and each tablespace (but not any other file systems that may be reachable through symbolic links). This may be a lot faster than the fsync setting, because it doesn't need to open each file one by one. On the other hand, it may be slower if a file system is shared by other applications that modify a lot of files, since those files will also be written to disk. Furthermore, on versions of Linux before 5.8, I/O errors encountered while writing data to disk may not be reported to PostgreSQL, and relevant error messages may appear only in kernel logs.


This parameter can only be set in the postgresql.conf file or on the server command line.

Regards,
Rachel Gomez