Back

[SOLVED] Issue on Status of Deployment in ServerSide

  • 0
  • Functions
  • Cloud
Mosh Ontong
7 Mar, 2024, 10:15

This is the output from my code to get the deployments list

TypeScript
Collecting deployments total in function: taramedAccount (account)
Fetched functions.
Fetching deployments...
{
  total: 1,
  deployments: [
    {
      $id: "65e9915721f4b516fc9d",
      $createdAt: "2024-03-07T10:05:11.543+00:00",
      $updatedAt: "2024-03-07T10:05:47.691+00:00",
      type: "vcs",
      resourceId: "657de74807e8c5a3d6b4",
      resourceType: "functions",
      entrypoint: "src/main.ts",
      size: 3072245,
      buildId: "65e9917ba734832d5f2d",
      activate: true,
      status: "ready",
      buildLogs: "Preparing for build ...\nBuilding ...\nbun install v1.0.29 (a146856d)\n\n + bun-types@1.0.18\n + prettier@3.0.3\n + node-appwrite@11.1.0\n\n 12 packages installed [238.00ms]\nPacking build ...\nBuild finished.\n",
      buildTime: 6,
    ...

Focus on this output:

TypeScript
  $id: "65e9915721f4b516fc9d",
      $createdAt: "2024-03-07T10:05:11.543+00:00",
      $updatedAt: "2024-03-07T10:05:47.691+00:00",
      type: "vcs",
      resourceId: "657de74807e8c5a3d6b4",
      resourceType: "functions",
      entrypoint: "src/main.ts",
      size: 3072245,
      buildId: "65e9917ba734832d5f2d",
      activate: true,
      status: "ready",

As you can see the 65e9915721f4b516fc9d's status is ready but according on the console is active please observe the picture

TL;DR
[SOLVED] Developer was initially looking at Deployment status instead of Function status. Solution: Need to retrieve the active deployment ID from the Function, not Deployment. Objective is to delete inactive deployments. Received error when trying Query.notEqual("status", "active"). Output shows deployment details, focus on "ready" status versus "active" status in console confusion.
Mosh Ontong
7 Mar, 2024, 10:16

My objective is I want to delete all deployments excepts the active statys

Mosh Ontong
7 Mar, 2024, 10:16

status

Mosh Ontong
7 Mar, 2024, 10:16

but I cant use the Query.notEqual("status", "active"), this gives me an error.

ideclon
7 Mar, 2024, 10:21
TypeScript
{
  ...
  activate: true,
}
Mosh Ontong
7 Mar, 2024, 10:33

Unfortunately my friend I think that is not the solution for my problem

Mosh Ontong
7 Mar, 2024, 10:33
Mosh Ontong
7 Mar, 2024, 10:33

every deployment's active are true

ideclon
7 Mar, 2024, 10:36

Oh, I see - you need to get the active deployment ID from the Function, not from the Deployment

Mosh Ontong
7 Mar, 2024, 10:38

ohhh I seee

Mosh Ontong
7 Mar, 2024, 10:38

tnx @ideclon

Mosh Ontong
7 Mar, 2024, 10:43

[SOLVED] Issue on Status of Deployment in ServerSide

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