[Spacewalk-list] All attempts to connect to the database failed when installing Spacewalk 2.7 with PostgreSQL backend
Vitaly Y. | ServerBee
vitaly.yakovenko at serverbee.net
Thu Mar 29 19:20:21 UTC 2018
Also interesting thing. When try re-install spacewalk via ansible several
times I always get error in Perl script file:
: FAILED! => {
"changed": true,
"cmd": [
"spacewalk-setup",
"--answer-file=/root/spacewalk-answer-file",
"--external-postgresql"
],
"delta": "0:00:46.896381",
"end": "2018-03-29 22:12:34.521123",
"invocation": {
"module_args": {
"_raw_params": "spacewalk-setup
--answer-file=/root/spacewalk-answer-file --external-postgresql",
"_uses_shell": false,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"msg": "non-zero return code",
"rc": 39,
"start": "2018-03-29 22:11:47.624742",
"stderr": "Use of uninitialized value in scalar chomp at
/usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 618.\nUse of
uninitialized value in substitution (s///) at
/usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 619.",
"stderr_lines": [
"Use of uninitialized value in scalar chomp at
/usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 618.",
"Use of uninitialized value in substitution (s///) at
/usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 619."
],
"stdout": "* Loading answer file: /root/spacewalk-answer-file.\n*
Setting up SELinux..\n** Database: Setting up database connection for
PostgreSQL backend.\n** Database: Populating database.\nThe Database has
schema. Would you like to clear the database [Y]? ** Database: Clearing
database.\n** Database: Shutting down spacewalk services that may be using
DB.\n** Database: Services stopped. Clearing DB.\n** Database:
Re-populating database.\n*** Progress: #\n* Configuring tomcat.\n* Setting
up users and groups.\n** GPG: Initializing GPG and importing key.\n*
Performing initial configuration.\n* Configuring apache SSL virtual
host.\n* Configuring jabberd.\n* Creating SSL certificates.\n** SSL:
Generating CA certificate.\n** SSL: Deploying CA certificate.\n** SSL:
Generating server certificate.\n** SSL: Storing SSL certificates.\nThere
was a problem storing the SSL certificate. Exit value: 11.\nPlease examine
/var/log/rhn/rhn_installation.log for more information.",
"stdout_lines": [
"* Loading answer file: /root/spacewalk-answer-file.",
"* Setting up SELinux..",
"** Database: Setting up database connection for PostgreSQL
backend.",
"** Database: Populating database.",
"The Database has schema. Would you like to clear the database
[Y]? ** Database: Clearing database.",
"** Database: Shutting down spacewalk services that may be using
DB.",
"** Database: Services stopped. Clearing DB.",
"** Database: Re-populating database.",
"*** Progress: #",
"* Configuring tomcat.",
"* Setting up users and groups.",
"** GPG: Initializing GPG and importing key.",
"* Performing initial configuration.",
"* Configuring apache SSL virtual host.",
"* Configuring jabberd.",
"* Creating SSL certificates.",
"** SSL: Generating CA certificate.",
"** SSL: Deploying CA certificate.",
"** SSL: Generating server certificate.",
"** SSL: Storing SSL certificates.",
"There was a problem storing the SSL certificate. Exit value:
11.",
"Please examine /var/log/rhn/rhn_installation.log for more
information."
]
}
I added missed line in answer file:
>>ssl-set-cnames = {{ inventory_hostname }}
But still get the same error.
On Thu, Mar 29, 2018 at 9:45 PM, Vitaly Y. | ServerBee <
vitaly.yakovenko at serverbee.net> wrote:
> Hi,
>
> Unfortunately with locale all good on my server:
>
> # locale
> LANG=en_US.UTF-8
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC="en_US.UTF-8"
> LC_TIME="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER="en_US.UTF-8"
> LC_NAME="en_US.UTF-8"
> LC_ADDRESS="en_US.UTF-8"
> LC_TELEPHONE="en_US.UTF-8"
> LC_MEASUREMENT="en_US.UTF-8"
> LC_IDENTIFICATION="en_US.UTF-8"
> LC_ALL=
>
>
> postgres=# \l
> List of databases
> Name | Owner | Encoding | Collate | Ctype |
> Access privileges
> -----------+----------------+----------+-------------+------
> -------+-----------------------------------
> postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> spacewalk | spacewalk_user | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> spacewalk_user=CTc/spacewalk_user
> template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> =c/postgres +
> | | | | |
> postgres=CTc/postgres
> template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> =c/postgres +
> | | | | |
> postgres=CTc/postgres
> (4 rows)
>
>
> It's another problem but I still not resolved it.
>
> On Tue, Mar 6, 2018 at 1:34 PM, Andrei Popenta <andrei.popenta at visma.com>
> wrote:
>
>> Hi,
>>
>> Take a look here, it might help. https://bugzilla.redhat.com/sh
>> ow_bug.cgi?id=1524221
>> Andrei
>>
>> On Mon, Mar 5, 2018 at 11:10 PM, Vitaly Y. | ServerBee <
>> vitaly.yakovenko at serverbee.net> wrote:
>>
>>> Hi,
>>>
>>> I try to setup Spacewalk server by following command:
>>> # spacewalk-setup --answer-file=/root/spacewalk-answer-file
>>> --external-postgresql
>>>
>>> I use --external-postgresql option because custom PostgreSQL 9.4 version
>>> has been installed on EL7.
>>>
>>> # cat /root/spacewalk-answer-file
>>> admin-email = root at localhost
>>> ssl-set-org = O
>>> ssl-set-org-unit = OU
>>> ssl-set-city = L
>>> ssl-set-state = P
>>> ssl-set-country = US
>>> ssl-password = s3cret
>>> ssl-set-email = root at localhost
>>> ssl-config-sslvhost = Y
>>> db-backend=postgresql
>>> db-name=spacewalk
>>> db-user=spacewalk_user
>>> db-password=s3crets3crets3crets3cret
>>> db-host=localhost
>>> db-port=5432
>>> enable-tftp=N
>>>
>>> # cat /var/lib/pgsql/9.4/data/pg_hba.conf
>>> # PostgreSQL Client Authentication Configuration File (Ansible)
>>> # TYPE DATABASE USER ADDRESS METHOD
>>> local all all peer
>>> host all all 127.0.0.1/32 md5
>>> host all all ::1/128 md5
>>>
>>>
>>> From shell I can connect to PostgreSQL:
>>>
>>> # psql -h localhost -U spacewalk_user -W -d spacewalk
>>> Password for user spacewalk_user:
>>> psql (9.2.23, server 9.4.17)
>>> WARNING: psql version 9.2, server version 9.4.
>>> Some psql features might not work.
>>> Type "help" for help.
>>>
>>> spacewalk=# \l
>>> List of databases
>>> Name | Owner | Encoding | Collate | Ctype |
>>> Access privileges
>>>
>>> -----------+----------------+----------+-------------+------
>>> -------+----------------------------------
>>> -
>>> postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
>>> spacewalk | spacewalk_user | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
>>> spacewalk_user=CTc/spacewalk_user
>>>
>>>
>>>
>>> Populate_db stage finished without any errors:
>>>
>>> # tail /var/log/rhn/populate_db.log
>>> INSERT 0 1
>>> INSERT 0 1
>>> INSERT 0 1
>>> INSERT 0 1
>>> CREATE FUNCTION
>>> create_varnull_constriants
>>> ----------------------------
>>> 0
>>> (1 row)
>>>
>>>
>>>
>>> But within next setups I always get an error:
>>>
>>> Preparing packages...
>>> rhn-org-httpd-ssl-key-pair-sw-1.0-1.noarch
>>> ERROR: there was a problem trying to initialize the database:
>>>
>>> Exception reported from xx.example.com
>>> Time: Mon Mar 5 22:33:50 2018
>>> Exception type <class 'spacewalk.server.rhnSQL.sql_b
>>> ase.SQLConnectError'>
>>>
>>> Exception Handler Information
>>> Traceback (most recent call last):
>>> File "/usr/lib/python2.7/site-packages/spacewalk/satellite_tools/rhn_ssl_dbstore.py",
>>> line 55, in processCommandline
>>> rhnSQL.initDB()
>>> File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/__init__.py",
>>> line 158, in initDB
>>> raise_with_tb(e, sys.exc_info()[2])
>>> File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/__init__.py",
>>> line 145, in initDB
>>> __init__DB(backend, host, port, username, password, database,
>>> sslmode, sslrootcert)
>>> File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/__init__.py",
>>> line 57, in __init__DB
>>> __DB.connect()
>>> File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py",
>>> line 194, in connect
>>> return self.connect(reconnect=reconnect - 1)
>>> File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py",
>>> line 199, in connect
>>> "All attempts to connect to the database failed"), sys.exc_info()[2])
>>> File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py",
>>> line 184, in connect
>>> self.dbh = psycopg2.connect(" ".join("%s=%s" % (k,
>>> re.escape(str(v))) for k, v in dsndata.items()))
>>> File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line
>>> 164, in connect
>>> conn = _connect(dsn, connection_factory=connection_factory,
>>> async=async)
>>> SQLConnectError: (None, None, 'spacewalk', 'All attempts to connect to
>>> the database failed')
>>>
>>>
>>>
>>> What I missed ?
>>>
>>> _______________________________________________
>>> Spacewalk-list mailing list
>>> Spacewalk-list at redhat.com
>>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>>
>>
>>
>> _______________________________________________
>> Spacewalk-list mailing list
>> Spacewalk-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>
>
>
>
> --
> Best regards,
>
> Vitaly Yakovenko
> Co-Founder & CTO at ServerBee
>
--
Best regards,
Vitaly Yakovenko
Co-Founder & CTO at ServerBee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20180329/4c6174cf/attachment.htm>
More information about the Spacewalk-list
mailing list