Giter Site home page Giter Site logo

nhost / cli Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 27.0 77.06 MB

Nhost CLI

Home Page: https://docs.nhost.io/development/cli/overview

License: MIT License

Go 96.20% Shell 1.78% Nix 1.68% Makefile 0.35%
authentication backend cli graphql hasura local postgresql serverless storage

cli's Introduction

Nhost

Nhost

Quickstart   •   Website   •   Docs   •   Blog   •   Twitter   •   Discord


Nhost is an open source Firebase alternative with GraphQL, built with the following things in mind:

  • Open Source
  • GraphQL
  • SQL
  • Great Developer Experience

Nhost consists of open source software:

Architecture of Nhost




Visit https://docs.nhost.io for the complete documentation.

Get Started

Option 1: Nhost Hosted Platform

  1. Sign in to Nhost.
  2. Create Nhost app.
  3. Done.

Option 2: Self-hosting

Since Nhost is 100% open source, you can self-host the whole Nhost stack. Check out the example docker-compose file to self-host Nhost.

Sign In and Make a Graphql Request

Install the @nhost/nhost-js package and start build your app:

import { NhostClient } from '@nhost/nhost-js'

const nhost = new NhostClient({
  subdomain: '<your-subdomain>',
  region: '<your-region>'
})

await nhost.auth.signIn({ email: '[email protected]', password: 'spaceX' })

await nhost.graphql.request(`{
  users {
    id
    displayName
    email
  }
}`)

Frontend Agnostic

Nhost is frontend agnostic, which means Nhost works with all frontend frameworks.

Resources

  • Start developing locally with the Nhost CLI

Nhost Clients

Integrations

Applications

Community ❤️

First and foremost: Star and watch this repository to stay up-to-date.

Also, follow Nhost on GitHub Discussions, our Blog, and on Twitter. You can chat with the team and other members on Discord and follow our tutorials and other video material at YouTube.

Nhost is Open Source

This repository, and most of our other open source projects, are licensed under the MIT license.

ROSS Index - Fastest Growing Open-Source Startups | Runa Capital

How to contribute

Here are some ways of contributing to making Nhost better:

Contributors

A table of avatars from the project's contributors

cli's People

Contributors

2exp avatar atbe avatar constance-seedstash avatar dbarrosop avatar dependabot[bot] avatar elephant3 avatar elitan avatar eun avatar frink avatar github-actions[bot] avatar herohtar avatar linden avatar nesmanrique avatar nhost-build avatar nunopato avatar plmercereau avatar szilarddoro avatar usagizmo avatar xlanex6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

Workflow

Login

nhost login
> email
> password

save ~/.nhost/nhost.yaml

token: xxxx

Nhost init

Go to local project dir.

nhost init

Get list of projects.

Select project.

Will create .nhost/config.yaml with ex:

project_id: <project_id>

Download and applies migrations / metadata

Now remote and local Hasura are in sync.

Nhost dev

1

Make API request to https://customapi.nhost.io/custom/config?id=&token=

Gets settings, ex Postgres/Hausura/HBP version and other settings for docker-compose.yaml.

Creates docker-compose.yaml based on current settings on Nhost production.

2

Pull all dev env vars from Nhost and place in ex .env.development

2

Start docker-compose up -d

3

Start Hasura console using hasura console.

Github

Migrations will be generated. The idea is that users will commit these migrations and let Nhost apply the migrations to production.

The Github integrations might be a bit over-engineered for now, just applying Hasura migrations but the Github integration will make more sense in the future when we support custom api and hosting.

How to attach to api logs

Print how to attach to API logs

ex: docker logs -f nhost_api_1.

Can we control the name (nhost_api_1) to be sure it's correct when printing?

`nhost link`

Link existing project to a Nhost project.

Create: ./nhost/nhost.yaml and create+sync.env.development

Use case:

  • Someone has initiated a Nhost project and committed it to Git.
  • You are cloning the repo
  • Since .nhost/ is ignored there's no information about the Nhost project in the git repo.

nhost init fails when trying to export seed data

Running the command:
nhost init -e https://hasura-<nhost_endpoint>.nhost.app -a <admin_password>

