I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting this error. My function builds just fine, no errors and the webinterface tells me that its active.
I just created a new function, pushed new code but the domain still behaves like its the template. Something isnt working right now
Okay, it seems like i have to manually create an execution - only then its listed in the dashboard. if i simply request the url and it fails, its not listed and the function doesnt update properly
Still broken though. I dont know what causes it or how to fix it
executions work but not from the url?
Hey, I can help with this! The router_deployment_not_found error despite a successful build is a known Appwrite Functions routing issue the deployment completes but the router doesn't automatically activate it as the live deployment for your domain.
Quick question: when you go to your function's Deployments tab, is the latest deployment actually marked as Active, or is it just showing as built/completed?
<@346059939502096396>
Its marked as active (and all the IDs are matching), thats why it confuses me. It behaves as if its not always actually the active deployment
like just now i pushed a deployment, it build sucessfully, is marked as active but contains the same error (my code within a route threw an exception) even thoughthe code i pushed had it already fixed
It also sometimes behaves differently when i manually execute it vs when i try to run it using the url. When executed using the webinterface, everything works but when i use python, i get the same (already fixed) exception. as if the webinterface uses the newer deploy and via url i only have access to an older version
I'm happy to help you actually debug the Appwrite issue though. From what I can see, the deployment is marked Active and the IDs match, but it's still serving stale behavior. That points to a CDN caching problem ...Global CDN is connected, and Appwrite's CDN can serve a cached response even after a new deployment goes active. The fix is usually waiting a few minutes, or if Appwrite exposes a cache purge option for your function domain, triggering that manually. The 500 on /player is a separate thing ...that's your code throwing at runtime, not a routing issue. Want to share the exception so we can dig into that?
Thanks, but i dont need help with the exception. It was merely a means to show how the same route behaves differently depending from where i access it. I am not quite sure if this is a caching issue, since even an hour later i still get these issues. Every once in a while i manage to get an updated version (deleting all deployments, waiting, pushing a new one, waiting etc - i also believe that sometimes triggering the route from the webinterface first helps) but this really doesnt help when i want to rapid test some things. I also dont seem to have the option to purge the cache manually.
That aside, caching should only influence the response imho but the entire function isnt running new code (eg adding some database update code or context.log() are also not executed). It appears to use an old deployment
That rules out CDN caching then if context.log() isn't firing, it's genuinely executing an old deployment, not just serving a cached response. This sounds like an Appwrite Cloud bug where the router doesn't consistently point to the active deployment. A few things worth trying: does hitting Execute from the dashboard first (before hitting the URL) consistently unblock it? And are you on Appwrite Cloud or self-hosted? <@346059939502096396>
No, sadly it doesnt. Executing via dashboard can use the newest deployment but doesnt have to, whereas using the url seems to be the old deployment. I dont know what causes it to sync up again once in a while.
I am using the appwrite cloud
Can you send me a direct message
<@743532656767270934> Do you have any insight on this, or know someone who might?
Just to recap some information
the error router_deployment_not_found is not the issue. It is a symptom of the deployment not syncing up correctly. Webinterface/Cloud (NOT selfhosted) a lot of times seems to be using an up-to-date deployment whereas accessing it via URL accesses an older deplyoment (which in my case, when trying to figure this out, resulted to this error after deleting all deployments and pushing a new one).
I can rule out caching because when i add a log or a table insert or something, it will do that using the execution function on the dashboard but not via url.
not sure i understand, issue u get router deployment not found on older deployments?
When i push a deployment, the dash/cloud website is using that (the new one) when creating an execution from it. The url i get to make requests lacks behind and is not using the newest deployment but an older/previous one.
The error router_deployment_not_found is only a symptom of this issue that happens when i delete all deployments and then push a new one, as the url lacks behind and thinks there are still no deployments.
there will be a small delay in activation, its not instantaneous
if you think gap is too big, try reporting exact numbers and if its too big we can take a look why its so slow
i mean, what does small delay mean? yesterday it never updated, not even after 60+ minutes of waiting. I was only able to fix it by trial and error every once in a while with a combination of pulling everything via cli, pushing everything, deleting all deployments and running an execution from the webinterface before i run a request using python (i didnt figure out what exactly fixed it sometimes, i was just trying things)
hmm can u share source code? maybe caching?
like i said, to verify this i added logs and db inserts and they work with the dashboard execute but not python/url as its still using the previous deployment. I'd rather not share the code as its related to secure messaging and handles sensitive data.
Recommended threads
- Function's Static IP
Is it possible to have static. IP Address instead of Dynamic IP for getting the IP Address whitelist
- How to use dart workspaces to deploy a f...
Hello, I'm developing a Flutter application and I would like to leverage dart pub workspaces to deploy a function with a dart runtime as advertised here : http...
- [SOLVED] Unable to push function from AP...
When trying to push functions from Gitlab CI (with an API KEY and using the CLI), i saw that i was unable to push functions. ``` $ appwrite client --endpoint $...