[katello] puppet environment missing after new content view is published

Hi,

On katello 2.2.1, I currently have the problem that after adding a new
content view "GlusterFS 7", there is no puppet environment. The task
finishes without errors, but when I want to change the content view of a
host I get the error below:

An error occurred saving the Content Host: Couldn't find puppet
environment associated with lifecycle environment 'Library' and
content view 'GlusterFS 7'

In the foreman log, I see this:

2015-07-13 13:19:07 [E] Katello::Errors::NotFound: Couldn't find
puppet environment associated with lifecycle environment 'Library'
and content view 'GlusterFS 7'
2015-07-13 13:25:22 [E] Couldn't find puppet environment associated
with lifecycle environment 'Library' and content view 'GlusterFS 7'
(Katello::Errors::NotFound)

And the error below may be related:

/var/log/candlepin/error.log

2015-07-13 13:56:27,752 [req=c4bce039-597d-4ee4-86de-a09e3994481e,
org=Netbulae] WARN  org.hibernate.engine.jdbc.spi.SqlExceptionHelper
- SQL Error: 0, SQLState: 23505

2015-07-13 13:56:27,752 [req=c4bce039-597d-4ee4-86de-a09e3994481e,
org=Netbulae] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper
- ERROR: duplicate key value violates unique constraint
"cp_env_cnt_env_id_cntid_ky"
2015-07-13 13:56:27,767 [req=c4bce039-597d-4ee4-86de-a09e3994481e,
org=Netbulae] ERROR
org.candlepin.common.exceptions.mappers.CandlepinExceptionMapper -
Runtime Error could not execute statement at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse:2,102
org.hibernate.exception.ConstraintViolationException: could not
execute statement

Dumps of the database confirm there is no puppet environment:

candlepin=# select * from cp_environment;
  id  |          created           |          updated           |
description |           name           |            
owner_id
··· ------+----------------------------+----------------------------+-------------+--------------------------+---------------------------------- 1 | 2015-03-06 13:21:34.93+01 | 2015-03-06 13:21:34.93+01 > > Library | 8ae4e4984bef06ad014bef089f060001 1-6 | 2015-03-06 15:07:16.211+01 | 2015-03-06 15:07:16.211+01 > > Library/CentOS6_Base | 8ae4e4984bef06ad014bef089f060001 1-7 | 2015-03-23 11:49:34.655+01 | 2015-03-23 11:49:34.655+01 > > Library/oVirt35_Host_7 | 8ae4e4984bef06ad014bef089f060001 1-8 | 2015-03-23 14:30:16.653+01 | 2015-03-23 14:30:16.653+01 > > Library/oVirt35_Engine_7 | 8ae4e4984bef06ad014bef089f060001 1-9 | 2015-03-23 14:32:22.89+01 | 2015-03-23 14:32:22.89+01 > > Library/GlusterFS36_7 | 8ae4e4984bef06ad014bef089f060001 1-10 | 2015-03-30 14:07:25.795+02 | 2015-03-30 14:07:25.795+02 > > Library/CentOS7_Base | 8ae4e4984bef06ad014bef089f060001 1-17 | 2015-06-18 15:00:54.067+02 | 2015-06-18 15:00:54.067+02 > > Library/Katello22_6 | 8ae4e4984bef06ad014bef089f060001 1-16 | 2015-06-18 15:30:45.682+02 | 2015-06-18 15:30:45.682+02 > > Library/Katello22_7 | 8ae4e4984bef06ad014bef089f060001 1-20 | 2015-07-13 14:16:32.077+02 | 2015-07-13 14:16:32.077+02 > > Library/GlusterFS_7 | 8ae4e4984bef06ad014bef089f060001
select * from katello_content_views;
 id |           name            |           label           |
description | organization_id | default |         created_at        
>         updated_at         | composite |
 next_version
----+---------------------------+---------------------------+-------------+-----------------+---------+----------------------------+----------------------------+-----------+
--------------
  1 | Default Organization View | Default_Organization_View
>             >               1 | t       | 2015-03-06
12:21:33.705571 | 2015-03-06 12:21:33.705571 |           |
            1
  6 | CentOS6 Base              | CentOS6_Base             
>             >               1 | f       | 2015-03-06
14:06:26.970763 | 2015-03-06 14:06:26.970763 |           |
            3
 16 | Katello22 7               | Katello22_7              
>             >               1 | f       | 2015-06-18
12:37:12.061507 | 2015-06-18 12:37:12.061507 |           |
            3
  9 | GlusterFS36 7             | GlusterFS36_7            
>             >               1 | f       | 2015-03-18
09:39:48.103571 | 2015-03-18 09:39:48.103571 |           |
           13
 10 | CentOS7 Base              | CentOS7_Base             
>             >               1 | f       | 2015-03-30
09:45:59.809496 | 2015-03-30 09:45:59.809496 |           |
            7
 17 | Katello22 6               | Katello22_6              
>             >               1 | f       | 2015-06-18
12:37:31.606092 | 2015-06-18 12:37:31.606092 |           |
            3
  8 | oVirt35 Engine 7          | oVirt35_Engine_7         
>             >               1 | f       | 2015-03-18
09:38:13.718809 | 2015-03-18 09:38:13.718809 |           |
           17
  7 | oVirt35 Host 7            | oVirt35_Host_7           
>             >               1 | f       | 2015-03-18
09:36:30.824259 | 2015-03-18 09:36:30.824259 |           |
           30
 20 | GlusterFS 7               | GlusterFS_7              
>             >               1 | f       | 2015-07-13
12:13:23.835354 | 2015-07-13 12:13:23.835354 |           |
            2
(9 rows)

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts


Tel: 053 20 30 270 	info@netbulae.eu 	Staalsteden 4-3A 	KvK 08198180
Fax: 053 20 30 271 	www.netbulae.eu 	7547 TA Enschede 	BTW NL821234584B01

>
> Dumps of the database confirm there is no puppet environment:
>
>

My bad, there is a puppet environment "GlusterFS_7" in the database. I
looked over it as has been created two hours later. It still is not
visible in "Puppet Environment" list in the GUI.

> candlepin=# select * from cp_environment;
> id | created | updated |
> description | name |
> owner_id
> ------±---------------------------±---------------------------±------------±-------------------------±---------------------------------
> 1 | 2015-03-06 13:21:34.93+01 | 2015-03-06 13:21:34.93+01
> > > Library |
> 8ae4e4984bef06ad014bef089f060001
> 1-6 | 2015-03-06 15:07:16.211+01 | 2015-03-06 15:07:16.211+01
> > > Library/CentOS6_Base |
> 8ae4e4984bef06ad014bef089f060001
> 1-7 | 2015-03-23 11:49:34.655+01 | 2015-03-23 11:49:34.655+01
> > > Library/oVirt35_Host_7 |
> 8ae4e4984bef06ad014bef089f060001
> 1-8 | 2015-03-23 14:30:16.653+01 | 2015-03-23 14:30:16.653+01
> > > Library/oVirt35_Engine_7 |
> 8ae4e4984bef06ad014bef089f060001
> 1-9 | 2015-03-23 14:32:22.89+01 | 2015-03-23 14:32:22.89+01
> > > Library/GlusterFS36_7 |
> 8ae4e4984bef06ad014bef089f060001
> 1-10 | 2015-03-30 14:07:25.795+02 | 2015-03-30 14:07:25.795+02
> > > Library/CentOS7_Base |
> 8ae4e4984bef06ad014bef089f060001
> 1-17 | 2015-06-18 15:00:54.067+02 | 2015-06-18 15:00:54.067+02
> > > Library/Katello22_6 |
> 8ae4e4984bef06ad014bef089f060001
> 1-16 | 2015-06-18 15:30:45.682+02 | 2015-06-18 15:30:45.682+02
> > > Library/Katello22_7 |
> 8ae4e4984bef06ad014bef089f060001
> 1-20 | 2015-07-13 14:16:32.077+02 | 2015-07-13 14:16:32.077+02
> > > Library/GlusterFS_7 |
> 8ae4e4984bef06ad014bef089f060001
>
>

Met vriendelijke groet, With kind regards,

Jorick Astrego

Netbulae Virtualization Experts

··· On 07/13/2015 04:06 PM, Jorick Astrego wrote:
Tel: 053 20 30 270 	info@netbulae.eu 	Staalsteden 4-3A 	KvK 08198180
Fax: 053 20 30 271 	www.netbulae.eu 	7547 TA Enschede 	BTW NL821234584B01