# Failed uploading transformed data to the Chef 12 server

**URL:** <https://discourse.chef.io/t/failed-uploading-transformed-data-to-the-chef-12-server/6132>\
**Category:** Chef Infra (archive)\
**Created:** [December 3, 2014, 4:32pm UTC](https://discourse.chef.io/t/failed-uploading-transformed-data-to-the-chef-12-server/6132 "2014-12-03T16:32:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tiago_cruz/32/49_2.png) [@Tiago\_Cruz](https://discourse.chef.io/u/Tiago_Cruz)\
**Post date:** [December 3, 2014, 4:32pm UTC](https://discourse.chef.io/t/failed-uploading-transformed-data-to-the-chef-12-server/6132/1 "2014-12-03T16:32:45Z")

</div>

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 🙂

Thanks a lot!

–  
– Tiago Cruz

---

<div class="post-metadata">

**Author:** ![Steven\_Danna](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steven_danna/32/195_2.png) [@Steven\_Danna](https://discourse.chef.io/u/Steven_Danna)\
**Post date:** [December 3, 2014, 7:02pm UTC](https://discourse.chef.io/t/failed-uploading-transformed-data-to-the-chef-12-server/6132/2 "2014-12-03T19:02:17Z")

</div>

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](mailto: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 🙂
> 
> Thanks a lot!
> 
> --  
> -- Tiago Cruz

---

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tiago_cruz/32/49_2.png) [@Tiago\_Cruz](https://discourse.chef.io/u/Tiago_Cruz)\
**Post date:** [December 3, 2014, 7:57pm UTC](https://discourse.chef.io/t/failed-uploading-transformed-data-to-the-chef-12-server/6132/3 "2014-12-03T19:57:04Z")

</div>

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 ☹

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](mailto: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](mailto: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 🙂
> > 
> > Thanks a lot!
> > 
> > --  
> > -- Tiago Cruz

--  
-- Tiago Cruz
