Skip to content

GraphQL APIs are blocking forever in OSS version

Created by: Matgek

  • Sourcegraph version: 3.2
  • Platform information: OS: MacOS 10.14.1 local development

Steps to reproduce:

  1. I'm a newcomer to sourcegraph development. I followed exactly the instructions to set the local development environment. https://github.com/sourcegraph/sourcegraph/blob/master/doc/dev/local_development.md#step-2-install-dependencies
  2. start the server with ./dev/launch.sh

Expected behavior:

The graphql api(Search, ExploreRepositories, etc.) works for both admins and non-admin user.

Actual behavior:

When I login as a site-admin user, the search, exploring repositories features worked fine. But when I login as a non-admin user, I can't search anything. The log reports:

17:41:58                    web | { Error: socket hang up
17:41:58                    web |     at createHangUpError (_http_client.js:323:15)
17:41:58                    web |     at Socket.socketCloseListener (_http_client.js:364:25)
17:41:58                    web |     at Socket.emit (events.js:194:15)
17:41:58                    web |     at Socket.EventEmitter.emit (domain.js:459:23)
17:41:58                    web |     at TCP._handle.close (net.js:597:12) code: 'ECONNRESET' }
17:41:58                    web | [HPM] Error occurred while trying to proxy request /.api/graphql?ExploreRepositories from localhost:3080 to http://localhost:3081 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
17:42:30                    web | { Error: socket hang up
17:42:30                    web |     at createHangUpError (_http_client.js:323:15)
17:42:30                    web |     at Socket.socketCloseListener (_http_client.js:364:25)
17:42:30                    web |     at Socket.emit (events.js:194:15)
17:42:30                    web |     at Socket.EventEmitter.emit (domain.js:459:23)
17:42:30                    web |     at TCP._handle.close (net.js:597:12) code: 'ECONNRESET' }
17:42:30                    web | [HPM] Error occurred while trying to proxy request /.api/graphql?Search from localhost:3080 to http://localhost:3081 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
17:55:25                    web | { Error: socket hang up
17:55:25                    web |     at createHangUpError (_http_client.js:323:15)
17:55:25                    web |     at Socket.socketCloseListener (_http_client.js:364:25)
17:55:25                    web |     at Socket.emit (events.js:194:15)
17:55:25                    web |     at Socket.EventEmitter.emit (domain.js:459:23)
17:55:25                    web |     at TCP._handle.close (net.js:597:12) code: 'ECONNRESET' }
17:55:25                    web | [HPM] Error occurred while trying to proxy request /.api/graphql?SearchSuggestions from localhost:3080 to http://localhost:3081 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)

I also tried the graphql api console, it didn't work for any query (not work when login in as non-admin users, work fine for admins). As the graphql api is a very basic function, I suppose some mistakes when I setting the environment. So I post the logs of running ./dev/launch.sh as an attachment. local-launch-issue-api-not-work.txt Can anybody tell me what's the problem? Did I miss some settings? Thank you very much.