{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/3010","repository_url":"https://api.github.com/repos/ParsePlatform/parse-server","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/3010/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/3010/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/3010/events","html_url":"https://github.com/ParsePlatform/parse-server/issues/3010","id":187329983,"number":3010,"title":"Inconsistent 502 Bad Gateway responses only when VERBOSE mode is on","user":{"login":"fcoufour","id":23194091,"avatar_url":"https://avatars.githubusercontent.com/u/23194091?v=3","gravatar_id":"","url":"https://api.github.com/users/fcoufour","html_url":"https://github.com/fcoufour","followers_url":"https://api.github.com/users/fcoufour/followers","following_url":"https://api.github.com/users/fcoufour/following{/other_user}","gists_url":"https://api.github.com/users/fcoufour/gists{/gist_id}","starred_url":"https://api.github.com/users/fcoufour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fcoufour/subscriptions","organizations_url":"https://api.github.com/users/fcoufour/orgs","repos_url":"https://api.github.com/users/fcoufour/repos","events_url":"https://api.github.com/users/fcoufour/events{/privacy}","received_events_url":"https://api.github.com/users/fcoufour/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-04T13:13:41Z","updated_at":"2016-11-09T11:32:39Z","closed_at":"2016-11-09T11:32:39Z","body":"When and only when VERBOSE mode is on, a request can get a 502 Bad Gateway response or a 200 OK a few seconds after or before the first request.\r\n\r\n### Steps to reproduce\r\n\r\n1. Activate VERBOSE mode on parse-server via the verbose config option\r\n2. Make the same query many times\r\n\r\n#### Expected Results\r\n\r\nResponse 200 OK\r\n\r\n#### Actual Outcome\r\n\r\nResponse 502 Bad Gateway\r\n\r\n### Environment Setup\r\n\r\n- **Server**\r\n  - parse-dashboard version: 1.0.19\r\n  - parse-server version: 2.2.24\r\n  - Operating System: Ubuntu Server \r\n  - Hardware: 1 Core CPU / 512MB RAM\r\n  - Localhost or remote server?: Digital Ocean\r\n\r\n- **Database**\r\n  - MongoDB version: 3.2.10\r\n  - Storage engine: MongoRocks\r\n  - Hardware: the same\r\n  - Localhost or remote server?: Digital Ocean\r\n\r\n**Important: I use Nginx as a reverse proxy**\r\n- Parse Dashboard: https://dashboard.mydomain.com --> http://localhost:4040/\r\n- Parse Server: https://api.mydomain.com --> http://localhost:1337/\r\n\r\n### Logs/Trace\r\n\r\nHere are some obfuscated examples from the iOS SDK:\r\n\r\nPOST /classes/ClassName1\r\n{\"where\":{\"field1\":{\"$in\":[{\"__type\":\"Pointer\",\"className\":\"ClassName2\",\"objectId\":\"<objectId>\"},{\"__type\":\"Pointer\",\"className\":\"ClassName2\",\"objectId\":\"<objectId>\"}]},\"user\":{\"__type\":\"Pointer\",\"className\":\"_User\",\"objectId\":\"<objectId>\"}},\"_method\":\"GET\"}\r\n\r\nPOST /classes/ClassName2\r\n{\"include\":\"field1\",\"order\":\"field2\",\"_method\":\"GET\",\"where\":{\"field3\":false}}\r\n\r\nPOST /classes/ClassName3\r\n{\"include\":\"field1,field2,field3\",\"order\":\"field4\",\"_method\":\"GET\",\"where\":{\"field3\":{\"$all\":[{\"__type\":\"Pointer\",\"className\":\"_User\",\"objectId\":\"<objectId>\"}]},\"field5\":{\"$ne\":true}}}\r\n\r\nIt doesn't seem to be related to the kind of request but the only common characteristic is the WHERE clause.\r\n\r\n_Any help would be appreciated_ 😃"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/comments/259393935","html_url":"https://github.com/ParsePlatform/parse-server/issues/3010#issuecomment-259393935","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/3010","id":259393935,"user":{"login":"fcoufour","id":23194091,"avatar_url":"https://avatars.githubusercontent.com/u/23194091?v=3","gravatar_id":"","url":"https://api.github.com/users/fcoufour","html_url":"https://github.com/fcoufour","followers_url":"https://api.github.com/users/fcoufour/followers","following_url":"https://api.github.com/users/fcoufour/following{/other_user}","gists_url":"https://api.github.com/users/fcoufour/gists{/gist_id}","starred_url":"https://api.github.com/users/fcoufour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fcoufour/subscriptions","organizations_url":"https://api.github.com/users/fcoufour/orgs","repos_url":"https://api.github.com/users/fcoufour/repos","events_url":"https://api.github.com/users/fcoufour/events{/privacy}","received_events_url":"https://api.github.com/users/fcoufour/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T11:32:39Z","updated_at":"2016-11-09T11:32:39Z","body":"This issue wasn't caused by Parser Server but by the PM2 process manager.\r\nI followed the Digital Ocean migration guide (https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04) where PM2 was watching for any change in the CWD directory to restart the process.\r\nDuring restart, Parse Server was unreachable and the responses were 502 Bad Gateway.\r\n\r\nTo avoid that, we can totally disable this behaviour (watch: false) or just ignore the logs and hidden PM2 directories via ignore_watch."}}
{"actor":{"display_login":"fcoufour"}}