Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Appwrite: The requested route was not found #4224

Closed
crocofied opened this issue Nov 9, 2024 · 7 comments · Fixed by #4338
Closed

[Bug]: Appwrite: The requested route was not found #4224

crocofied opened this issue Nov 9, 2024 · 7 comments · Fixed by #4338

Comments

@crocofied
Copy link

Error Message and Logs

If you try to install appwrite and open it now in the browser you get this error on the site:

{"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.6.0"}

Steps to Reproduce

  1. Add new Service
  2. Select Appwrite
  3. Click Deploy
  4. Open the URL/Domain From Appwrite

Example Repository URL

No response

Coolify Version

v4.0.0-beta.364

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Debian 12

Additional Information

No response

@crocofied crocofied added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Nov 9, 2024
@Mini-Sylar
Copy link

It seems with appwrite 1.6, a new image "appwrite-console" has been added, separate from the "appwrite" image, it's missing in the coolify template file

@Wodwes
Copy link

Wodwes commented Nov 11, 2024

can you share the complete template please

@Mini-Sylar
Copy link

@Wodwes Tried doing it manually, was getting a 500 error after starting the app, probably because of the strip prefix thing
Seems there's an open PR tho, #4226,

@bananacy
Copy link

lol i just discovered both coolify and appwrite, thought i'd try them and boom doesn't work :-)
{"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.6.0"}

@ilbeybey
Copy link

Yes, I have the same issue. I started to be use from 1.5.11 version until the 1.6 version is fixed. Coolify team please help us :)

@Mini-Sylar
Copy link

Mini-Sylar commented Nov 16, 2024

@ilbeybey here's what I've gathered so far, my issues have been resolved, you can follow this PR -> #4279

TLDR

  • Coolify has been updated with the new 1.6.0 template but there's still some configuration you need to do manually
  • If you can't update coolify here's the new template NEW APPWRITE TEMPLATE by djsisson
  • He also updated the ENV, function domains work perfectly now

Assuming you're able to start from scratch

Traefik

  • If you're on traefik i.e the default coolify proxy you need to disable "strip prefix" for realtime and console and it should work. Easiest option IMO

Caddy

  • you need to remove the domains from both realtime and console. Also disable strip prefix (Might not matter)
  • Once this is done you'll notice that in the "deployable" compose the labels will be gone, you'll need to add this in manually. Examples below
appwrite-console:
  ## ... other stuff from the new template
     environment:
      - SERVICE_FQDN_APPWRITE=/console #this should already exist
    labels:
      - 'caddy_0.encode=zstd gzip'
      - 'caddy_0.handle=/console*'
      - 'caddy_0.handle.0_reverse_proxy={{upstreams}}'
      - caddy_0.header=-Server
      - 'caddy_0.try_files={path} /index.html /index.php'
      - 'caddy_0=YOUR DOMAIN ' # e.g https://appwrite.yourdomain.com or https://yourdomain.com, note the '
      - caddy_ingress_network=YOUR NETWORK   # You can find this in the deployable compose, the random string e.g ec4w4ow4coo....
appwrite-realtime:
   ##... other stuff from the new template
    - '_APP_USAGE_STATS=${_APP_USAGE_STATS:-enabled}'
      - '_APP_LOGGING_CONFIG=${_APP_LOGGING_CONFIG}'
    labels:
      - 'caddy_0.encode=zstd gzip'
      - 'caddy_0.handle=/v1/realtime*'
      - 'caddy_0.handle.0_reverse_proxy={{upstreams}}'
      - caddy_0.header=-Server
      - 'caddy_0.try_files={path} /index.html /index.php'
      - 'caddy_0=YOUR DOMAIN'
      - caddy_ingress_network=YOUR NETWORK 

You should be able to see your console now, if not you might get the 404 or redirected too many times

Data Backup

Now I know you may not be able to start from scratch so here are a few options to backup your data;

Caution

This might not be fool proof and you may lose your data, explore other options from appwrite/someone else first

Option 1

  • Use the Appwrite CLI to pull in all your databases, functions, attributes etc.
  • Create a new service with the new changes,
  • push the changes to your new service

Option 2 (Did the migration but lost my data after migrating back but it's worth exploring)

  • migrate to cloud
  • then migrate back after the new template is setup

Concerns

  • You may have an issue with creating attributes, if that's the case then see FIX
  • in appwrite-worker-databases container, there were some environment variables not found in the appwrite .env
    - '_APP_WORKERS_NUM=${_APP_WORKERS_NUM:-1}'
    - '_APP_QUEUE_NAME=${_APP_QUEUE_NAME:-appwrite}'
    - '_APP_DATABASE_SHARED_TABLES=${_APP_DATABASE_SHARED_TABLES}'

Removing these 3 fixed it for me

  • Strongly recommend you follow this ISSUE
  • Seems like a lot of steps but it really isn't, I just typed a lot trying to simplify it as much as possible
  • Regarding caddy, there's an open PR to fix the strip prefix option

Disclaimer

I'm not affiliated with the coolify team, just thought i should gather all the info in one place;

Any updates or clarifications would be appreciated

@ilbeybey
Copy link

Thanks for your help @Mini-Sylar It worked!

@peaklabs-dev peaklabs-dev removed the 🔍 Triage Issues that need assessment and prioritization. label Nov 19, 2024
@peaklabs-dev peaklabs-dev added this to the v4.0.0 Stable Release milestone Nov 19, 2024
@github-actions github-actions bot removed 🐛 Bug Reported issues that need to be reproduced by the team. labels Nov 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants