argument #0:
'Appwrite service :: createAccount() :: ' error:
AppwriteException { name: 'AppwriteException', code: 500, type: 'general_unknown', response: { message: 'Server Error', code: 500, type: 'general_unknown', version: '0.11.59' }, fileName: 'http://localhost:5173/node_modules/.vite/deps/appwrite.js, lineNumber: 550, columnNumber: 5, message: 'Server Error' }
//Code
async createAccount({email, password, name}){ try { const avatars = new Avatars(this.client); const avatarUrl = avatars.getInitials(name); const userAccount = await this.account.create(ID.unique(), email, password, name) if(!userAccount){ throw Error } const userId = userAccount.$id const newUser =await this.databases.createDocument( conf.appwriteDatabaseId, conf.appwriteUsersCollectionId, ID.unique(), { UserId : userId, Username : name, Password : password, Email : email, ImageUrl : avatarUrl }) if(!newUser){ throw Error }else{ console.log('login') return this.login({email, password}) } } catch (error) { console.log("Appwrite service :: createAccount() :: ", error) } }
Did you check the permissions of the collection ??
@sushant if your collection has relationships with other collections, check the permissions for related collections also.
Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
It is still giving the same issue @Muniraja
Are you using cloud or self hosting?
Original GitHub issue: https://github.com/appwrite/appwrite/issues/7309
I haven't seen any new errors come in from your project 🧐
Would you please share the details of your collection?
Thanks, The issue above has been resolved now.
AppwriteException { name: 'AppwriteException', code: 401, type: 'general_unauthorized_scope', response: { message: 'User (role: guests) missing scope (account)', code: 401, type: 'general_unauthorized_scope', version: '0.12.12' }, fileName: 'http://localhost:5173/node_modules/.vite/deps/appwrite.js', lineNumber: 550, columnNumber: 5, message: 'User (role: guests) missing scope (account)' }
But I am getting this issue in another function.
This error means you're not logged in
okay thank you @Drake
Can you share information about how you solve the first issue?
It got solved by creating permissions for other related collection as well
Thank you! I'll set this as solved
[SOLVED] Getting General Unknown Error using databases.createDocument()
Recommended threads
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...