fails with the error:
Error! Command failed: hasura seeds create roles_and_providers --from-table auth.roles --from-table auth.providers --endpoint https://hasura-<nhost_endpoint>.nhost.app --admin-secret <admin_password> --skip-update-check time="2020-10-19T13:57:18+13:00" level=fatal msg="exporting seed data: [unexpected] error while executing pg_dump: pg_dump: error: no matching tables were found\n ($)"

When I try to run the Hasura CLI command directly e.g.
hasura seeds create roles_and_providers --from-table auth.roles --from-table auth.providers --endpoint https://hasura-<nhost_endpoint>.nhost.app --admin-secret <admin_password> --skip-update-check
I get the same error message but this is a brand new nhost project.

I'm running the CLI on OS X Catalina 10.15.6 if that's relevant.

Check if entries exists before adding to .gitignore

    // CHECK FIRST
    // create or append to .gitignore
    const ignoreFile = `${workingDir}/.gitignore`;
    await writeFile(
      ignoreFile,
      `\n/nhost/config.yaml\n/nhost/.nhost\n/nhost/db_data\n/nhost/minio_data`,
      {
        flag: "a",
      }
    );

Possible move .nhost/ folder to root of directory, and move db_data and minio_data to .nhost/ so we only need to add .nhost to .gitignore.

local .env.development is not updated when adding new variables in nhost console

The local environment does not update or pull the new environment variables if already set up when the environment variable is added in the nhost console.

Trying to delete the .env.development to force a refresh on nhost dev makes the command not work as it can't find .env.development.

Would be great if nhost dev pulls the latest environment variables from nhost cloud on start, and deletes itself (similar to .nhost/) when turning off. As the environment variables can contain secrets that we do not want to push to github, but only use temporarily as we develop locally.

.env.development should be written (empty) even if no env vars being used

Otherwise nhost devwon't work

╭─[email protected] /tmp/facebook2
╰─➤ nhost dev
development environment is launching...first run takes longer to start
Couldn't find env file: /Users/eli/tmp/facebook2/.env.development
Error: Command failed: docker-compose -f ./.nhost/docker-compose.yaml config
Couldn't find env file: /Users/eli/tmp/facebook2/.env.development
at DevCommand.run (
/.npm-packages/lib/node_modules/nhost/src/commands/dev.js:147:5)
at DevCommand._run (~/.npm-packages/lib/node_modules/nhost/node_modules/@oclif/command/lib/command.js:44:31)


https://github.com/nhost/cli/blob/master/src/commands/init.js#L118

`nhost dev` fails on Linux likely due to permission issues with .nhost/db_data & minio folders

Run nhost dev on a Linux machine and check the permissions inside .nhost folder:

  • db_data is owned by -> systemd-coredump:root
  • minio is owned by -> root:root

This keeps these folders from being read / loaded on nhost dev and krasches the cli with the error message:

svarto@pop-os:~/Documents/React/project$ nhost dev

✖ Nhost is starting...
Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Creating network "nhost_default" with the default driver
Building nhost-api
error checking context: 'can't stat '/home/svarto/Documents/React/project/.nhost/db_data''.
Service 'nhost-api' failed to build

Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Creating network "nhost_default" with the default driver
Building nhost-api
error checking context: 'can't stat '/home/svarto/Documents/React/project/.nhost/db_data''.
Service 'nhost-api' failed to build


⠋ stopping Nhost
Writing logs to ./.nhost/nhost.log

✖ Failed to start docker-compose

Use production versions when using `nhost init` with `--endpoint`

We should expose a custom endpoint that for a given project ID it returns all versions for GraphQL engine, PostgreSQL and HBP.

This way, when initializing a local project from an existing project running on Nhost, we can automatically configure it to run the exact same versions of all services.

Error message is hard to read

Hello!

I'm trying out the Nhost CLI, and I've bumped into some errors.

As you can see from the screenshot, they are all escaped, and are therefore hard to read.

image

I copied the text into a browser console and it looks nicer:

image

nhost init fails when trying to access userData.user.teams

Running the command:
nhost init -e https://hasura-<nhost_endpoint>.nhost.app -a <admin_password>

fails with the error:
TypeError: userData.user.teams.flatMap(...) is not a function or its return value is not iterable

Does this command work without my user being part of a team?

API isn't reloading on code changes

version: nhost/0.4.1 darwin-x64 node-v12.18.3

Whenever I make a code change to a file in my project's /api folder, I need to shut down and reload the local environment in order for changes to take effect.

