hashintel / hash

πŸš€ The open-source, multi-tenant, self-building knowledge graph
https://hash.dev
Other
1.07k stars 83 forks source link

Error running yarn external-services up --detach #321

Closed sstchur closed 2 years ago

sstchur commented 2 years ago

All prerequisites were met, and I verified that I have all the correct versions of git, node, yarn, docker, and docker-compose. I also verified that none of the required ports are in use. At the step: yarn external-services up --detach I'm met with the following error:

yarn external-services up --detach yarn run v1.22.17 $ docker-compose --file external-services/docker-compose.yml up --detach Traceback (most recent call last): File "urllib3/connectionpool.py", line 677, in urlopen File "urllib3/connectionpool.py", line 392, in _make_request File "http/client.py", line 1277, in request File "http/client.py", line 1323, in _send_request File "http/client.py", line 1272, in endheaders File "http/client.py", line 1032, in _send_output File "http/client.py", line 972, in send File "docker/transport/unixconn.py", line 43, in connect FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "requests/adapters.py", line 449, in send File "urllib3/connectionpool.py", line 727, in urlopen File "urllib3/util/retry.py", line 410, in increment File "urllib3/packages/six.py", line 734, in reraise File "urllib3/connectionpool.py", line 677, in urlopen File "urllib3/connectionpool.py", line 392, in _make_request File "http/client.py", line 1277, in request File "http/client.py", line 1323, in _send_request File "http/client.py", line 1272, in endheaders File "http/client.py", line 1032, in _send_output File "http/client.py", line 972, in send File "docker/transport/unixconn.py", line 43, in connect urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "docker/api/client.py", line 214, in _retrieve_server_version File "docker/api/daemon.py", line 181, in version File "docker/utils/decorators.py", line 46, in inner File "docker/api/client.py", line 237, in _get File "requests/sessions.py", line 543, in get File "requests/sessions.py", line 530, in request File "requests/sessions.py", line 643, in send File "requests/adapters.py", line 498, in send requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "docker-compose", line 3, in File "compose/cli/main.py", line 81, in main File "compose/cli/main.py", line 200, in perform_command File "compose/cli/command.py", line 70, in project_from_options File "compose/cli/command.py", line 153, in get_project File "compose/cli/docker_client.py", line 43, in get_client File "compose/cli/docker_client.py", line 170, in docker_client File "docker/api/client.py", line 197, in init File "docker/api/client.py", line 222, in _retrieve_server_version docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory')) [11747] Failed to execute script docker-compose error Command failed with exit code 255. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

CiaranMn commented 2 years ago

Hi @sstchur - can you verify that Docker is running?

Please enter docker ps in your terminal:

If Docker isn't running, starting it depends on how you've installed it:

If you let me know how you get on with that I can advise further.

sstchur commented 2 years ago

