#Error: AppwriteException: Collection with the requested ID could not be found

28 messages · Page 1 of 1 (latest)

random vale
#
import { ID, Query } from "appwrite";
import { databases } from "$lib/appwrite";
import type { FormState } from "$lib/configs/CompanyForm";

const DATABASES_ID = import.meta.env.VITE_APPWRITE_DATABASES_ID;
const COLLECTION_ID = "steps";

const createFormService = () => {
    async function getFormStore(email: string) {
        try {
            const response = await databases.listDocuments(DATABASES_ID, COLLECTION_ID, [
                Query.equal("email", email)
            ]);

            // if fetched formStore exists
            if (response.total > 0) {
                return response.documents[0];
            } else {
                return null;
            }
        } catch (error: any) {
            throw new Error(error);
        }
    }

    async function updateFormStore(formStore: FormState) {
        const exist = await getFormStore(formStore.user.email);

        if (exist) {
            await databases.updateDocument(DATABASES_ID, COLLECTION_ID, exist.$id, formStore);
        } else {
            await databases.createDocument(DATABASES_ID, COLLECTION_ID, ID.unique(), formStore);
        }
    }

    return {
        getFormStore,
        updateFormStore
    };
};

const formService = createFormService();

export default formService;

This time, I got this error when I call updateFormStore method
Error: AppwriteException: Collection with the requested ID could not be found.

pallid egret
random vale
#

How do I check that?

pallid egret
random vale
#

Got this error
Error: AppwriteException: The current user is not authorized to perform the requested action.

pallid egret
random vale
pallid egret
random vale
pallid egret
# random vale

What was it before?

Does this collection have relationship attributes?

random vale
#

I applied that permission to Relationship collections, too

random vale
#

?

pallid egret
pallid egret
# random vale .

I didn't ask you to do anything. I was asking what was the current configuration when the error was occurring

random vale
#

The error occurs when I call updateFormStore()

pallid egret
random vale
pallid egret
random vale
random vale
#

Why is that happening?

pallid egret
# random vale

This is a get request...there's still some permission problem with some of your collections

#

And you didn't copy and paste the URL yet

random vale
pallid egret
pine wren
#

Was it solved. I am getting this error now. But only in production/vercel. I have added thread support. Please share the solution of you were able to get the data.

random vale
#

Yes, resolved

pine wren
# random vale Yes, resolved

Please share What was the actual problem I am having similar issue. On local data loads, but on Vercel, it shows collection ID wrong. How you solved it for your case?