illinois / queue

A microservice queue for holding open office hours
University of Illinois/NCSA Open Source License
82 stars 37 forks source link

Sometimes cannot submit student feedback #74

Closed smeng10 closed 6 years ago

smeng10 commented 6 years ago

queue.js:1 WebSocket connection to 'wss://edu.cs.illinois.edu/queue/socket.io/?EIO=3&transport=websocket&sid=0ivi-FlHXRTsKvjRAAPY' failed: Error during WebSocket handshake: Unexpected response code: 400 m.doOpen @ queue.js:1

queue.js:1 WebSocket connection to 'wss://edu.cs.illinois.edu/queue/socket.io/?EIO=3&transport=websocket&sid=PURmXOFAVKVX8djqAAPa' failed: Error during WebSocket handshake: Unexpected response code: 400 m.doOpen @ queue.js:1

queue.js:1 WebSocket connection to 'wss://edu.cs.illinois.edu/queue/socket.io/?EIO=3&transport=websocket&sid=NE83MXp6RYkY55-uAAPe' failed: Error during WebSocket handshake: Unexpected response code: 400 m.doOpen @ queue.js:1

edu.cs.illinois.edu/ Failed to load resource: the server responded with a status of 502 (Proxy Error) answered Failed to load resource: the server responded with a status of 502 (Proxy Error) queue.js:1 Error: Request failed with status code 502 at e (app.js:269) at e (app.js:269) at XMLHttpRequest.e (app.js:269) (anonymous) @ queue.js:1

answered Failed to load resource: the server responded with a status of 502 (Proxy Error) queue.js:1 Error: Request failed with status code 502 at e (app.js:269) at e (app.js:269) at XMLHttpRequest.e (app.js:269) (anonymous) @ queue.js:1

2answered Failed to load resource: the server responded with a status of 502 (Proxy Error) 2queue.js:1 Error: Request failed with status code 502 at e (app.js:269) at e (app.js:269) at XMLHttpRequest.e (app.js:269) (anonymous) @ queue.js:1

answered Failed to load resource: the server responded with a status of 502 (Proxy Error) queue.js:1 Error: Request failed with status code 502 at e (app.js:269) at e (app.js:269) at XMLHttpRequest.e (app.js:269)

nwalters512 commented 6 years ago

That error is currently expected when socket.io attempts to upgrade to a websocket, as Apache isn't configured to handle actual websockets yet. I'll need a bit more info to look into this.

From Slack:

when you refresh, did you get redirected to shib? can you examine that request in the network tab?

maybe check the network tab for the POST corresponding to that feedback and see if anything looks off

nwalters512 commented 6 years ago

Dave grabbed logs for me off prod:

(node:6318) UnhandledPromiseRejectionWarning: SequelizeDatabaseError: Data truncated for column 'preparedness' at row 1
    at Query.formatError (/home/waf/queue/node_modules/sequelize/lib/dialects/mysql/query.js:228:16)
    at Query.connection.query [as onResult] (/home/waf/queue/node_modules/sequelize/lib/dialects/mysql/query.js:55:23)
    at Query.Command.execute (/home/waf/queue/node_modules/mysql2/lib/commands/command.js:30:12)
    at Connection.handlePacket (/home/waf/queue/node_modules/mysql2/lib/connection.js:502:28)
    at PacketParser.onPacket (/home/waf/queue/node_modules/mysql2/lib/connection.js:81:16)
    at PacketParser.executeStart (/home/waf/queue/node_modules/mysql2/lib/packet_parser.js:77:14)
    at Socket.<anonymous> (/home/waf/queue/node_modules/mysql2/lib/connection.js:89:29)
    at Socket.emit (events.js:180:13)
    at addChunk (_stream_readable.js:269:12)
    at readableAddChunk (_stream_readable.js:256:11)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onread (net.js:581:20)
(node:6318) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 232)

Looks like this is probably a behavior difference between sqlite/the old version of mysql and the version of mysql that's now running in prod? Will try to reproduce locally.

nwalters512 commented 6 years ago

Reproduced this on my machine. MySQL version:

mysql  Ver 14.14 Distrib 5.7.21, for osx10.13 (x86_64) using  EditLine wrapper
nwalters512 commented 6 years ago

The preparedness enums being used on the client and in api validation are different from that in the database, but I never noticed during dev because of course sqlite doesn't actually support enums, so sequelize just makes it a TEXT column. Maybe the newer version of MySQL handles bad enums differently than the version we were previously using?

I can fix this with a migration, I think.

nwalters512 commented 6 years ago

Fixed with #76