Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1079999 - Creating a new puppet environment fails
Summary: Creating a new puppet environment fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Ohad Levy
QA Contact: Elyézer Rezende
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1082581 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-24 13:36 UTC by Lukáš Hellebrandt
Modified: 2019-09-25 21:05 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:08:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 4731 0 None None None 2016-04-22 16:45:45 UTC

Description Lukáš Hellebrandt 2014-03-24 13:36:09 UTC
Description of a problem:
Creating a new puppet environment fails with the following info:

Warning!
ERROR: duplicate key value violates unique constraint "environments_pkey"

PGError
ERROR: duplicate key value violates unique constraint "environments_pkey"
app/controllers/environments_controller.rb:17:in `create'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call' 


How reproducible:
Always

Steps to Reproduce:
1. Configure->Environments
2. New Puppet Environment
3. Set some unique name: "unique_5859598563525652"

Actual results:
Warning as shown in the description

Expected results:
A new puppet environment should be created

Comment 2 jmagen@redhat.com 2014-03-30 08:37:50 UTC
This can be fixed when a user runs a rake task 

rake db:sequences:reset

https://github.com/theforeman/foreman/pull/1337

I think went data is migrated to a database using COPY rather than INSERT, then the sequence is not updated.

Comment 3 Justin Sherrill 2014-03-30 16:20:45 UTC
Moving back to ASSIGNED as the rake task does not solve the issue, nor is the fix actually committed to the internal repo.

Comment 4 Dominic Cleal 2014-03-31 11:55:18 UTC
*** Bug 1082581 has been marked as a duplicate of this bug. ***

Comment 5 Bryan Kearney 2014-03-31 14:50:53 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/4731 has been closed

Comment 7 Elyézer Rezende 2014-05-12 19:27:22 UTC
Verified:

1. Gone to Configure > Environments
2. Clicked on New Puppet Environment
3. Entered a unique name as "unique_5859598563525652"
4. Clicked on "Submit"
5. The puppet environments list is showed

Log when doing the create request:

# tail -f /var/log/{katello,pulp,candlepin,foreman*,headpin,thumbslug,signo,tomcat6}/{*.log,*.out}
Processing by EnvironmentsController#create as */*
  Parameters: {"utf8"=>"✓", "search"=>"", "authenticity_token"=>"509Y7NxFVNnJau9svXvTWFaW9lXn3hSl0/AH0GctkvA=", "environment"=>{"name"=>"unique_5859598563525653", "location_ids"=>[""], "organization_ids"=>[""]}}
Redirected to https://qetello02.usersys.redhat.com/environments
Completed 302 Found in 22ms (ActiveRecord: 10.0ms)
Processing by EnvironmentsController#index as */*
  Rendered environments/index.html.erb within layouts/application (274.4ms)
  Rendered common/_searchbar.html.erb (3.1ms)
  Rendered home/_submenu.html.erb (4.7ms)
  Rendered home/_user_dropdown.html.erb (1.6ms)
Read fragment views/tabs_and_title_records-1 (0.2ms)
  Rendered home/_topbar.html.erb (8.2ms)
  Rendered layouts/base.html.erb (9.9ms)
Completed 200 OK in 301ms (Views: 288.3ms | ActiveRecord: 2.8ms)

Environment:

# for i in `rpm -qa | grep -iE "^rubygem-hammer|^katello|^pulp|^candlepin|^foreman|^headpin|^thumbslug|^elasticsearch|ldap|signo|ruby193-rubygem-runcible" | sort`; do echo "* $i"; do
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.7-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.7-1.el6_5.noarch
* candlepin-tomcat6-0.9.7-1.el6_5.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.6.0.7-1.el6sat.noarch
* foreman-compute-1.6.0.7-1.el6sat.noarch
* foreman-gce-1.6.0.7-1.el6sat.noarch
* foreman-libvirt-1.6.0.7-1.el6sat.noarch
* foreman-ovirt-1.6.0.7-1.el6sat.noarch
* foreman-postgresql-1.6.0.7-1.el6sat.noarch
* foreman-proxy-1.6.0.4-1.el6sat.noarch
* foreman-selinux-1.5.0-0.develop.el6sat.noarch
* foreman-vmware-1.6.0.7-1.el6sat.noarch
* katello-1.5.0-22.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.5-1.el6sat.noarch
* katello-installer-0.0.37-1.el6sat.noarch
* openldap-2.4.23-31.el6.x86_64
* pulp-katello-plugins-0.2-1.el6sat.noarch
* pulp-nodes-common-2.3.1-0.4.beta.el6sat.noarch
* pulp-nodes-parent-2.3.1-0.4.beta.el6sat.noarch
* pulp-puppet-plugins-2.3.1-0.4.beta.el6sat.noarch
* pulp-rpm-plugins-2.3.1-0.4.beta.el6sat.noarch
* pulp-selinux-2.3.1-0.4.beta.el6sat.noarch
* pulp-server-2.3.1-0.4.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.0.8-1.el6sat.noarch
* rubygem-hammer_cli-0.1.0-12.el6sat.noarch
* rubygem-hammer_cli_foreman-0.1.0-12.el6sat.noarch
* rubygem-hammer_cli_foreman_tasks-0.0.2-5.el6sat.noarch
* rubygem-hammer_cli_katello-0.0.3-22.el6sat.noarch

Comment 8 Bryan Kearney 2014-07-02 14:08:12 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.

Comment 9 Bryan Kearney 2014-07-02 14:09:31 UTC
This was delivered in 6.0.3, the Beta version of Satellite 6.0


Note You need to log in before you can comment on or make changes to this bug.