[Mapbender-users] Antw: Mapbender4 - Username/PW in Verbindungsstring zur PostgreSQL-DB

Astrid Emde (WhereGroup) astrid.emde at wheregroup.com
Sun Mar 16 23:38:09 PDT 2025


Hallo Daniel,

bei einem Passwort mit Sonderzeichen, muss die URL ggf. encodiert 
werden.

Infos findest du hier
https://symfony.com/doc/current/doctrine.html
https://stackoverflow.com/questions/50346549/symfony-4-flex-database-connection-using-urlencode

Sollte das weiterhin nicht klappen, kannst du auch die doctrine.yaml 
anpassen und wieder die alte Schreibweise wie bie Mapbender 3.3.x 
verwenden.

Viele Grüße

Astrid

Am 2025-03-13 16:00, schrieb Olaf Roehling via Mapbender_users:
> Hallo,
> existiert die Datenbank denn ? "the database platform while connecting
> to a non-existing database is deprecated)
> 
> Beste Grüße
> 
> Landkreis Wittenberg
> Fachdienst 10
> GIS - Koordinator
> Olaf Roehling
> Breitscheidstraße 3
> 06886 Lutherstadt Wittenberg
> 
> Telefon :+49 3491 806-1219
> 
> mailto: olaf.roehling at landkreis-wittenberg.de
> 
>  [1]
> Facebook [2] | YouTube [3] | Instagram [4] | LinkedIn [5] |
> WhatsApp-Kanal [6]
>>>> Daniel Grohmann via Mapbender_users
> <mapbender_users at lists.osgeo.org> 13.03.2025 15:56 >>>
> 
> Hallo zusammen,
> 
> die Konfiguration der PostgreSQL-Datenbankverbindung in der Datei
> ".env.local" erfolgt bei Mapbender V4 über einen Verbindungsstring
> der Form
> MAPBENDER_DATABASE_URL="postgresql://dbuser:dbpassword@localhost:5432/dbname?serverVersion=14&charset=utf8"
> .
> 
> Gibt es bei der Vergabe des Datenbankbenutzers <dbuser> und des
> Passworts <dbpassword> Zeichen, die nicht verwendet werden dürfen?
> Der <dbuser> kann sich mit psql mit der DB <dbname> auf localhost
> verbinden.
> 
> Wenn ich meine Konfiguration mit "bin/console mapbender:config:check"
> überprüfe, erhalte ich folgende Fehlermeldungen.
> 
> Check Database connections
> ==========================
> 
> {"message":"User Deprecated: Relying on a fallback connection used to
> determine the database platform while connecting to a non-existing
> database is deprecated. Either use an existing database name in
> connection parameters or omit the database name if the platform and
> the server configuration allow that. (Connection.php:464 called by
> Connection.php:416, https://github.com/doctrine/dbal/pull/5707,
> package
> doctrine/dbal)","context":{"exception":{"class":"ErrorException","message":"User
> Deprecated: Relying on a fallback connection used to determine the
> database platform while connecting to a non-existing database is
> deprecated. Either use an existing database name in connection
> parameters or omit the database name if the platform and the server
> configuration allow that. (Connection.php:464 called by
> Connection.php:416, https://github.com/doctrine/dbal/pull/5707,
> package
> doctrine/dbal)","code":0,"file":"/var/www/mapbender4/vendor/doctrine/deprecations/src/Deprecation.php:208"}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2025-03-13T14:42:51.160199+00:00","extra":{}}
> {"message":"User Deprecated: Relying on the DBAL connecting to the
> \"postgres\" database by default is deprecated. Unless you want to
> have the server determine the default database for the connection,
> specify the database name explicitly. (Driver.php:92 called by
> Driver.php:35, https://github.com/doctrine/dbal/pull/5705, package
> doctrine/dbal)","context":{"exception":{"class":"ErrorException","message":"User
> Deprecated: Relying on the DBAL connecting to the \"postgres\"
> database by default is deprecated. Unless you want to have the server
> determine the default database for the connection, specify the
> database name explicitly. (Driver.php:92 called by Driver.php:35,
> https://github.com/doctrine/dbal/pull/5705, package
> doctrine/dbal)","code":0,"file":"/var/www/mapbender4/vendor/doctrine/deprecations/src/Deprecation.php:208"}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2025-03-13T14:42:51.160244+00:00","extra":{}}
> {"message":"Error thrown while running command
> \"mapbender:config:check\". Message: \"An exception occurred in the
> driver: SQLSTATE[08006] [7] could not translate host name
> \"mapbender\" to address: Name or service not
> known\"","context":{"exception":{"class":"Doctrine\\DBAL\\Exception\\ConnectionException","message":"An
> exception occurred in the driver: SQLSTATE[08006] [7] could not
> translate host name \"mapbender\" to address: Name or service not
> known","code":7,"file":"/var/www/mapbender4/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php:77","previous":{"class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","message":"SQLSTATE[08006]
> [7] could not translate host name \"mapbender\" to address: Name or
> service not
> known","code":7,"file":"/var/www/mapbender4/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:24","previous":{"class":"PDOException","message":"SQLSTATE[08006]
> [7] could not translate host name \"mapbender\" to address: Name or
> service not
> known","code":7,"file":"/var/www/mapbender4/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php:34"}}},"command":"mapbender:config:check","message":"An
> exception occurred in the driver: SQLSTATE[08006] [7] could not
> translate host name \"mapbender\" to address: Name or service not
> known"},"level":500,"level_name":"CRITICAL","channel":"console","datetime":"2025-03-13T14:42:51.160788+00:00","extra":{}}
> 14:42:51 CRITICAL [console] Error thrown while running command
> "mapbender:config:check". Message: "An exception occurred in the
> driver: SQLSTATE[08006] [7] could not translate host name "mapbender"
> to address: Name or service not known" ["exception" =>
> Doctrine\DBAL\Exception\ConnectionException^ { …},"command" =>
> "mapbender:config:check","message" => "An exception occurred in the
> driver: SQLSTATE[08006] [7] could not translate host name "mapbender"
> to address: Name or service not known"]
> {"message":"Command \"mapbender:config:check\" exited with code
> \"7\"","context":{"command":"mapbender:config:check","code":7},"level":100,"level_name":"DEBUG","channel":"console","datetime":"2025-03-13T14:42:51.167210+00:00","extra":{}}
> 
> In ExceptionConverter.php line 77:
> 
> An exception occurred in the driver: SQLSTATE[08006] [7] could not
> translate host name "mapbender" to address: Name or service not known
> 
> In Exception.php line 24:
> 
> SQLSTATE[08006] [7] could not translate host name "mapbender" to
> address: Name or service not known
> 
> In Driver.php line 34:
> 
> SQLSTATE[08006] [7] could not translate host name "mapbender" to
> address: Name or service not known
> 
> mapbender:config:check
> 
> Für Hinweise bin ich wie immer sehr dankbar ;-)
> 
> Viele Grüße,
> Daniel
> 
> Mit freundlichem Gruß
> 
> im Auftrag
> 
> Daniel Grohmann
>  [7]
>  [8]
>  [9]
> 
> 1. Sachbearbeiter Geodaten
> 
> --
> 
> Landeshauptstadt Magdeburg
> 
> - Die Oberbürgermeisterin -
> Fachbereich Stadtplanung und Vermessung
> Team Geodaten
> 
> An der Steinkuhle 6 | 39128 Magdeburg
> 
> Telefon:
> +49 391 540-5150
> 
> E-Mail:
> daniel.grohmann at va.magdeburg.de
> 
> Website:
> www.magdeburg.de [10]
> 
> WICHTIG: Diese Information ist ausschließlich für den Adressaten
> bestimmt und kann vertrauliche oder gesetzlich geschützte
> Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße
> Adressat sind, unterrichten Sie bitte den Absender und vernichten
> diese E-Mail. Anderen als dem bestimmungsgemäßen Adressaten ist es
> untersagt, diese E-Mail zu speichern, weiterzuleiten oder ihren
> Inhalt, auf welche Weise auch immer, zu verwenden. Es werden aktuelle
> Virenschutzprogramme verwendet. Für Schäden, die dem Empfänger
> gleichwohl durch vom Absender zugesandte mit Viren befallene E-Mails
> entstehen, schließt die Landeshauptstadt Magdeburg jegliche Haftung
> aus.
> 
> 
> 
> Links:
> ------
> [1] https://www.landkreis-wittenberg.de
> [2] https://www.facebook.com/lkwbg
> [3] https://www.youtube.com/channel/UC1i-cGdts2YDblf1sJOE1Vg
> [4] https://www.instagram.com/lk.wbg/
> [5] https://www.linkedin.com/company/landkreis-wittenberg/
> [6] https://whatsapp.com/channel/0029Vac8hsM9Gv7bCkQrh23W
> [7] https://twitter.com/Ottostadt
> [8] https://www.youtube.com/magdeburgDE
> [9] https://www.facebook.com/Landeshauptstadt.Magdeburg
> [10] http://www.magdeburg.de/
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapbender_users

-- 
Mit freundlichen Grüßen

Astrid Emde
GIS-Consultant

---------------------------------------------
FOSSGIS Konferenz 2025 in Münster
26.-29. März 2025
https://www.fossgis.de/konferenz/
---------------------------------------------

   Astrid Emde
   WhereGroup GmbH
   Eifelstraße 7
   53119 Bonn
   Germany

   Tel: +49(0)228 90 90 38 - 22
   Fax: +49(0)228 90 90 38 - 11

   astrid.emde at wheregroup.com
   www.wheregroup.com

   Meinen PGP Public-Key können Sie unter pgp.mit.edu herunterladen:
   
https://keys.openpgp.org/vks/v1/by-fingerprint/01F8152D36FC07C25EADDE86C5084ACC1C287CCB
   Signierte und/oder verschlüsselte Nachrichten sind sehr willkommen

   Geschäftsführer:
   Olaf Knopp, Peter Stamm
   Amtsgericht Bonn, HRB 9885
-------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x1C287CCB.asc
Type: application/pgp-keys
Size: 1574 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapbender_users/attachments/20250317/e3bb6b58/attachment.key>


More information about the Mapbender_users mailing list