Back

[SOLVED] New Appwrite Instance not working with CLI

  • 0
  • Self Hosted
Tanner Meade
29 Aug, 2023, 13:11

I'm running into an issue where when I run appwrite client --endpoint [endpoint] I am getting the error: ✗ Error Invalid endpoint or your Appwrite server is not running as expected..

I've tried deleting and changing the ~/.appwrite/prefs.json with no luck. Once I did change it to {}, and I had thought I had figure it out. But when I rebuilt the server from scratch it doesn't work.

I've got a terraform+ansible script that provisions and creates the server cluster (docker swarm) so I know the cluster is exactly the same every time.

I've got another cluster I've had running for a while and that endpoint can be added every time, just not the new one. All the services are up and running in docker and I can create the whole database, functions, deployments, users, etc... the CLI just isn't wanting to connect.

Any ideas what might be wrong?

TL;DR
Title: [SOLVED] New Appwrite Instance not working with CLI; Message: User experienced issues with Appwrite CLI not connecting to a new Appwrite instance. They tried deleting and changing the `prefs.json` file with no success. They suspected an SSL provisioning delay. Solution: Deleting the `prefs.json` file, running `curl [endpoint]/versions` to check for JSON response, running `appwrite client --selfSigned true`, and then logging in with `appwrite login` resolved the issue.
Tanner Meade
29 Aug, 2023, 13:11

The endpoint is correct. It's formatted as https://subdomain.domain.com/v1. The DNS record is available and I can do whatever I want via the console.

Tanner Meade
29 Aug, 2023, 13:12

I think that it might need to wait until the SSL is provisioned?

Binyamin
29 Aug, 2023, 14:13

First try this

  1. Delete (or move) ~/.appwrite/prefs.json file
  2. curl your endpoint like so
TypeScript
curl endpoint.com/versions

Check if you're getting the versions JSON 3. Run this command

TypeScript
appwrite client --selfSigned true
  1. Login
TypeScript
appwrite login
Tanner Meade
31 Aug, 2023, 03:27

I'm getting a curl: (6) Could not resolve host: [domain] for the 2nd command. I was thinking that might be DNS, but the browser can access it. So something is taking a bit for curl to access it.

Drake
31 Aug, 2023, 03:32

Browser and curl are running on the same machine?

Tanner Meade
31 Aug, 2023, 08:51

yes

Drake
31 Aug, 2023, 18:45

what version of appwrite are you on?

Tanner Meade
31 Aug, 2023, 18:46

V1.3.8

Drake
31 Aug, 2023, 18:47

so you did curl https://[DOMAIN]/versions and got the could not resolve host error?

Tanner Meade
31 Aug, 2023, 18:48

Ya, but it reliability works after a while

Tanner Meade
31 Aug, 2023, 18:48

Just take 10+ mins

Binyamin
31 Aug, 2023, 18:49

So to summarize

  • Accessing https://[DOMAIN]/versions in your browser works fast?
  • Accessing https://[DOMAIN]/versions in the command line is slow?
Tanner Meade
31 Aug, 2023, 18:50

Didn't try /versions in the browser, but the domain resolves and the console works.

Binyamin
31 Aug, 2023, 18:51

So what doesn't?

Tanner Meade
31 Aug, 2023, 18:51

appwrite-cli and curl not accessing /versions

Binyamin
31 Aug, 2023, 18:53

Are you using wsl? mac? windows?

Tanner Meade
31 Aug, 2023, 18:58

mac

Binyamin
31 Aug, 2023, 18:59

Try to run

TypeScript
ipconfig /flushdns

Then run the curl https://[DOMAIN]/versions and share the results

Tanner Meade
31 Aug, 2023, 19:00

next time I spin the cluster down and re-deploy I'll try that and /versions in the browser.

Tanner Meade
16 Sep, 2023, 12:45

I believe this worked on macOS. I did have to use this instead of the command you used: sudo killall -HUP mDNSResponder

Tanner Meade
16 Sep, 2023, 12:47

[SOLVED] New Appwrite Instance not working with CLI

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more