Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:43:03+00:00 2026-05-23T16:43:03+00:00

This is a pretty weird error bust basically I just moved my app from

  • 0

This is a pretty weird error bust basically I just moved my app from sqlite3 to postgreSQL. I use the devise ruby gem to handle session management for users. I’m using rails 3.1.0.rc4 and Devise 1.4.2. Anyway, trying to sign in produces this error:

Started POST "/users/sign_in" for 127.0.0.1 at 2011-07-13 11:32:11 +0100
  Processing by Devise::SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"tV0DGHLx0vpTz1/1preLrTvNXpm5LpcNsQeWYJGxZcE=", "user"=>{"email"=>"user@user.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
  User Load (0.4ms)  SELECT DISTINCT "users".id, FROM "users" LEFT OUTER JOIN "memberships" ON "memberships"."member_id" = "users"."id" LEFT OUTER JOIN "teams" ON "teams"."id" = "memberships"."team_id" WHERE "users"."email" = 'user@user.com' LIMIT 1
PGError: ERROR:  syntax error at or near "FROM"
LINE 1: SELECT  DISTINCT "users".id,  FROM "users" LEFT OUTER JOIN "...
                                      ^
: SELECT  DISTINCT "users".id,  FROM "users" LEFT OUTER JOIN "memberships" ON "memberships"."member_id" = "users"."id" LEFT OUTER JOIN "teams" ON "teams"."id" = "memberships"."team_id" WHERE "users"."email" = 'user@user.com' LIMIT 1
Completed 500 Internal Server Error in 187ms

ActiveRecord::StatementInvalid (PGError: ERROR:  syntax error at or near "FROM"
LINE 1: SELECT  DISTINCT "users".id,  FROM "users" LEFT OUTER JOIN "...
                                  ^
: SELECT  DISTINCT "users".id,  FROM "users" LEFT OUTER JOIN "memberships" ON "memberships"."member_id" = "users"."id" LEFT OUTER JOIN "teams" ON "teams"."id" = "memberships"."team_id" WHERE "users"."email" = 'user@user.com' LIMIT 1): 

Here’s the framework trace:

activerecord (3.1.0.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:958:in `async_exec'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:958:in `exec_no_cache'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:547:in `block in exec_query'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract_adapter.rb:222:in `block in log'
activesupport (3.1.0.rc4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract_adapter.rb:217:in `log'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:546:in `exec_query'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/postgresql_adapter.rb:1027:in `select'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract/database_statements.rb:9:in `select_all'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `block in select_all'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract/query_cache.rb:74:in `cache_sql'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
activerecord (3.1.0.rc4) lib/active_record/base.rb:473:in `find_by_sql'
activerecord (3.1.0.rc4) lib/active_record/relation.rb:109:in `to_a'
activerecord (3.1.0.rc4) lib/active_record/relation.rb:14:in `collect'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:251:in `construct_limited_ids_condition'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:236:in `apply_join_dependency'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:225:in `construct_relation_for_association_find'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:204:in `find_with_associations'
activerecord (3.1.0.rc4) lib/active_record/relation.rb:109:in `to_a'
activerecord (3.1.0.rc4) lib/active_record/relation.rb:127:in `to_a'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:370:in `find_first'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:122:in `first'
activerecord (3.1.0.rc4) lib/active_record/relation/finder_methods.rb:119:in `first'
activerecord (3.1.0.rc4) lib/active_record/base.rb:444:in `first'
orm_adapter (0.0.5) lib/orm_adapter/adapters/active_record.rb:51:in `find_first'
/Users/davidtuite/.rvm/gems/ruby-1.9.2-head@grouperty/bundler/gems/devise-e9c766277d61/lib/devise/models/authenticatable.rb:109:in `find_for_authentication'
/Users/davidtuite/.rvm/gems/ruby-1.9.2-head@grouperty/bundler/gems/devise-e9c766277d61/lib/devise/models/database_authenticatable.rb:115:in `find_for_database_authentication'
/Users/davidtuite/.rvm/gems/ruby-1.9.2-head@grouperty/bundler/gems/devise-e9c766277d61/lib/devise/strategies/database_authenticatable.rb:8:in `authenticate!'
warden (1.0.4) lib/warden/strategies/base.rb:53:in `_run!'
warden (1.0.4) lib/warden/proxy.rb:311:in `block in _run_strategies_for'
warden (1.0.4) lib/warden/proxy.rb:306:in `each'
warden (1.0.4) lib/warden/proxy.rb:306:in `_run_strategies_for'
warden (1.0.4) lib/warden/proxy.rb:279:in `_perform_authentication'
warden (1.0.4) lib/warden/proxy.rb:113:in `authenticate!'
/Users/davidtuite/.rvm/gems/ruby-1.9.2-head@grouperty/bundler/gems/devise-e9c766277d61/app/controllers/devise/sessions_controller.rb:14:in `create'
actionpack (3.1.0.rc4) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.1.0.rc4) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.1.0.rc4) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.1.0.rc4) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:434:in `_run__3680065931087317103__process_action__4396720641089604323__callbacks'
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.0.rc4) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.1.0.rc4) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.1.0.rc4) lib/active_support/notifications.rb:55:in `block in instrument'
activesupport (3.1.0.rc4) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.0.rc4) lib/active_support/notifications.rb:55:in `instrument'
actionpack (3.1.0.rc4) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.1.0.rc4) lib/action_controller/metal/params_wrapper.rb:202:in `process_action'
actionpack (3.1.0.rc4) lib/action_controller/metal/rescue.rb:17:in `process_action'
activerecord (3.1.0.rc4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.1.0.rc4) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.1.0.rc4) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.0.rc4) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.0.rc4) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.0.rc4) lib/action_controller/metal.rb:236:in `block in action'
actionpack (3.1.0.rc4) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.0.rc4) lib/action_dispatch/routing/route_set.rb:29:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/routing/mapper.rb:41:in `call'
rack-mount (0.8.1) lib/rack/mount/route_set.rb:152:in `block in call'
rack-mount (0.8.1) lib/rack/mount/code_generation.rb:93:in `block in recognize'
rack-mount (0.8.1) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.8.1) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.8.1) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/routing/route_set.rb:531:in `call'
warden (1.0.4) lib/warden/manager.rb:35:in `block in call'
warden (1.0.4) lib/warden/manager.rb:34:in `catch'
warden (1.0.4) lib/warden/manager.rb:34:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.0) lib/rack/etag.rb:23:in `call'
rack (1.3.0) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/flash.rb:243:in `call'
rack (1.3.0) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.0) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/cookies.rb:321:in `call'
activerecord (3.1.0.rc4) lib/active_record/query_cache.rb:54:in `call'
activerecord (3.1.0.rc4) lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.0.rc4) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.0) lib/rack/sendfile.rb:102:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.0.rc4) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.0) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.0) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.0.rc4) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.0) lib/rack/lock.rb:34:in `call'
actionpack (3.1.0.rc4) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.0.rc4) lib/rails/engine.rb:438:in `call'
railties (3.1.0.rc4) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.0.rc4) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.0) lib/rack/handler/webrick.rb:59:in `service'
/Users/davidtuite/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/davidtuite/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/davidtuite/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

Is this an ActiveRecord bug or something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:43:03+00:00Added an answer on May 23, 2026 at 4:43 pm

    The issue is caused by the fact that I’m trying to eager load teams with users:

    class User < ActiveRecord::Base
      has_many :teams
      default_scope :include => :teams
    end
    

    Issue is on Github now. Should be fixed in the next Rails RC.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is pretty simple, I come from a swing/awt background. I'm just wondering what
This is pretty weird. I have my Profiler open and it obviously shows that
I'm having some weird issues with Xcode, and this is pretty much impossible to
In IntelliJ I get this weird error when I try to compile. Cannot find
My application fetches information from an API. Unfortunately their data isn't very pretty. This
I am experiencing some pretty weird output from some c code. Granted I am
I found this pretty weird thing when I first installed SQL Server 2008, for
I am having a very weird error on this block: <script type=text/javascript> var captions
This pretty much has me defeated. On XP and earlier versions of Windows you
This is pretty trivial, but I noticed on SO that instead of an offset

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.