Install on Jessie with MySQL fails

Hello,

The world of foreman/puppet is new to me.

I am trying to install Foreman in a Debian Jessie with MySQL support from
the beginning.
This fails.

The install is in a LXC (2.0).

If I do a plain foreman-installer (with the default PostgreSQL), it works
fine. So, there must be some issue regarding the MySQL support in the
installer anyhow (1.13).

foreman-installer --foreman-db-type=mysql
–foreman-db-manage=false
–foreman-db-host=mysql
–foreman-db-database=foreman
–foreman-db-username=foreman
–foreman-db-password=mypassword

The mysql database is populated (tables are created, etc). So the
connection is fine.

[DEBUG 2016-12-12 21:30:49 main] Foreman_smartproxyforeman.mydomain.com: Making get request to https://foreman.mydomain.com/api/v2/smart_proxies?search=name="foreman.mydomain.com"

[DEBUG 2016-12-12 21:30:55 main] Foreman_smartproxyforeman.mydomain.com: Received response 503 from request to https://foreman.mydomain.com/api/v2/smart_proxies?search=name="foreman.mydomain.com"

[ERROR 2016-12-12 21:30:55 main] /Stage[main]/Foreman_proxy::Register/
Foreman_smartproxy[foreman.mydomain.com]: Could not evaluate: Proxy foreman.
mydomain.com cannot be retrieved: unknown error (response 503)
[ERROR 2016-12-12 21:30:55 main] /usr/share/foreman-installer/modules/
foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:7:in proxy' [ERROR 2016-12-12 21:30:55 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:13:in
[ERROR 2016-12-12 21:30:55 main] /usr/share/foreman-installer/modules/
foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:13:in id' [ERROR 2016-12-12 21:30:55 main] /usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:17:inexists?'
[ERROR 2016-12-12 21:30:55 main] /usr/share/foreman-installer/modules/
foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:17:in `exists?'

Any ideas?
It seems that I will have to install first with postgresql and then migrate.

I can attach the full log if necessary.

-rsd

> Hello,
>
> The world of foreman/puppet is new to me.
>
> I am trying to install Foreman in a Debian Jessie with MySQL support
> from the beginning.
> This fails.
>
> The install is in a LXC (2.0).
>
> If I do a plain foreman-installer (with the default PostgreSQL), it
> works fine. So, there must be some issue regarding the MySQL support in
> the installer anyhow (1.13).
>
> foreman-installer–foreman-db-type=mysql
> --foreman-db-manage=false
> --foreman-db-host=mysql
> --foreman-db-database=foreman
> --foreman-db-username=foreman
> --foreman-db-password=mypassword

Note that these options are different to the default in that they assume
a pre-existing database.

> The mysql database is populated (tables are created, etc). So the
> connection is fine.
>
> >
> [DEBUG
> 2016-12-1221:30:49main] Foreman_smartproxyforeman.mydomain.com:Makinggetrequest
> to
> https://foreman.mydomain.com/api/v2/smart_proxies?search=name="foreman.mydomain.com"
>
> >
> >
> [DEBUG
> 2016-12-1221:30:55main] Foreman_smartproxyforeman.mydomain.com:Receivedresponse
> 503fromrequest to
> https://foreman.mydomain.com/api/v2/smart_proxies?search=name="foreman.mydomain.com"

Can you view the web page at https://foreman.mydomain.com? What error
message does it show? If none, also check/pastebin logs under
/var/log/apache2.

The error here indicates the installer received an error when connecting
to the running Foreman instance it tried to install. A 503 indicates
it's temporarily unavailable for some reason.

··· On 12/12/16 23:38, Raul Dias wrote:


Dominic Cleal
dominic@cleal.org

>
>
> > foreman-installer–foreman-db-type=mysql \
> > --foreman-db-manage=false \
> > --foreman-db-host=mysql \
> > --foreman-db-database=foreman \
> > --foreman-db-username=foreman \
> > --foreman-db-password=mypassword
>
> Note that these options are different to the default in that they assume
> a pre-existing database.
>

The database exists, but is empty. The installer did create the tables.
Is this what you meant?
OTOH, just the tables roles and features have one row each.

··· On Tuesday, December 13, 2016 at 6:58:54 AM UTC-2, Dominic Cleal wrote: > On 12/12/16 23:38, Raul Dias wrote:

Can you view the web page at https://foreman.mydomain.com? What error
message does it show?


We’re sorry, but something went wrong.
If you are the application owner check the logs for more information.

If none, also check/pastebin logs under
/var/log/apache2.

error.log: http://pastebin.com/SFF3YJEG
foreman_access.log: http://pastebin.com/vQV6s8Dm
foreman-ssl_access.log: http://pastebin.com/Fzgzzy3B

access.log, default_error.log, foreman_error.log, foreman-ssl_error.log and
other_vhosts_access.log are empty.
10.10.24.15 is foreman.mydomain.com ip address.

Other logs:
foreman_install.log: http://pastebin.com/h210irfA
production.log: http://pastebin.com/XWUyVHKC

foreman.log
(install): https://www.dropbox.com/s/wxp2lncll81xx8b/foreman.log?dl=0

Looking thru the logs I would be that the installer did populated the
database.

-rsd

production.log indicates it's missing some tables ('sessions') and the
end of foreman_install.log (line 580) suggests it didn't finish setting
up the database. Some tables seem to already be present so it skipped
everything else.

I'd suggest dropping all existing the tables (or recreate the DB) and
then run:

foreman-rake db:migrate
foreman-rake db:seed
foreman-rake apipie:cache:index

This will set up all of the tables and initial configuration. The
db:seed command will print a random admin password out, take note of it.

··· On 13/12/16 17:37, Raul Dias wrote: > > > On Tuesday, December 13, 2016 at 6:58:54 AM UTC-2, Dominic Cleal wrote: > > On 12/12/16 23:38, Raul Dias wrote: > > > foreman-installer--foreman-db-type=mysql \ > > --foreman-db-manage=false \ > > --foreman-db-host=mysql \ > > --foreman-db-database=foreman \ > > --foreman-db-username=foreman \ > > --foreman-db-password=mypassword > > Note that these options are different to the default in that they > assume > a pre-existing database. > > > The database exists, but is empty. The installer did create the > tables. Is this what you meant? > OTOH, just the tables roles and features have one row each.


Dominic Cleal
dominic@cleal.org

just tried the 1.4 RC and everything seems fine.

··· On 14/12/2016 12:10, Dominic Cleal wrote: > On 13/12/16 17:37, Raul Dias wrote: >> >> On Tuesday, December 13, 2016 at 6:58:54 AM UTC-2, Dominic Cleal wrote: >> >> On 12/12/16 23:38, Raul Dias wrote: >> >> > foreman-installer--foreman-db-type=mysql \ >> > --foreman-db-manage=false \ >> > --foreman-db-host=mysql \ >> > --foreman-db-database=foreman \ >> > --foreman-db-username=foreman \ >> > --foreman-db-password=mypassword >> >> Note that these options are different to the default in that they >> assume >> a pre-existing database. >> >> >> The database exists, but is empty. The installer did create the >> tables. Is this what you meant? >> OTOH, just the tables roles and features have one row each. > production.log indicates it's missing some tables ('sessions') and the > end of foreman_install.log (line 580) suggests it didn't finish setting > up the database. Some tables seem to already be present so it skipped > everything else. > > I'd suggest dropping all existing the tables (or recreate the DB) and > then run: > > foreman-rake db:migrate > foreman-rake db:seed > foreman-rake apipie:cache:index > > This will set up all of the tables and initial configuration. The > db:seed command will print a random admin password out, take note of it. >


Att. Raul Dias