Thanks for the help! Docker was not in fact running. sudo systemctl start docker did not work (I got the error "System has not been booted with systemd as init system." After doing a bit of research, I learned this is because I'm using the WSL. Apparently I can use the equivalent Sysvinit commands to do the same thing. So I tried sudo service docker start and got "* Starting Docker: docker"

I then ran sudo docker ps and got: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

I then tried yarn external-services up --detach again, but I got several permission denied errors. So then I tried sudo yarn external-services up --detach and what do you know! It appears to be pulling the container code and starting up. It hasn't finished yet, so the jury's still out, but this looks promising.

sstchur commented 2 years ago

So after starting up and a variety of messages like

[dev:frontend] This problem is likely caused by another plugin injecting
[dev:frontend] "SpinnerIcon" without registering it in the scope tracker. If you are the author
[dev:frontend]  of that plugin, please use "scope.registerDeclaration(declarationPath)".
[dev:frontend] The exported identifier "HashIcon" is not declared in Babel's scope tracker
[dev:frontend] as a JavaScript value binding, and "@babel/plugin-transform-typescript"
[dev:frontend] never encountered it as a TypeScript type declaration.
[dev:frontend] It will be treated as a JavaScript value.

I now see:

[dev:backend:*realtime] info: Updated ownership of slot "realtime" {"service":"realtime","instanceId":"d8d911e6-3bda-4430-b440-3ec70a57beda","timestamp":"2022-02-17T15:56:00.712Z"}
[dev:backend:*realtime] info: Updated ownership of slot "realtime" {"service":"realtime","instanceId":"d8d911e6-3bda-4430-b440-3ec70a57beda","timestamp":"2022-02-17T15:56:05.707Z"}
[dev:backend:*realtime] info: Updated ownership of slot "realtime" {"service":"realtime","instanceId":"d8d911e6-3bda-4430-b440-3ec70a57beda","timestamp":"2022-02-17T15:56:10.720Z"}```

It doesn't seem to indicate what port the local dev server is running on, but I guessed 3000, and when I browse, there I see this (which I think is progress?):

image

kachkaev commented 2 years ago

Yep, that’s definitely progress πŸ‘

[dev:frontend] This problem is likely caused by another plugin injecting
[dev:frontend] "SpinnerIcon" without registering it in the scope tracker. If you are the author
[dev:frontend]  of that plugin, please use "scope.registerDeclaration(declarationPath)".

↑ These warnings will be gone when we merge #320 – I hope it will be quite soon! Also we just merged #322, which should give you less noise in the output. Try to git pull; yarn install before running yarn dev again.

Once you run yarn seed-data, you should be able to login as alice or bob. We use email confirmations instead of passwords and these emails are mocked during local dev. See console output once you’ve entered one of the two demo logins πŸ‘€

kachkaev commented 2 years ago

Both #320 and #322 are merged now πŸ‘€

kachkaev commented 2 years ago

πŸ‘‹ @sstchur! Has the issue been fixed for you?

sstchur commented 2 years ago

Sorry for the delay! I will try to find time to try it out today. I got sidetracked the last few days and hadn’t had time to try running it again.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Alexander Kachkaev @.> Sent: Monday, February 28, 2022 1:54:46 AM To: hashintel/hash @.> Cc: sstchur @.>; Mention @.> Subject: Re: [hashintel/hash] Error running yarn external-services up --detach (Issue #321)

πŸ‘‹ @sstchurhttps://github.com/sstchur! Has the issue been fixed for you?

β€” Reply to this email directly, view it on GitHubhttps://github.com/hashintel/hash/issues/321#issuecomment-1054079810, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALJMD34KVCBRXOENQCXMW6TU5NA6NANCNFSM5OTODDVQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

sstchur commented 2 years ago

Alright, so I finally had some time to pull latest and try again. I can get the docker service running and successfully run yarn external services up --detach. I then ran yarn dev, but I see some errors, and it seems like the frontend service isn't running (it doesn't connect when I try localhost:3000). The output below shows a couple of Errors, like "failed to load next.config.js". Any idea what I might be doing wrong?

[dev:frontend] ready - started server on 0.0.0.0:3000, url: http://localhost:3000 [dev:backend:search-loader] [INFO] 16:04:48 ts-node-dev ver. 2.0.0-0 (using ts-node ver. 10.4.0, typescript ver. 4.5.5) [dev:backend:realtime] [INFO] 16:04:48 ts-node-dev ver. 2.0.0-0 (using ts-node ver. 10.4.0, typescript ver. 4.5.5) [dev:backend:api] [INFO] 16:04:48 ts-node-dev ver. 2.0.0-0 (using ts-node ver. 10.4.0, typescript ver. 4.5.5) [dev:frontend] info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5 [dev:frontend] Error: failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error [dev:frontend] TypeError: Cannot read properties of undefined (reading 'version') [dev:frontend] at Object. (/home/sstchur/dev/hash/node_modules/html-webpack-plugin/lib/file-watcher-api.js:7:67) [dev:frontend] at Module._compile (node:internal/modules/cjs/loader:1101:14) [dev:frontend] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) [dev:frontend] at Module.load (node:internal/modules/cjs/loader:981:32) [dev:frontend] at Function.Module._load (node:internal/modules/cjs/loader:822:12) [dev:frontend] at Module.require (node:internal/modules/cjs/loader:1005:19) [dev:frontend] at require (node:internal/modules/cjs/helpers:102:18) [dev:frontend] at Object. (/home/sstchur/dev/hash/node_modules/html-webpack-plugin/lib/cached-child-compiler.js:41:24) [dev:frontend] at Module._compile (node:internal/modules/cjs/loader:1101:14) [dev:frontend] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. [dev:frontend] Exit code: 1 [dev:frontend] Command: /usr/local/bin/node [dev:frontend] Arguments: /usr/local/lib/node_modules/yarn/lib/cli.js dev [dev:frontend] Directory: /home/sstchur/dev/hash/packages/hash/frontend [dev:frontend] Output: [dev:frontend] info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [dev:frontend] yarn run dev:frontend exited with code 1 [dev:backend:realtime] info: STARTED {"service":"realtime","instanceId":"e62f517d-3a09-498e-88c3-aa36814f4037","timestamp":"2022-03-03T00:04:50.018Z"} [dev:backend:realtime] info: HTTP server listening on port 3333 {"service":"realtime","instanceId":"e62f517d-3a09-498e-88c3-aa36814f4037","timestamp":"2022-03-03T00:04:50.020Z"} [dev:backend:search-loader] Opensearch is not enabled. Shutting down search-loader [dev:backend:api] (node:6106) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/sstchur/dev/hash/node_modules/@opensearch-project/opensearch/package.json. [dev:backend:api] Update this package.json to use a subpath pattern like "./". [dev:backend:api] (Use node --trace-deprecation ... to show where the warning was created) [dev:backend:api] info: Listening on port 5001 {"service":"api"} [dev:backend:api] info: GraphQL path: /graphql {"service":"api"} [dev:backend:realtime] info: HTTP server closed {"service":"realtime","instanceId":"5c5f9460-8130-4cd9-a212-29e5a2a75a14","timestamp":"2022-03-03T00:05:19.687Z"} [dev:backend:realtime] yarn run dev:backend:realtime exited with code SIGINT

kachkaev commented 2 years ago

πŸ‘‹ @sstchur! We made some changes to how the app runs (including #687 which was just merged this morning). It’d be great to get your feedback if you have time to run HASH locally! You can find the instructions in packages/hash/README.md πŸ™‚

sstchur commented 2 years ago

Hey, thanks for letting me know. I will try to find some time to try this out. Been out of commission sick this past week. But will try to find some time in the next few days.

I actually did get HASH to run quite a while back, but never updated this thread. Last time I managed to get to run though, it was so painfully slow as to mostly be useless. Not sure if I did something wrong. Happy to try it again now that there have been updates.