TypeError: Cannot read property 'toString' of undefined

Recently updated to the most recent host CLI version and started receiving the error shown below.

Screenshot_2021-05-04_22-59-05

I'm developing on Kali Linux and this appears to have been introduced in version 0.4.1-0 as 0.4.0 works perfectly. Likely an issue only for those on Linux as no one has raised any similar issues so far.

Loading feedback on `nhost dev`

nhost dev can take a while to get started. It would be great with some kind of feedback on what's happening during bootup.

`nhost init..` fails on Microsoft Windows (not supported)

Hello,

On windows 10:

C:\Users\petes\Sandpit\nhost2>hasura version
INFO hasura cli                                    version=v1.2.0

C:\Users\petes\Sandpit\nhost2>nhost init -d test-app
'command' is not recognized as an internal or external command,
operable program or batch file.
 »   Warning: Hasura CLI is a dependency. Please follow the instructions here https://hasura.io/docs/1.0/graphql/manual/hasura-cli/install-hasura-cli.html
(node:2476) SyntaxError Plugin: nhost: C:\Users\petes\AppData\Local\nhost\version: Unexpected end of JSON input
module: @oclif/[email protected]
task: runHook init
plugin: nhost
root: C:\Users\petes\AppData\Roaming\nvm\v12.16.1\node_modules\nhost
See more details with DEBUG=*

C:\Users\petes\Sandpit\nhost2>

Init a new project without connecting to Nhost

Currently when you run nhost init you get the following message:

No credentials found! Please login first with nhost login

If you do login but don't have a project created you will see:

We couldn't find any projects related to this account, go to https://console.nhost.io/new and create one

It would be awesome if we could run nhost init and nhost dev locally without even signing in with an nhost account.
Only deploy could require an nhost connection (nhost login).

Incorrect path in .gitignore

Currently nhost adds the following lines to .gitignore:

./nhost/config.yaml
./nhost/.nhost
./nhost/db_data
./nhost/minio_data

Correct lines should be without the . at the start of each line. Like so:

/nhost/config.yaml
/nhost/.nhost
/nhost/db_data
/nhost/minio_data

Seeding the PostgreSQL Database

Would be awesome to support the seeding of the database through the CLI.

Some possible solutions could be:

  • Using a SQL file to just run agains the database ... for those that know how to write the SQL commands
  • Using csv files via COPY command ...might be messy depending on relationships
  • Using something more sophisticated like http://knexjs.org/ .. which would require the dev to write some code

Honestly an first version could be just the CSVs and used mainly for non relational data otherwise you might have to have a process that disables CHECK constraints which sucks.

I am also assuming that most people would rather use something like a csv rather than having to deal with something like pg_dump

Cheers!
AJ

More env vars

add:

DEFAULT_ALLOWED_USER_ROLES
ALLOWED_USER_ROLES
REGISTRATION_CUSTOM_FIELDS

These values for these env vars should be synced during nhost init.

Include minio for storage support

Add minio as docker service:

  nhost-minio:
    image: minio/minio
    restart: always
    volumes:
      - '../minio_data:/export'
    environment:
      MINIO_ACCESS_KEY: <generated_access_key>
      MINIO_SECRET_KEY: <generated_secret_key>
    entrypoint: sh
    command: '-c ''mkdir -p /export/nhost && /usr/bin/minio server /export'''

Also add these env var to HBP:

      S3_ACCESS_KEY_ID: <generated_access_key>
      S3_SECRET_ACCESS_KEY: <generated_secret_key>
      S3_ENDPOINT: nhost-minio
      S3_BUCKET: nhost

Custom HTTP API container

Add custom API container on nhost init.

api/ folder

Dockerfile that will run the custom-api either in the api/ folder or in some hidden .nhost folder.

Boilerplate code for the first endpoint.

Support for Node or Python. Defaulting to Node Express. Maybe Python could be selected through ex nhost init --custom-api python or something similar.

Specifying custom image for hasura on M1 mac devices

The current version of the hasura engine does not work on M1 Macs. However, this image does: fedormelexin/graphql-engine-arm64:1.3.3. I would like to be able to specify my own engine for running hasura in the docker-compose file, but it's deleted whenever the nhost dev command is stopped. It would be nice if there was a config variable where we could override the docker image tag if needed.

