Failed uploading transformed data to the Chef 12 server

Hello Guys,

Using this packages:

[root@chef12-server1 ~]# rpm -qa | grep chef
chef-server-11.1.6-1.el6.x86_64
chef-11.16.4-1.el6.x86_64
chef-server-core-12.0.0-1.el6.x86_64

After run: ‘# chef-server-ctl upgrade’ on Centos 6.3 box:


Recipe:

  • service[nginx] action restart
    • restart service service[nginx]

Running handlers:
Running handlers complete

Chef Client finished, 266/420 resources updated in 72.236075247 seconds
opscode Reconfigured!
Ensuring Chef 12 server components are started
ok: run: bookshelf: (pid 8213) 4s
ok: run: nginx: (pid 8369) 2s
ok: run: oc_bifrost: (pid 8099) 7s
ok: run: oc_id: (pid 7378) 38s
ok: run: opscode-chef-mover: (pid 7967) 17s
ok: run: opscode-erchef: (pid 8273) 4s
ok: run: opscode-expander: (pid 7491) 36s
ok: run: opscode-expander-reindexer: (pid 7608) 30s
ok: run: opscode-solr4: (pid 8176) 5s
ok: run: postgresql: (pid 8068) 7s
ok: run: rabbitmq: (pid 6570) 66s
ok: run: redis_lb: (pid 8021) 14s
Chef 12 server started
Writing knife-ec-backup config to /tmp/knife-ec-backup-config.rb
Uploading transformed open source Chef 11 server data to Chef 12 server
WARNING: WebUI not specified. Using /etc/opscode/webui_priv.pem
Detected Enterprise Chef Server version: 12.0.0
Restoring users …
Updating key for admin
Updating key for tiago_cruz
ERROR: Sequel::ForeignKeyConstraintViolation: PG::ForeignKeyViolation:
ERROR: update or delete on table “users” violates foreign key constraint
"org_user_associations_user_id_fkey" on table "org_user_associations"
DETAIL: Key (id)=(0000000000005168ebaf554ff5aeb9e1) is still referenced
from table “org_user_associations”.
Failed uploading transformed data to the Chef 12 server

I’m not sure how to proceed :slight_smile:

Thanks a lot!


– Tiago Cruz

Hi,

Any chance you are upgrading from an RC? The error in question:

ERROR: Sequel::ForeignKeyConstraintViolation: PG::ForeignKeyViolation: ERROR: update or delete on table "users" violates foreign key constraint "org_user_associations_user_id_fkey" on table "org_user_associations"
DETAIL: Key (id)=(0000000000005168ebaf554ff5aeb9e1) is still referenced from table "org_user_associations".

appears to be a problem when we import the sql backup of your user.
When we do that, we also import the old id of that user. This is
mostly an artifact of the fact that the underlying tool
(knife-ec-backup) was originally created for Enterprise Chef to
Enterprise Chef migrations where the user id needs to be preserved for
various reasons. The id update shouldn't really cause any problems in
an empty Chef Server 12 database. However, from the error message
here, it looks like your user tiago_cruz is already associated with an
organization in the new installation, and updating the id of the user
is causing a foreign key constraint violation. What is odd is that at
this point in the upgrade, I don't think your user should be
associated with any orgs yet.

Mind spelling out the steps you took to get here?

Cheers,

Steven

On Wed, Dec 3, 2014 at 4:32 PM, Tiago Cruz tiago.tuxkiller@gmail.com wrote:

Hello Guys,

Using this packages:

[root@chef12-server1 ~]# rpm -qa | grep chef
chef-server-11.1.6-1.el6.x86_64
chef-11.16.4-1.el6.x86_64
chef-server-core-12.0.0-1.el6.x86_64

After run: '# chef-server-ctl upgrade' on Centos 6.3 box:

...
Recipe:

  • service[nginx] action restart
    • restart service service[nginx]

Running handlers:
Running handlers complete

Chef Client finished, 266/420 resources updated in 72.236075247 seconds
opscode Reconfigured!
Ensuring Chef 12 server components are started
ok: run: bookshelf: (pid 8213) 4s
ok: run: nginx: (pid 8369) 2s
ok: run: oc_bifrost: (pid 8099) 7s
ok: run: oc_id: (pid 7378) 38s
ok: run: opscode-chef-mover: (pid 7967) 17s
ok: run: opscode-erchef: (pid 8273) 4s
ok: run: opscode-expander: (pid 7491) 36s
ok: run: opscode-expander-reindexer: (pid 7608) 30s
ok: run: opscode-solr4: (pid 8176) 5s
ok: run: postgresql: (pid 8068) 7s
ok: run: rabbitmq: (pid 6570) 66s
ok: run: redis_lb: (pid 8021) 14s
Chef 12 server started
Writing knife-ec-backup config to /tmp/knife-ec-backup-config.rb
Uploading transformed open source Chef 11 server data to Chef 12 server
WARNING: WebUI not specified. Using /etc/opscode/webui_priv.pem
Detected Enterprise Chef Server version: 12.0.0
Restoring users ...
Updating key for admin
Updating key for tiago_cruz
ERROR: Sequel::ForeignKeyConstraintViolation: PG::ForeignKeyViolation:
ERROR: update or delete on table "users" violates foreign key constraint
"org_user_associations_user_id_fkey" on table "org_user_associations"
DETAIL: Key (id)=(0000000000005168ebaf554ff5aeb9e1) is still referenced
from table "org_user_associations".
Failed uploading transformed data to the Chef 12 server

