Back

getting {"name":"AppwriteException","code":0,"type":"","response":""} on operations via node

  • 0
  • Self Hosted
  • Web
  • Storage
gin
4 Nov, 2024, 14:27

Hey, so im running a express node server and im trying to delete/upload files over it,

TypeScript
await storage.deleteFile(
          process.env.APPWRITE_BUCKET_ID as string,
          player.statsProfile.playerProfileSocial.profileBannerId
        );

This implementation works fine over localhost, but on production deployed via docker i get

TypeScript
{"name":"AppwriteException","code":0,"type":"","response":""}

as response on every operation

TL;DR
Developers are experiencing an AppwriteException with code 0 on delete/upload file operations via node server. The error could be related to the connection with the Appwrite API endpoint despite credentials being correct. The issue persists even after trying different configurations. The problem seems to occur only in the production environment deployed via Docker. The code provided initializes the storage instance and calls operations.
gin
4 Nov, 2024, 14:28

i tought maybe its a issue with nginx so i just directly called the ipv4 where appwrite runs on, same result...

gin
4 Nov, 2024, 14:29

More information, this is how i initialise the storage instance ->

TypeScript
import { Storage } from "node-appwrite";

const sdk = require("node-appwrite");

let client = new sdk.Client();
client
  .setEndpoint(process.env.APPWRITE_ENDPOINT)
  .setProject(process.env.APPWRITE_PROJECT_ID)
  .setKey(process.env.APPWRITR_KEY)
  .setSelfSigned();

let storage = new sdk.Storage(client);

export function ApprWriteStorage(): Storage {
  return storage;
}
gin
4 Nov, 2024, 14:31

most annoying part is that on localhost everything runs fine, so everytime i want to debug something i have to redeploy

gin
4 Nov, 2024, 14:34

i removed ```typescript .setSelfSigned();

TypeScript
same result
gin
4 Nov, 2024, 14:37

credentials and everything is fine, i use the same creds on localhost and everything runs smoothly

gin
4 Nov, 2024, 14:38

so it probably has something to do with the connection of the appwrite api endpoint itself?

gin
4 Nov, 2024, 14:38

the error really tells me nothing lmao

gin
4 Nov, 2024, 14:40

maybe it isnt that productive at all using appwrite just for storing files or?

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