Issue: Avatar URLs are using server IP address instead of configured domain Environment:
Appwrite Version: 1.8.0 Setup: Self-hosted on Google Compute Engine with Cloudflare Tunnel Domain: <your-domain> Frontend: Firebase Hosting at <your-frontend-domain>
Problem: The avatars.getInitials() endpoint is generating URLs with the server's IP address instead of the configured domain:
Current (wrong): http://<public-ip>/v1/avatars/initials?name=User&project=<project-id> Expected: https://<your-domain>/v1/avatars/initials?name=User&project=<project-id>
This causes:
ERR_CERT_AUTHORITY_INVALID errors (IP has no SSL cert) Mixed content warnings (HTTP images on HTTPS page) Blocked image requests
Configuration: All environment variables are correctly set in both .env and docker-compose.yml: bash_APP_DOMAIN=<your-domain> _APP_DOMAIN_TARGET=<your-domain> _APP_DOMAIN_FUNCTIONS=<your-domain> _APP_ENDPOINT=https://<your-domain>/v1 Verified: bashdocker exec -it appwrite printenv | grep APP_DOMAIN
Shows all domain variables are correct
Steps Taken:
Restarted Appwrite multiple times Cleared browser cache Added platform for frontend domain in Appwrite console Verified Cloudflare Tunnel is working correctly (other API endpoints work fine)
Question: Why is the avatar service still generating URLs with the IP address? Is there a cached value in the database or a specific configuration for the avatar service we're missing?
I been in the issue from yesterday
My appwrite is self hsoted in gcp and I have used cloudfalre tunnel for it.Console is opening from my subdomain adn data are allso being fetch from db.But avatar are not showing
You're passing an IP address into client.setEndpoint()
Get initials doesn't make any api call. It just builds the url and returns it. See https://github.com/appwrite/sdk-for-web/blob/de72141ece55b1eb4e8d14b8bf429c3b8bf690ce/src/services/avatars.ts#L461
No,I am not passing .I am passing subdomain url.import { Client, Account, Databases, Storage, Avatars } from 'appwrite'
export const appwriteConfig = { projectId: import.meta.env.VITE_APPWRITE_PROJECT_ID, url: import.meta.env.VITE_APPWRITE_URL, databaseId: import.meta.env.VITE_APPWRITE_DATABASE_ID, storageId: import.meta.env.VITE_APPWRITE_STORAGE_ID, userCollectionId: import.meta.env.VITE_APPWRITE_USERS_COLLECTION_ID, postCollectionId: import.meta.env.VITE_APPWRITE_POSTS_COLLECTION_ID, savesCollectionId: import.meta.env.VITE_APPWRITE_SAVES_COLLECTION_ID, commentsCollectionId: import.meta.env.VITE_APPWRITE_COMMENTS_COLLECTION_ID, followCollectionId: import.meta.env.VITE_APPWRITE_FOLLOW_COLLECTION_ID }
export const client = new Client(); client.setProject(appwriteConfig.projectId) client.setEndpoint(appwriteConfig.url)
export const account = new Account(client); export const databases = new Databases(client); export const storage = new Storage(client); export const avatars = new Avatars(client);
environment variable is set and I have rebuild and deplyed too by clearing cache.Everyone is requesting in subdomainurl but while fetching avatar url,it using http:<my public ip>
Before you call avatars.getInitials() can you log avatars.client.config?
And can you confirm which Appwrite SDK you're using and what version?
I need some time
Recommended threads
- Function execution queue is "Clogged"
Hello, I made the very stupid mistake of creating a function that executes itself every time it fails. Naturally it failed a lot. Now, I can't execute any other...
- server error 500
Hey everyone, I am facing an issue in one of my applications where trying to create the mfachallenge fails with the below error: { "message": "Server Error",...
- Failed to create new project after creat...
Hey warap ya'll. Hope everyone is doing great. I can seem to create a new project from a new account. I have tried on 2 different accounts and its the same thin...