#1053458 openstreetmap-carto-common: Configure step failed with FATAL: role "root" does not exist

#1053458#5
Date:
2023-10-04 12:59:13 UTC
From:
To:
Dear Maintainer,

When installing openstreetmap-carto-common package (as a dependency of
openstreetmap-carto), the configure step failed after having answered
yes to all the questions (as I remember: "do you want to download the
additionnal resources?" and "What is the name of the database? gis").

Here is the error message from apt install:

Setting up openstreetmap-carto-common (5.7.0-1) ...
INFO:root:Starting load of external data into database
Traceback (most recent call last):
  File "/usr/share/openstreetmap-carto-common/./get-external-data.py", line 405, in <module>
    main()
  File "/usr/share/openstreetmap-carto-common/./get-external-data.py", line 305, in main
    conn = psycopg2.connect(database=database,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  role "root" does not exist

dpkg: error processing package openstreetmap-carto-common (--configure):
 installed openstreetmap-carto-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of openstreetmap-carto:
 openstreetmap-carto depends on openstreetmap-carto-common; however:
  Package openstreetmap-carto-common is not configured yet.

dpkg: error processing package openstreetmap-carto (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 openstreetmap-carto-common
 openstreetmap-carto
E: Sub-process /usr/bin/dpkg returned an error code (1)


It seems indeed that by default the root user does not have access to
PostgreSQL databases, and only postgres user has superuser privileges.
So maybe this script should be run as postgres user.

I'd like to mention that I tried to install this package on an almost
completely fresh install of Debian 12. I followed this tutorial until
the end [1] before noticing that the openstreetmap-carto package was
part of Debian. But I donc think that it was the source of the issue.

[1] https://switch2osm.org/serving-tiles/manually-building-a-tile-server-debian-12/

#1053458#10
Date:
2023-10-05 07:27:08 UTC
From:
To:
openstreetmap-carto-common has more issues, it lacks the dependencies
for the get-external-data.py script (python3-{psycopg2,requests,yaml})
causing it to fail in minimal chroot.

I think we should remove the automatic execution of get-external-data.py
in the maintainer scripts and let the user set it up for their
environment. But I'll leave that to josch.

Kind Regards,

Bas

#1053458#15
Date:
2024-03-19 22:06:49 UTC
From:
To:
Dear Maintainer,
#1053458#20
Date:
2026-06-04 16:05:01 UTC
From:
To:
Dear Maintainer,

I'd also vote for removing the postinst script from
openstreetmap-carto-common. Not just because it currently doesn't work
out-of-the-box, but also because it might not actually be that useful
anymore. The way I understand it, the get-external-data.py script (or
its predecessor) originally downloaded (shape-) files with e.g.
coastlines, extracted them and stored them in a 'data' directory where
they were referenced from the style. So it made sense to run it after
the installation in order to have this data, which is required for
rendering, already downloaded and ready.

However, for a couple versions of the style now, it doesn't store the
files anymore, it imports them into a running PostgreSQL/PostGIS
database where the corresponding tables are then used by the style (in
order to be able to actually render anything, an OSM extract or planet
must be imported into the same database, too). So I guess that this
change in behavior is what actually somewhat broke the postinst script -
originally, no database access was required, but now it is.


Manfred

#1053458#25
Date:
2026-06-04 17:50:36 UTC
From:
To:
Since you actually use the package, I suggest you get more involved in its maintenance, I'm just keeping it on life support and have already had it removed from the archive once before because no one was willing and able to fix node-carto until josch needed to scratch that itch.

I was waiting for him to chime in on this issue, but he hasn't touched this package since 2022.

Kind Regards,

Bas

#1053458#30
Date:
2026-06-08 08:39:34 UTC
From:
To:
Hi,

Am Thu, Jun 04, 2026 at 07:50:36PM +0200 schrieb Sebastiaan Couwenberg:

I can't really promise much, but I've subscribed to the package on
tracker.debian.org now and set up a watch on the repository in Salsa. If
new bug reports or other issues show up, I will try to take a look and
maybe come up with a fix or analysis/thoughts.

I see that you've removed the maintainer scripts for downloading the
data in Git - thanks for that! Certainly simplifies the package and its
maintenance a bit, too.


Kind regards,
Manfred

#1053458#35
Date:
2026-09-10 10:34:13 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
openstreetmap-carto, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1053458@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bas Couwenberg <sebastic@debian.org> (supplier of updated openstreetmap-carto package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 10 Sep 2026 12:16:35 +0200
Source: openstreetmap-carto
Architecture: source
Version: 6.1.0-1
Distribution: unstable
Urgency: medium
Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
Changed-By: Bas Couwenberg <sebastic@debian.org>
Closes: 1053458
Changes:
 openstreetmap-carto (6.1.0-1) unstable; urgency=medium
 .
   * Team upload.
   * New upstream release.
   * Drop maintainer script to run get-external-data.py.
     (closes: #1053458)
Checksums-Sha1:
 988004f0bb8626e6ea2c2e2c3528ba2a455c34ce 2262 openstreetmap-carto_6.1.0-1.dsc
 38898f09edfaa7afc45248a561b2b3dc673414fd 3508837 openstreetmap-carto_6.1.0.orig.tar.gz
 166fd0c5d0241666692e907c7b60bb4b9134b56b 12224 openstreetmap-carto_6.1.0-1.debian.tar.xz
 3bbf8eec10539c85f02a4d428ed68e33526012ee 10196 openstreetmap-carto_6.1.0-1_amd64.buildinfo
Checksums-Sha256:
 385a75c0cb94b09cecb4812e139f7f70553cb0e34c01061ec758deaca272a9ba 2262 openstreetmap-carto_6.1.0-1.dsc
 691aa2fc00a2986a9b1b9a41ed278b62b0bd5a1f535e4774cc92abba6d60cba2 3508837 openstreetmap-carto_6.1.0.orig.tar.gz
 d59ab3b9834c219fbee6ac7aae9bde17c3ebf45ee1e071158d08358c7053bb76 12224 openstreetmap-carto_6.1.0-1.debian.tar.xz
 0324380312831b2878a2431743ec5162faff9e93243b312bd4b1acd462a92358 10196 openstreetmap-carto_6.1.0-1_amd64.buildinfo
Files:
 57bb79ff6ac6ad40fad1e6f50f6f56c1 2262 graphics optional openstreetmap-carto_6.1.0-1.dsc
 adff9061fc2fef8b1fb34d58093481d2 3508837 graphics optional openstreetmap-carto_6.1.0.orig.tar.gz
 257f01c80ddf0749145ecd8b409674a5 12224 graphics optional openstreetmap-carto_6.1.0-1.debian.tar.xz
 b3b2da957757c07e3667a8baa94cbbc9 10196 graphics optional openstreetmap-carto_6.1.0-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEgYLeQXBWQI1hRlDRZ1DxCuiNSvEFAmqihEoACgkQZ1DxCuiN
SvHwcRAAwwFvOzlUB5GZTSyTalpXVLbK4dPpYI7JL/xBobSXYrsLVk2O+vb7oO2q
W6EzSPCuOEHJPJPE8eCFQyEALucQpC/PNVkn4zcstrrZr5LAsInw1cvrQzPVf3a9
PKZcocEoxCqa5zTAHNnf62vfZmSHCV/VnvYbnir3ceuBCIFbfOoyo3vnR4cKmqr+
xoXJlESzJHiIxFoh+f0htMkH8nV08PB5/dl2tMjR9uUZekDysAdmb8LIWpz7P3z8
KV8M06pqS9DeoqZtMr2otqaAgzhRf2twjzz+2XT+eY2+uDq8HfL6gxlw9MS91NFW
6RWFgYukf8KpFzYm6iAuUq1paet4mDoQPZ487z2gel/LdU5IHpUPJK304DnDhWNh
ns8ovxVlk1qOJKxXTuOWBYIttIUhUY3Ld6q8YImf7GJ3plbnycsodq9DsmQ1zOH9
47YCwjuUqIrPr7DMuYXGPZHXvipaayqtx33S3/eKtWjX8jpogIh85r1UZqjF6m0e
4XvIhD72cFL4L9jiYviKEBg+fQkpq34AGf6SqP3A65uEK9ZiogkT266hTkAMJH4t
9ZRxb2mR7brTEfHFnMlO174/KUgpP+EZOHJFvfeWBM3njAyBOtmzxvNBe/D+JGnU
usLB+Hw/wXpggIQ66FvryjhGKt+cJZqVJwOQQVlgVZ21Dw2w0u0=
=1aFp
-----END PGP SIGNATURE-----