New twitter account cannot log in? (error at signup)


#1

Hi guys,

While I create a new user, I’m finding this error in the logs :

Processing by UsersController#create as */*
  Parameters: {"name"=>"Ps4 Support Forum", "email"=>"pablocorral+ps4@gmail.com", "username"=>"PS4SupportForum", "password_confirmation"=>"[FILTERED]", "challenge"=>"11a4ebe83d9b2a9e0d45bc50b457ee17"}
PG::NumericValueOutOfRange: ERROR:  value "2201945804" is out of range for type integer

Any idea?

Tks!


(Jeff Atwood) #2

How are you creating this user? Describe it step by step.


#3

I’ve configured Twitter Authentication, so this error happends on the
application, after twitter posts to my discourse install via the callback.

In the front error I can get a correct message saying “Something waa wrong,
check you usename and password” and in the backend I see that error in the
logs.

My schema is updated, yesterday I’ve pulled latest version from GitHub, and updated it via bundle exec rake db:migrate

Update: while researching postgres logs I’ve found this detail:

013-11-20 16:35:59 EST LOG:  autovacuum launcher started
2013-11-20 16:35:59 EST LOG:  database system is ready to accept connections
2013-11-20 16:35:59 EST LOG:  incomplete startup packet
2013-11-20 16:55:32 EST ERROR:  value "2201945804" is out of range for type integer
2013-11-20 16:55:32 EST STATEMENT:  INSERT INTO "twitter_user_infos" ("created_at", "screen_name", "twitter_user_id", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5) RETURNING "id"

And this is my current twitter_user_info schema. Is this correct?

discourse_prod-# \d+ twitter_user_infos
                                                    Table "public.twitter_user_infos"
     Column      |            Type             |                            Modifiers                            | Storage  | Description 
-----------------+-----------------------------+-----------------------------------------------------------------+----------+-------------
 id              | integer                     | not null default nextval('twitter_user_infos_id_seq'::regclass) | plain    | 
 user_id         | integer                     | not null                                                        | plain    | 
 screen_name     | character varying(255)      | not null                                                        | extended | 
 twitter_user_id | integer                     | not null                                                        | plain    | 
 created_at      | timestamp without time zone |                                                                 | plain    | 
 updated_at      | timestamp without time zone |                                                                 | plain    | 
Indexes:
    "twitter_user_infos_pkey" PRIMARY KEY, btree (id)
    "index_twitter_user_infos_on_twitter_user_id" UNIQUE, btree (twitter_user_id)
    "index_twitter_user_infos_on_user_id" UNIQUE, btree (user_id)
Has OIDs: no

#4

I think that I’ve found what is wrong :slight_smile:

I tried to log in with a Twitter account with this Twitter_User_ID: 2201945804 (user created yesterday)

…and the schema’s table called Twitter_user_infos has a column twitter_user_id which is Integer (maximum values should be 2147483647)

Newest twitter_user_id’s are bigger than int!

So, I think that twitter_user_id should be now a bigint!

P.S.: Relevant link about how to create a migration to bigint (Using BIGINT columns in rails migrations – moeffju.net)

P.S.2: I’ve checked and it is happening also in discuss.howtogeek.com!

cc @sam for help! :smile:


(Sam Saffron) #5

Fixed, thank you for the excellent bug report:


(Jeff Atwood) #6

This topic was automatically closed after 2 days. New replies are no longer allowed.