Common Error when trying to Delete

{
  "message": "Failed to fetch",
  "stack": "TypeError: Failed to fetch"
}

I am getting this quite often when trying to delete large sets of data through delete mutations. The data does not get deleted.

qq, where this error comes from? and how did you set up it?

Well, now even my health endpoint is being weird and up/down. I am gonna take a break and come back to this.

@slotlocker2 I believe this is the cause. Trying to delete data.

I ran

mutation {
  deleteRelationship(filter: {}) {
    numUids
  }
}

This provided the above error, so I tried instead to write a script to get ids and then delete by IDs. It worked with 100 IDs (I have ~13K to delete) so I upped the next run to 1K to see if it would handle that and then it went OOM.

UPDATE: Yep, I killed it again by doing uping this script to deleting 1K in a chunk.

Is there a better way to do deletes using Slash?

I was able to delete the data using the following DQL

upsert {
	query {
		data as var(func:type(Relationship)) {
			uid
		}
	}
	mutation {
		delete {
			uid(data) * * .
		}
	}
}

And it completed successfully in:

"server_latency": {
      "parsing_ns": 22023,
      "processing_ns": 2221448014,
      "encoding_ns": 4744,
      "assign_timestamp_ns": 1514553,
      "total_ns": 2223427071
    },

I just now have to create the DQL to delete the inverses. Maybe this is the hickup that is causing the graphql endpoint to use so much RAM and going OOM.

I deleted my inverse relationships manually using:

upsert {
	query {
		var1 as var(func:has(Contact.relationshipsTo)) {
			uid
		}
		var2 as var(func:has(Contact.relationshipsOf)) {
			uid
		}
	}
	mutation {
		delete {
			uid(var1) <Contact.relationshipsTo> * .
      uid(var2) <Contact.relationshipsOf> * .
		}
	}
}
1 Like