Appwite LocalHost 404, general_route_not_found Error

324 views Asked by At

I'm encountering an issue with my Appwrite setup. When attempting to access the endpoint 'http://localhost:80/v1' using Docker, I'm receiving a "LocalHost 404, general_route_not_found" error. The error message in the browser is as follows:

In Browser

{"message":"The requested route was not found. Please refer to the API docs and try again.",
"code":404,
"type":"general_route_not_found",
"version":"1.4.9"}

In my app, the error trace looks like this:

In App

                   | #0   ClientIO.call (package:appwrite/src/client_io.dart:381:7)
I/flutter (11975): │ #1   <asynchronous suspension>
I/flutter (11975): |┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (11975): │ ⛔ Connection refused

when I access 'http://localhost:80' in the browser without "/v1" it works fine. I'm aiming to establish a connection between my app and Appwrite.

----------------------------------------------------------------------------

Solution:

I resolved the issue by updating the endpoint from http://localhost:80/v1 to http://192.168.xxx.xxx:80/v1.

One of them works:

Endpoint = http://192.168.xxx.xxx:80/v1 or Endpoint = http://127.0.0.1:80/v1

Or Try This:

~$ adb root
~$ adb reverse tcp:80 tcp:80
1

There are 1 answers

0
Yes Dev On

I was receiving this error when trying to use the hosted Appwrite database. It turned out I was trying to get my database ID from the environment without using the const keyword:

String get databaseId => String.fromEnvironment('APPWRITE_DATABASE_ID');

This just returns a blank string. To fix, I just had to add const:

String get databaseId => const String.fromEnvironment('APPWRITE_DATABASE_ID');

The error message from Appwrite was very generic:

The requested route was not found. Please refer to the API docs and try again.