I'm not sure how to proceed :slight_smile:

Thanks a lot!

--
-- Tiago Cruz

Hi Steven,

I used RC4 and RC5 on that same machine before, but I always remove the
packages and delete the /opt/chef* and /opt/opscode* before.

This is what I did:

  • removed packages chef* and directories /opt/chef* and /opt/opscode*
  • installed chef-server-11.1.6-1.el6.x86_64.rpm
  • used "knife backup export" pointed to my production server
  • used "knife backup restore" pointed to this new server
  • tested the new server, roles, users, cookbooks ok
  • installed chef-server-core-12.0.0-1.el6.x86_64.rpm
  • tried chef-server-ctl upgrade, but failed :frowning:

What I would like to ask you guys:

  • What is the best way to do export/import? Is using "knife backup"?
  • The "knife backup" will work on Chef 12?
  • What is the best way to do rollback on my case? 'Cause either Chef 11 or
    12 was not working, hehehehe

Thanks a lot!

On Wed, Dec 3, 2014 at 5:02 PM, Steven Danna steve@opscode.com wrote:

Hi,

Any chance you are upgrading from an RC? The error in question:

ERROR: Sequel::ForeignKeyConstraintViolation: PG::ForeignKeyViolation:
ERROR: update or delete on table "users" violates foreign key constraint
"org_user_associations_user_id_fkey" on table "org_user_associations"
DETAIL: Key (id)=(0000000000005168ebaf554ff5aeb9e1) is still referenced
from table "org_user_associations".

appears to be a problem when we import the sql backup of your user.
When we do that, we also import the old id of that user. This is
mostly an artifact of the fact that the underlying tool
(knife-ec-backup) was originally created for Enterprise Chef to
Enterprise Chef migrations where the user id needs to be preserved for
various reasons. The id update shouldn't really cause any problems in
an empty Chef Server 12 database. However, from the error message
here, it looks like your user tiago_cruz is already associated with an
organization in the new installation, and updating the id of the user
is causing a foreign key constraint violation. What is odd is that at
this point in the upgrade, I don't think your user should be
associated with any orgs yet.

Mind spelling out the steps you took to get here?

Cheers,

Steven

On Wed, Dec 3, 2014 at 4:32 PM, Tiago Cruz tiago.tuxkiller@gmail.com
wrote:

Hello Guys,

Using this packages:

[root@chef12-server1 ~]# rpm -qa | grep chef
chef-server-11.1.6-1.el6.x86_64
chef-11.16.4-1.el6.x86_64
chef-server-core-12.0.0-1.el6.x86_64

After run: '# chef-server-ctl upgrade' on Centos 6.3 box:

...
Recipe:

  • service[nginx] action restart
    • restart service service[nginx]

Running handlers:
Running handlers complete

Chef Client finished, 266/420 resources updated in 72.236075247 seconds
opscode Reconfigured!
Ensuring Chef 12 server components are started
ok: run: bookshelf: (pid 8213) 4s
ok: run: nginx: (pid 8369) 2s
ok: run: oc_bifrost: (pid 8099) 7s
ok: run: oc_id: (pid 7378) 38s
ok: run: opscode-chef-mover: (pid 7967) 17s
ok: run: opscode-erchef: (pid 8273) 4s
ok: run: opscode-expander: (pid 7491) 36s
ok: run: opscode-expander-reindexer: (pid 7608) 30s
ok: run: opscode-solr4: (pid 8176) 5s
ok: run: postgresql: (pid 8068) 7s
ok: run: rabbitmq: (pid 6570) 66s
ok: run: redis_lb: (pid 8021) 14s
Chef 12 server started
Writing knife-ec-backup config to /tmp/knife-ec-backup-config.rb
Uploading transformed open source Chef 11 server data to Chef 12 server
WARNING: WebUI not specified. Using /etc/opscode/webui_priv.pem
Detected Enterprise Chef Server version: 12.0.0
Restoring users ...
Updating key for admin
Updating key for tiago_cruz
ERROR: Sequel::ForeignKeyConstraintViolation: PG::ForeignKeyViolation:
ERROR: update or delete on table "users" violates foreign key constraint
"org_user_associations_user_id_fkey" on table "org_user_associations"
DETAIL: Key (id)=(0000000000005168ebaf554ff5aeb9e1) is still referenced
from table "org_user_associations".
Failed uploading transformed data to the Chef 12 server

I'm not sure how to proceed :slight_smile:

Thanks a lot!

--
-- Tiago Cruz

--
-- Tiago Cruz