First Try Feedback

I just gave this a try and thought I'd collect my feedback here.

How is it intended to be used?

You can only run nhost init on new directories. I assume most people will already have a project, however.

It creates 3 things. It's not clear which of these should be in .gitignore, and which should be part of the project.

docker-compose.example - When I see a .example file, I expect that I should copy it (removing .exmaple) and add my customizations. The new file would then be gitignore'd. This expectation is broken here, since I'm supposed to alter docker-compose.example directly if I need customization, unless that customization is in config.yaml.

config.yaml - This file, presumably, should not be in source control (since it has secrets in it), thus it likely does need a .example to allow other team members to create their own version (though of course I can easily create that). The name of the file, however, is a little awkward. I have config files for many things (next.js, Zeit now, eslint, prettier, etc.) in my repo, including a generic config for the env vars and secrets used by the project itself. Thus, config.yaml is a confusing name. Ideally something like nhost.yaml or nhost.config.yaml would be possible.

migrations/ - 👍

nhost dev

I was not able to get this to work. However, I was (after some debugging) able to use the generated docker-compose.yaml file. Having this file be generated but exposed feels like a very leaky abstraction to me. Ideally, this is either an implementation detail (tucked inside a gitignore'd .nhost dir or something) or it's user-editable. Trying to do both is very unintuitive to me.

My preference would be for nhost init to generate a docker-compose.yaml file directly (scrap the .example & config.yaml files), but use env vars for secrets/configurability. Then the local user can simply put their local config into a .env file (a common practice for other things).

Auth & Hasura

After I got my local setup working, the first thing I tried to do was import my configuration from Nhost using hasura metadata export and hasura migrate create. Both of those commands worked and generated the expected local migration files. However, when I tried to load them into my local instance I was unable. This is because the auth schema and associated tables are missing, and don't get pulled by hasura's export/migration functionality.

Ideally, nhost init would configure these tables as well.

Hopefully some of this feedback is useful. I absolutely love the idea of an easy-to-use local development experience for Nhost.

Add Postgres extensions (if possible)

I have a Postgres extension installed in my official database, pg_trgm, which wasn't found by the CLI's migration generator. This may not be possible, or it may be a Hasura thing, so I'd be glad to post a request there.

Anyway, adding

CREATE EXTENSION IF NOT EXISTS pg_trgm;

To my migration's up.sql file cleared up the problem, and the project was able to start.

The code that uses the extension, which (as we found) kills the seeding of the auth.roles, etc., is:

CREATE FUNCTION public.search_recipe(search text) RETURNS SETOF public.recipe
    LANGUAGE sql STABLE
    AS $$
SELECT   *
FROM     recipe
WHERE    search <% ( name || ' ' || tags || ' ' || coalesce(notes, '') || ' ' || coalesce(cookbook, '') )
ORDER BY similarity(search, ( name || ' ' || tags || ' ' || coalesce(notes, '') || ' ' || coalesce(cookbook, '') )) DESC;
$$;

The <% is non-standard syntax, and fails.

This may help writing a test.

Handle ports already in use

if, ex, port 8080 is already in use nhost dev will crash:

╭─elimbp ~/tmp/nhost/facebook2
╰─➤  nhost dev
Error: Command failed: docker-compose up -d > /dev/null 2>&1
    at DevCommand.run (~/projects/nhost/cli/src/commands/dev.js:42:5)
    at DevCommand._run (~/projects/nhost/cli/node_modules/@oclif/command/lib/command.js:44:31)

We should handle this by either, generate a new port to use or exit and prompt with a message saying why nhost dev won't work.

I think V1 could just exit and say the ports are already in use.

`nhost dev` fails on MacBook M1

Hey,

when I try to run nhost dev I got the following error:

Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
Creating network "nhost_default" with the default driver
Building nhost-api
#1 [internal] load build definition from Dockerfile-api
#1 sha256:9dc71cc303aa5135a404d06ec9d2d02299b429faea66de84209bdb365008439b
#1 transferring dockerfile: 162B 0.0s done
#1 DONE 0.3s

#2 [internal] load .dockerignore
#2 sha256:f1b4dbcbaec387b681129d45e70afb413f6e690502e7fa0eaa07d71932d013e6
#2 transferring context: 2B done
#2 DONE 0.6s

#3 [internal] load metadata for docker.io/nhost/nodeapi:v0.2.6
#3 sha256:f676c9da183169d422c61dd15d06b5123805a5df9af7ffbfdc5826d436a5d0bc
#3 DONE 0.7s

#4 [1/4] FROM docker.io/nhost/nodeapi:v0.2.6@sha256:3b8e9fce5e61eff92a7e5cd19b8f5a2fb28e044adaa05b44da6ff7c61e69c899
#4 sha256:5dbb7c58875933a0e1ed988c5fec1266949bd7b67b518c2f28e24d1d164c5579
#4 DONE 0.0s

#6 [internal] load build context
#6 sha256:9847883123cefc111c1e4c56870b41093753e8440051804f0f2ee1c721a8d328
#6 transferring context: 9.50kB 0.0s done
#6 DONE 0.2s

#5 [2/4] WORKDIR /usr/src/app
#5 sha256:3aad981cec18f58edff37180d22aa1f39d45f6bde46c5a6df4d3f09a8a7969e2
#5 CACHED

#7 [3/4] COPY api ./api
#7 sha256:ddb68579eb1732488444c3685590514b4b54e252c90012cb00ce794c367d971a
#7 CACHED

#8 [4/4] RUN ./install.sh
#8 sha256:85a830f38f7e97771368e0e72fe1ff9d2b717eeac50f70277d62001c50304594
#8 0.688 install.sh: applet not found
#8 ERROR: executor failed running [/bin/sh -c ./install.sh]: exit code: 127
------
 > [4/4] RUN ./install.sh:
------
executor failed running [/bin/sh -c ./install.sh]: exit code: 127
Service 'nhost-api' failed to build

All dependencies are installed.

which docker returns /usr/local/bin/docker
which docker-compose returns /usr/local/bin/docker-compose
which hasura returns ./node_modules/.bin/hasura

Expo url setup for nhost-cli local development and production use cases

The dockers are set up to serve on localhost at the moment, this makes it not possible to connect to them over the network from anotehr computer, or in my specific case during RN Expo development, through the Expo client which connects over the local network to the services.

If the option existed to choose to serve the dockers to listen on 0.0.0.0 or the current local network IP, then this would allow for reaching the services over the local LAN.

Self check for update

If new version of nhost is available, prompt user to update using npm install -g nhost@latest.

Unable to change postgres port

If I change the postgres_port in config.yaml, the service no longer boots. I believe it's because the port is mapped 3333:3333 (assuming 3333 is the new port), but doesn't change the internal postgres port. If I'm looking at this correctly, it should be mapping the custom port to the default port. Ie 3333:5432.

How to make Nhost CLI work in a CI

Right now Nhost CLI. can't run in GitHub actions.

This is my 2e2tests.yml workflow file:

name: Cypress Test
on:
  pull_request:
    branches: [main]

  workflow_dispatch:

jobs:
  cypress-test:
    runs-on: ubuntu-latest
    env:
      NEXT_PUBLIC_GRAPHQL_ENDPOINT: ${{ secrets.NEXT_PUBLIC_GRAPHQL_ENDPOINT }}
      NEXT_PUBLIC_BACKEND_ENDPOINT: ${{ secrets.NEXT_PUBLIC_BACKEND_ENDPOINT }}
      NEXT_PUBLIC_HASURA_SECRET: ${{ secrets.NEXT_PUBLIC_HASURA_SECRET }}
      HASURA_GRAPHQL_ENDPOINT: ${{ secrets.HASURA_GRAPHQL_ENDPOINT }}
    container: cypress/browsers:node12.18.3-chrome87-ff82
    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-node@master
        with:
          node-version: 14

      - run: npm install -g yarn
      - run: npm install -g nhost
      - run: npm install -g hasura-cli
      - run: curl -L "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
      - run: chmod +x /usr/local/bin/docker-compose
      - run: nhost dev
      - run: hasura seeds apply --file /03-29-2021-insert-user.sql --admin-secret ${{ secrets.NEXT_PUBLIC_HASURA_SECRET }} --endpoint ${{ secrets.HASURA_GRAPHQL_ENDPOINT }}
      - run: yarn install --frozen-lockfile
      - name: Run cypress tests
        run: npm run e2e:ci

        continue-on-error: false

In order to test and debug my workflows locally I'm using a tool called act
When running this this workflow locally it fails because Nhost CLI isn't able to create the necessary ressources, these are the errors I get

[Cypress Test/cypress-test ] ⭐ Run nhost dev
|
| - Nhost is starting...first run takes longer
| ✖ Nhost is starting...first run takes longer
| Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
| Creating network "nhost_default" with the default driver
| Creating nhost_minio ...
| Creating nhost_postgres ...
| Creating nhost_postgres ... error
|
| ERROR: for nhost_postgres Cannot start service nhost-postgres: Mounts denied:
| The path /github/workspace/.nhost/db_data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
| Creating nhost_minio ... error
|
| ERROR: for nhost_minio Cannot start service minio: Mounts denied:
| The path /github/workspace/.nhost/minio/data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
|
| ERROR: for nhost-postgres Cannot start service nhost-postgres: Mounts denied:
| The path /github/workspace/.nhost/db_data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
|
| ERROR: for minio Cannot start service minio: Mounts denied:
| The path /github/workspace/.nhost/minio/data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
| Encountered errors while bringing up the project.
|
| Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
| Creating network "nhost_default" with the default driver
| Creating nhost_minio ...
| Creating nhost_postgres ...
| Creating nhost_postgres ... error
|
| ERROR: for nhost_postgres Cannot start service nhost-postgres: Mounts denied:
| The path /github/workspace/.nhost/db_data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
| Creating nhost_minio ... error
|
| ERROR: for nhost_minio Cannot start service minio: Mounts denied:
| The path /github/workspace/.nhost/minio/data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
|
| ERROR: for nhost-postgres Cannot start service nhost-postgres: Mounts denied:
| The path /github/workspace/.nhost/db_data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
|
| ERROR: for minio Cannot start service minio: Mounts denied:
| The path /github/workspace/.nhost/minio/data is not shared from the host and is not known to Docker.
| You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
| See https://docs.docker.com/docker-for-mac for more info.
| Encountered errors while bringing up the project.
|
|
| - stopping Nhost

I guess that for real world projects, having E2E tests this is a must have and I'd love to have my E2E tests running on each PR.

If anyone interested in making Nhost CLI run in the CI, I'd love to help in any way I can.

Thank you

`nhost/metadata/tables.yaml` doesn't update when deleted from origin

I ran into some errors (#97) and so I deleted all the tables that I'd made.

However, when running nhost dev again, the same error message shows up.

I've found tables.yaml in the nhost/metadata folder which still shows the old tables.

Is there a way to re-fetch the tables from the origin?

Add user claims

Be able to specify custom user claims from the users table in the JWT token.

Unix socket timeout on nhost dev. Unable to start locally.

Hello All,

I'm unable to start any local environment.

nhost cli : v0.2.5
OS : macOS BigSur v11.2.1
Node : v12.13.0
hasura cli : v1.3.3

nhost login ok.
nhost init. ok.

nhost dev : failed.

Stack trace :

✖ Nhost is starting...first run takes longer
Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
[7873] Failed to execute script docker-compose
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 426, in _make_request
File "", line 3, in raise_from
File "site-packages/urllib3/connectionpool.py", line 421, in _make_request
File "http/client.py", line 1344, in getresponse
File "http/client.py", line 306, in begin
File "http/client.py", line 267, in _read_status
File "socket.py", line 589, in readinto
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
File "site-packages/urllib3/util/retry.py", line 403, in increment
File "site-packages/urllib3/packages/six.py", line 735, in reraise
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 428, in _make_request
File "site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
urllib3.exceptions.ReadTimeoutError: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
File "site-packages/docker/api/daemon.py", line 181, in version
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 228, in _get
File "site-packages/requests/sessions.py", line 543, in get
File "site-packages/requests/sessions.py", line 530, in request
File "site-packages/requests/sessions.py", line 643, in send
File "site-packages/requests/adapters.py", line 529, in send
requests.exceptions.ReadTimeout: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

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 67, in main
File "compose/cli/main.py", line 123, in perform_command
File "compose/cli/command.py", line 69, in project_from_options
File "compose/cli/command.py", line 132, 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 "site-packages/docker/api/client.py", line 188, in init
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

Error! Command failed: docker-compose -f ./.nhost/docker-compose.yaml up -d --build
[7873] Failed to execute script docker-compose
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 426, in _make_request
File "", line 3, in raise_from
File "site-packages/urllib3/connectionpool.py", line 421, in _make_request
File "http/client.py", line 1344, in getresponse
File "http/client.py", line 306, in begin
File "http/client.py", line 267, in _read_status
File "socket.py", line 589, in readinto
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
File "site-packages/urllib3/util/retry.py", line 403, in increment
File "site-packages/urllib3/packages/six.py", line 735, in reraise
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 428, in _make_request
File "site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
urllib3.exceptions.ReadTimeoutError: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
File "site-packages/docker/api/daemon.py", line 181, in version
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 228, in _get
File "site-packages/requests/sessions.py", line 543, in get
File "site-packages/requests/sessions.py", line 530, in request
File "site-packages/requests/sessions.py", line 643, in send
File "site-packages/requests/adapters.py", line 529, in send
requests.exceptions.ReadTimeout: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

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 67, in main
File "compose/cli/main.py", line 123, in perform_command
File "compose/cli/command.py", line 69, in project_from_options
File "compose/cli/command.py", line 132, 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 "site-packages/docker/api/client.py", line 188, in init
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

⠋ stopping Nhost
Writing logs to ./.nhost/nhost.log

⠴ stopping Nhost
Error during writing of logfile

Error: Command failed: docker-compose -f ./.nhost/docker-compose.yaml logs --no-color -t > ./.nhost/nhost.log
[7920] Failed to execute script docker-compose
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 426, in _make_request
File "", line 3, in raise_from
File "site-packages/urllib3/connectionpool.py", line 421, in _make_request
File "http/client.py", line 1344, in getresponse
File "http/client.py", line 306, in begin
File "http/client.py", line 267, in _read_status
File "socket.py", line 589, in readinto
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
File "site-packages/urllib3/util/retry.py", line 403, in increment
File "site-packages/urllib3/packages/six.py", line 735, in reraise
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 428, in _make_request
File "site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
urllib3.exceptions.ReadTimeoutError: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
File "site-packages/docker/api/daemon.py", line 181, in version
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 228, in _get
File "site-packages/requests/sessions.py", line 543, in get
File "site-packages/requests/sessions.py", line 530, in request
File "site-packages/requests/sessions.py", line 643, in send
File "site-packages/requests/adapters.py", line 529, in send
requests.exceptions.ReadTimeout: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

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 67, in main
File "compose/cli/main.py", line 123, in perform_command
File "compose/cli/command.py", line 69, in project_from_options
File "compose/cli/command.py", line 132, 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 "site-packages/docker/api/client.py", line 188, in init
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

⠸ stopping Nhost
Error during docker compose down

Error: Command failed: docker-compose -f ./.nhost/docker-compose.yaml down
[8062] Failed to execute script docker-compose
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 426, in _make_request
File "", line 3, in raise_from
File "site-packages/urllib3/connectionpool.py", line 421, in _make_request
File "http/client.py", line 1344, in getresponse
File "http/client.py", line 306, in begin
File "http/client.py", line 267, in _read_status
File "socket.py", line 589, in readinto
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 727, in urlopen
File "site-packages/urllib3/util/retry.py", line 403, in increment
File "site-packages/urllib3/packages/six.py", line 735, in reraise
File "site-packages/urllib3/connectionpool.py", line 677, in urlopen
File "site-packages/urllib3/connectionpool.py", line 428, in _make_request
File "site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
urllib3.exceptions.ReadTimeoutError: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages/docker/api/client.py", line 205, in _retrieve_server_version
File "site-packages/docker/api/daemon.py", line 181, in version
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 228, in _get
File "site-packages/requests/sessions.py", line 543, in get
File "site-packages/requests/sessions.py", line 530, in request
File "site-packages/requests/sessions.py", line 643, in send
File "site-packages/requests/adapters.py", line 529, in send
requests.exceptions.ReadTimeout: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

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 67, in main
File "compose/cli/main.py", line 123, in perform_command
File "compose/cli/command.py", line 69, in project_from_options
File "compose/cli/command.py", line 132, 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 "site-packages/docker/api/client.py", line 188, in init
File "site-packages/docker/api/client.py", line 213, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

✖ Failed to start docker-compose

(maybe the error output could be cleaned because it's quite redondant now ;))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.