owner_id does not exist #2592

Closed
rterbush opened this Issue Feb 21, 2013 · 14 comments

Comments

Projects
None yet
5 participants
Contributor

rterbush commented Feb 21, 2013

Noticed recently that there is an error logged as follows:

�[1m�[36m (0.7ms)�[0m  �[1mSELECT owner_id, owner_type, name, value FROM spree_preferences WHERE 'key' IS NULL�[0m
PG::Error: ERROR:  column "owner_id" does not exist

This seems to be related to frontend/config/initializers/check_for_orphaned_preferences.rb

I see a db/migrate that removed owner_id some time ago. I don't think this is relevant to the problem I am chasing, but thought I would bring it to someone's attention in case this is another issue that needs to be resolved.

Member

radar commented Mar 3, 2013

Hey @rterbush: Have you been able to solve this issue yet? I don't know how I could reproduce it on my machine.

Contributor

rterbush commented Mar 3, 2013

Not solved.

The column was dropped by migrate "remove_unused_preference_columns.rb.
Comment in the file is: "# This migration comes from spree (originally 20120929093553)"

Just a grep on log/*.log should show:

SELECT owner_id, owner_type, name, value FROM spree_preferences WHERE 'key' IS NULL
PG::Error: ERROR: column "owner_id" does not exist

Something is still looking for it. Not sure what problem it might cause other than perhaps some performance hit in wasted query... (speculating)

I am unable to execute rake db:seed because of this.

(0.4ms) SELECT owner_id, owner_type, name, value FROM spree_preferences WHERE 'key' IS NULL
Mysql2::Error: Unknown column 'owner_id' in 'field list': SELECT owner_id, owner_type, name, value FROM spree_preferences WHERE 'key' IS NULL

Member

radar commented Mar 5, 2013

Could I please get some steps to reproduce this issue? I am eager to fix it.

Contributor

rterbush commented Mar 5, 2013

Not sure what more I can give you @radar

The select is happening here: spree/frontend/config/initializers/check_for_orphaned_preferences.rb

As I mentioned above, the column was dropped back in September. 20120929093553

Contributor

salemine commented Mar 7, 2013

Here are the steps to reproduce: https://gist.github.com/salemine/5109544

I have a small patch to suppress the error. I will PR later today.
The other option would be to remove the initializer from the next release of 1.3.x - the purpose of the initializer was to remind people to run the migrations needed from an earlier version.

I'm not familiar enough with the history to be certain but I'm not sure this is a "bug" ?

Contributor

swrobel commented Mar 20, 2013

@radar what's the status on this? It's driving me nuts as well on a brand new 1.3.2 spree gem app...

Member

radar commented Mar 20, 2013

If I can't reproduce the problem then I can't fix it.

If you can give me a way to reproduce it effectively then I can make sure this is fixed.

On 20/03/2013, at 11:54, Stefan Wrobel notifications@github.com wrote:

What's the status on this? It's driving me nuts as well...


Reply to this email directly or view it on GitHub.

Contributor

swrobel commented Mar 20, 2013

Did you follow the directions @salemine provided? That's the exact process I used, fresh Rails 3.2 app with Spree gem 1.3.2

Contributor

salemine commented Mar 20, 2013

@radar already merged this pull request - #2681

I think this issue can be closed ?

Member

radar commented Mar 20, 2013

Are you able to reproduce it within 1-3-stable as well? @salemine says its already fixed there. Please try using that rather than the gem release.

On 21/03/2013, at 2:55, Stefan Wrobel notifications@github.com wrote:

Did you follow the directions @salemine provided? That's the exact process I used, fresh Rails 3.2 app with Spree gem 1.3.2


Reply to this email directly or view it on GitHub.

Contributor

swrobel commented Mar 20, 2013

Ok, fixed on 1-3-stable. A new gem release would be nice.

Member

radar commented Mar 28, 2013

If you really really need a new gem release then I would recommend using the 1-3-stable branch for now.

We have a large backlog that we need to get through before we are to do a gem release.

Sent from Mailbox for iPhone

On Thu, Mar 21, 2013 at 9:12 AM, Stefan Wrobel notifications@github.com
wrote:

Ok, fixed on 1-3-stable. A new gem release would be nice.

Reply to this email directly or view it on GitHub:
#2592 (comment)

radar closed this Mar 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment