P
Postizβ€’2mo ago
Support

Ticket: Facebook App-ID Error During Instagram Channel Setup

@Peter Just created a ticket
Question: I'm trying to setup the Instagram provider. But if I want to 'add the channel' in the frontend Facebook gives an error that the provided app-id does not exist. In the url it also has 'clientId=undefined'.
Attempted: I've checked .env and postiz.env to see if the App ID and Secret are in there. They are. If I connect to the docker container and cat the .env I also see the correct data. Cloudflare is correctly setup. I don't see what I'm doing wrong. Or discovered a bug? But I also can't find anyone else with the same issue.
Working On: I run on Coolify with docker-compose.
Take it from here @Postiz
17 Replies
Nevo David
Nevo Davidβ€’2mo ago
I think in Docker compose you have to add the variable into the docker-compose @Peter
Peter
Peterβ€’2mo ago
I'll give it a go! Thanks! In my compose:
environment:
INSTAGRAM_APP_ID: '123124872364872364'
INSTAGRAM_APP_SECRET: 'csdjf983rgfh8dfha8ds'
environment:
INSTAGRAM_APP_ID: '123124872364872364'
INSTAGRAM_APP_SECRET: 'csdjf983rgfh8dfha8ds'
But get same result unfortunately.
zac_goose
zac_gooseβ€’2mo ago
try it with double quotes example environment: MAIN_URL: "https://postiz.test.com" FRONTEND_URL: "https://postiz.test.com" you also need to make sure your mounting the /config/ directory into the contaier
Peter
Peterβ€’2mo ago
Double quotes don't make a difference.. I connected to the running container and if I cat the .env file, everything is there (with double quotes). If I check the volume there is a file called postiz.env and that contains also the correct data (also with double quotes).
xcons
xconsβ€’2mo ago
Heya, nah it's not the quotes You've got too many spaces in there 4 spaces, instead of 2 You should generally use environment variables in your docker compose, OR a static .env file, not both
Peter
Peterβ€’2mo ago
That's the formatting of Discord.. In the files there are just 2 spaces πŸ™‚
xcons
xconsβ€’2mo ago
environment:
foo: "bar"
environment:
foo: "bar"
don't think so πŸ˜› So, postiz.env is a file you create yourself The alternative is setting enviromment variables in your compose
Peter
Peterβ€’2mo ago
What is the order of that the config are read? So is postiz.env the last one it takes in? Is that the one that get's to be the .env in the running container?
xcons
xconsβ€’2mo ago
I've not actually tested @Peter , but I believe it would be container env variables, then .env, then postiz.env last - logically that should be the order, but that's why I recommend keeping everything in the compose file.
Peter
Peterβ€’2mo ago
So I've renamed postiz.env to postiz.env.bak, so that one can't be used. I've moved everything to the compose file:
services:
postiz:
image: 'ghcr.io/gitroomhq/postiz-app:latest'
container_name: postiz
restart: always
environment:
MAIN_URL: "https://domain.name"
FRONTEND_URL: "https://domain.name"
NEXT_PUBLIC_BACKEND_URL: "https://domain.name/api"
JWT_SECRET: "somethingrandom"
DATABASE_URL: 'postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local'
REDIS_URL: "redis://postiz-redis:6379"
BACKEND_INTERNAL_URL: "http://localhost:3000"
IS_GENERAL: "true"
STORAGE_PROVIDER: local
UPLOAD_DIRECTORY: /uploads
NEXT_PUBLIC_UPLOAD_DIRECTORY: /uploads
INSTAGRAM_APP_ID: "theappid"
INSTAGRAM_APP_SECRET: "theappsecrete"
CLOUDFLARE_ACCOUNT_ID: "cloudflareaccountid"
CLOUDFLARE_ACCESS_KEY: "cloudflareaccesskey"
CLOUDFLARE_SECRET_ACCESS_KEY: "cloudflaresecret"
CLOUDFLARE_BUCKETNAME: "postiz"
CLOUDFLARE_BUCKET_URL: "https://bucketid.r2.cloudflarestorage.com"
CLOUDFLARE_REGION: "auto"
services:
postiz:
image: 'ghcr.io/gitroomhq/postiz-app:latest'
container_name: postiz
restart: always
environment:
MAIN_URL: "https://domain.name"
FRONTEND_URL: "https://domain.name"
NEXT_PUBLIC_BACKEND_URL: "https://domain.name/api"
JWT_SECRET: "somethingrandom"
DATABASE_URL: 'postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local'
REDIS_URL: "redis://postiz-redis:6379"
BACKEND_INTERNAL_URL: "http://localhost:3000"
IS_GENERAL: "true"
STORAGE_PROVIDER: local
UPLOAD_DIRECTORY: /uploads
NEXT_PUBLIC_UPLOAD_DIRECTORY: /uploads
INSTAGRAM_APP_ID: "theappid"
INSTAGRAM_APP_SECRET: "theappsecrete"
CLOUDFLARE_ACCOUNT_ID: "cloudflareaccountid"
CLOUDFLARE_ACCESS_KEY: "cloudflareaccesskey"
CLOUDFLARE_SECRET_ACCESS_KEY: "cloudflaresecret"
CLOUDFLARE_BUCKETNAME: "postiz"
CLOUDFLARE_BUCKET_URL: "https://bucketid.r2.cloudflarestorage.com"
CLOUDFLARE_REGION: "auto"
Is this correct? Or am I missing something?
xcons
xconsβ€’2mo ago
That's looking good, you can certainly remove the Cloudflare details though Because you have STORAGE_PROVIDER: "local" Have you tried running postiz with that config?
Peter
Peterβ€’2mo ago
Tried both actually, no dice 🎲 Unfortunately..
xcons
xconsβ€’2mo ago
@Peter , okay dokey, but help me to help you - is there sn error message or problem you're getting instead? If there is an error message I can work out what's wrong
Peter
Peterβ€’2mo ago
That's what I'm trying to find, the container logs just tells me everything is happy:
2024-11-05T07:49:25.721383727Z [Nest] 176 - 11/05/2024, 7:49:25 AM LOG Configuration check completed without any issues.
2024-11-05T07:49:25.721453739Z [Nest] 176 - 11/05/2024, 7:49:25 AM LOG πŸš€ Backend is running on: http://localhost:3000
2024-11-05T07:49:30.725597456Z 2024-11-05 07:49:30,725 INFO success: backend entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
2024-11-05T07:49:25.721383727Z [Nest] 176 - 11/05/2024, 7:49:25 AM LOG Configuration check completed without any issues.
2024-11-05T07:49:25.721453739Z [Nest] 176 - 11/05/2024, 7:49:25 AM LOG πŸš€ Backend is running on: http://localhost:3000
2024-11-05T07:49:30.725597456Z 2024-11-05 07:49:30,725 INFO success: backend entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
xcons
xconsβ€’2mo ago
Okay, and so you're getting an erorr trying to connect Facebook still?
Peter
Peterβ€’2mo ago
Yeah, still have the undefined as clientId.. So Facebook gives the error that the app doesn't exist, which makes sense So I started with a completely clean slate. Removed everything and have only Instagram APPID and SECRET in the docker-compose file. But still same result. Am I missing a config somewhere? Is there a way to see which config values are loaded and being used? Got it to work! Seems you have to setup FACEBOOK_APP_ID/SECRET in Docker environment. INSTAGRAM_APP_ID/SECRET are not used. Quotes/doublequotes are not required for it to work btw. But it works now! Thanks for the help!
xcons
xconsβ€’2mo ago
Ok, yep, you do need the env vars to be set πŸ™‚ glad it's all good now
Want results from more Discord servers?
Add your server