Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

"unexpected Parse response " when signup a new user #218

Closed
bensonby opened this issue Nov 3, 2016 · 4 comments
Closed

"unexpected Parse response " when signup a new user #218

bensonby opened this issue Nov 3, 2016 · 4 comments
Assignees
Labels

Comments

@bensonby
Copy link

bensonby commented Nov 3, 2016

Problem

Signing up a new user with give 500 error with message "Driver: bad connection"

screen shot 2016-11-03 at 16 48 51

Steps to reproduce

  1. go to http://sdkjsexample.skygeario.com/static/example/
  2. change the skygear endPoint and apiKey to do a signup for a portal staging app
apiKey = '<api key>';
endPoint = 'https://bensonby3.staging.skygeario.com/';
skygear.config({'apiKey': apiKey, 'endPoint': endPoint}).then(function() {
  skygear.signupWithEmail('bensonby+4@oursky.com', 'bensonby+4')
});

Note

  • It does not work for bensonby3 (which has some cloud code), but it works for my other staging app bensonby4.

Log

time="2016-11-03T08:04:54Z" level=debug msg="------ Request: ------" logger=router 
time="2016-11-03T08:04:54Z" level=debug msg="{\"action\":\"auth:signup\",\"api_key\":\"someapikey\",\"access_token\":null,\"username\":\"bensonby+2@oursky.com\",\"email\":null,\"password\":\"********\"}" logger=router 
time="2016-11-03T08:04:54Z" level=debug msg="Opening DBConn: {pq bensonby3 postgresql://bensonby3-4041:dbpassword@skygear-cloud-staging.ctlziuhp6ccd.ap-southeast-1.rds.amazonaws.com:5432/bensonby3-4041}" logger=preprocessor 
time="2016-11-03T08:04:54Z" level=debug msg="Get DB OK" logger=preprocessor 
time="2016-11-03T08:04:55Z" level=debug msg="Executed SQL successfully with sql.Queryx" args=[] error=<nil> executionCount=1 logger=skydb sql="SELECT id FROM \"app_bensonby3\".\"_role\" WHERE by_default = true" 
time="2016-11-03T08:04:55Z" level=debug msg="0xc8204af6d0: Beginning transaction" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="0xc8204af6d0: Done beginning transaction 0xc820429e00" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="Executed SQL successfully with sql.Exec" args=[4ebe0a20-23fe-4bdf-b813-a02b03c09409 0xc8203cd790 <nil> [36 50 97 36 49 48 36 70 77 76 117 102 89 76 77 57 119 54 110 70 56 70 65 70 89 107 110 103 117 78 51 84 57 51 84 65 74 50 77 118 85 114 75 47 110 112 118 90 75 55 112 55 73 66 78 77 106 108 113 46] {map[] true} 2016-11-03 08:04:55.223120522 +0000 UTC 2016-11-03 08:04:55.231578365 +0000 UTC 2016-11-03 08:04:55.231578365 +0000 UTC] error=<nil> executionCount=2 logger=skydb rowsAffected=1 sql="INSERT INTO \"app_bensonby3\".\"_user\" (id,username,email,password,auth,token_valid_since,last_login_at,last_seen_at) VALUES ($1,$2,$3,$4,$5,$6,$7,$8)" 
time="2016-11-03T08:04:55Z" level=debug msg="UpdateRoles &{4ebe0a20-23fe-4bdf-b813-a02b03c09409 bensonby+2@oursky.com  [36 50 97 36 49 48 36 70 77 76 117 102 89 76 77 57 119 54 110 70 56 70 65 70 89 107 110 103 117 78 51 84 57 51 84 65 74 50 77 118 85 114 75 47 110 112 118 90 75 55 112 55 73 66 78 77 106 108 113 46] [] map[] 2016-11-03 08:04:55.223120522 +0000 UTC 2016-11-03 08:04:55.231578365 +0000 UTC 2016-11-03 08:04:55.231578365 +0000 UTC}" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="Executed SQL successfully with sql.Exec" args=[4ebe0a20-23fe-4bdf-b813-a02b03c09409] error=<nil> executionCount=3 logger=skydb rowsAffected=0 sql="DELETE FROM \"app_bensonby3\".\"_user_role\" WHERE user_id = $1" 
time="2016-11-03T08:04:55Z" level=debug msg="Querying remoteColumnTypes user" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="Executed SQL with sql.QueryRowx" args=[user app_bensonby3] executionCount=4 logger=skydb sql="\nSELECT c.oid\nFROM pg_catalog.pg_class c\n     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\nWHERE c.relname = $1\n  AND n.nspname = $2" 
time="2016-11-03T08:04:55Z" level=debug msg="Executed SQL successfully with sql.Queryx" args=[434721] error=<nil> executionCount=5 logger=skydb sql="\nSELECT a.attname,\n  pg_catalog.format_type(a.atttypid, a.atttypmod)\nFROM pg_catalog.pg_attribute a\nWHERE a.attrelid = $1 AND a.attnum > 0 AND NOT a.attisdropped" 
time="2016-11-03T08:04:55Z" level=debug msg="Cache remoteColumnTypes user" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="map[]" logger=handler 
time="2016-11-03T08:04:55Z" level=debug msg="Querying remoteColumnTypes user" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="Executed SQL with sql.QueryRowx" args=[user app_bensonby3] executionCount=6 logger=skydb sql="\nSELECT c.oid\nFROM pg_catalog.pg_class c\n     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\nWHERE c.relname = $1\n  AND n.nspname = $2" 
time="2016-11-03T08:04:55Z" level=error msg="Failed to query oid of table" err="pq: unexpected Parse response 'C'" logger=skydb recordType=user schemaName="app_bensonby3" 
time="2016-11-03T08:04:55Z" level=debug msg="Cache remoteColumnTypes user" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="0xc8204af6d0: Committed transaction 0xc820429e00" logger=skydb 
time="2016-11-03T08:04:55Z" level=debug msg="------ Response: ------" logger=router 
time="2016-11-03T08:04:55Z" level=debug msg="{\"error\":{\"name\":\"UnexpectedError\",\"code\":10000,\"message\":\"driver: bad connection\"}}\n" logger=router 
@cheungpat
Copy link
Contributor

I am suspecting this and this:

lib/pq#142
lib/pq#81

@royuen royuen added the Focus label Nov 8, 2016
@cheungpat cheungpat changed the title Cannot signup a new user in portal staging "Driver: bad connection " when signup a new user Nov 8, 2016
@cheungpat
Copy link
Contributor

Sorry for asking a n00b question, how do you go from Step 1 to Step 2 in your steps to reproduce?

@bensonby
Copy link
Author

bensonby commented Nov 8, 2016

@cheungpat I opened the console to run the JavaScript codes. Basically I just want to have a working site with skygear JS SDK included

@cheungpat
Copy link
Contributor

@bensonby I need some time to work out a fix to this.

@cheungpat cheungpat changed the title "Driver: bad connection " when signup a new user "unexpected Parse response " when signup a new user Nov 8, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 9, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 9, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 9, 2016
cheungpat added a commit to cheungpat/skygear-server that referenced this issue Nov 9, 2016
rickmak added a commit that referenced this issue Nov 9, 2016
* Add support for bigint db type
* Fix not enumerating all rows from database during record schema query
* Fix record schema cached even when there was an error querying record schema
* Update sqlx/libpq to latest version

refs #218
@rickmak rickmak closed this as completed Nov 16, 2016
@rickmak rickmak removed the In Review label Nov 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants