Ticket: Unable to Add Provider, Connection Issue
@Auxaldeus Just created a ticket
Question: Unable to add X provider: Could not connect to the platform
Attempted: Tried it using tweepy python script and it works with the following: X_API_KEY=CONSUMER_KKEY X_API_SECRET=CONSUMER_SECRET
Working On: Setup
Take it from here @Mod 🔥
Question: Unable to add X provider: Could not connect to the platform
Attempted: Tried it using tweepy python script and it works with the following: X_API_KEY=CONSUMER_KKEY X_API_SECRET=CONSUMER_SECRET
Working On: Setup
Take it from here @Mod 🔥
64 Replies
I also tried setting
X_CLIENT
to OAUTH2.0 CLIENT ID
and X_SECRET
to OAUTH2.0 CLIENT SECRET
Self Hosting btw@Mod 🔥 please help @Auxaldeus
sup
api key and secret is not consumer key and consumer secret,
you need client id and client secret
it's not the same things
Can you clarify? I followed the instruction from here
Click on "Regenerate" inside "Consumer Keys" and copy the API Key and API Key Secret. Open .env file and add the following:
X_API_KEY=""
X_API_SECRET=""
the env file I'm editing from:
/var/lib/docker/volumes/socials_postiz-config/_data/postiz.env
Do you see this section? @Auxaldeus
yes
BTW, what did you put in: "Callback URI / Redirect URL" ?
http://localhost:4200/integrations/social/x
What do you have in
So this is supposed to be set to
X_API_KEY
and X_API_SECRET
?Yes
it's not what you used?
yes and left
X_CLIENT="" X_SECRET=""
blank
Mind you it is running behind this nginx config:@Nevo David I think the docs need to be updated, it still references
Twitter v1 API
And says that the consumer keys not the
OAuth 2.0 Client ID and Client Secret
have to be there@Nevo David perhaps twitter-api-v2 needs to be updated to 1.18: https://github.com/PLhery/node-twitter-api-v2/pull/532
GitHub
update domain from twitter.com to x.com by melvinmcrn · Pull Reques...
This PR is based on Elon's tweet: https://x.com/elonmusk/status/1791351500217754008
Please help review @PLhery
I get
Could not connect to the platform
https://postiz.example.com/api/integrations/social/x
returns: {"err":true}
my config file
values are set with:
OAuth 2.0 Client ID and Client Secret
fromthere are also no other logs printed in:
docker logs postiz --follow
Did you manage to connect other platforms?
Problem might not be with X
Do you have access to the code?
You can console log the error
Code in the container or clone the repo?
I mean any, it's just this line.
You can console.log(err)
see what is the problem
interesting, so it works when I run it locally using npm run dev
but not in the docker container
Need to console log the err
probably failing on something else
my suspicions is the uploading
yeah just can't figure out how to run the console.log(err); in the docker container. Can't find
postiz-app/apps/backend/src/api/routes/integrations.controller.ts
The problem is with your uploading, do you use local or cloudflare?
local
ok, are you sure it's creating the volume?
Wait, the error is after the redirect
or before?
yep:
before. clicking on facebook page redirects to facebook
X fails to even redirect
and is actually the only one that fails to redirect
it also doesn't redirect if I leave X_API and XSECRET empty whereas the other ones redirect while they're empty
Here's the log on the dev version when the X env variables are empty:
i do also get this warning in docker logs:
however I have storage set to local
Added random cloudflare ids and it didnt make a difference
any ideas?
can you upload the dockerfile used to build it? that way I can add logging and build the container locally, see if the issue still occurs
@Nevo David or does it use the dockerfile.dev one?
I am not sure @xcons created the docker file we will need to wait for his answer
I am having the same issues right now
clicking on X doesn't redirect to the X auth page instead says Could not connect to the platform
@Nevo David should I open an issue on github?
Hey, I have created one here yesterday: https://github.com/gitroomhq/postiz-app/issues/374
GitHub
Could not connect to the platform when trying to connect X · Issue ...
📜 Description I get the following error when clicking on X icon to connect my X: Could not connect to the platform I have provided my API key and Secret in the .env file. And I have restarted the c...
hey @Auxaldeus, adding my domain to x redirect url instead of localhost worked for me
hmm really?
wow you're right
maybe that should be made clear in the docs?
@Nevo David anyway to have multiple X accounts under a single self hosted server?
honestly it surprised me to read they have advised to add localhost redirect url but I thought I am skill issuing so gave it a try
yeah I thought so too, for some reason I thought it would interact with docker backend as I gave it the benefit of the doubt
glad it works now tho
thanks
I think we should be able to connect to multiple accounts since we have created oauth flow
But I am also getting an error when I try to add another account
I stand corrected
Nevo posted this in another thread
wait a minute
but the 1500 @Nevo David post limit on the free version is for the app not per account
did you find a way to connect multiple X accounts? I am getting this error
Can you elaborate on it?
In what stage you got it
Hey
I was able to connect my first X account (from which the developer account was created)
When I switch account and connect from Postiz
It shows the above error
Mmmm... let me see one moment
Let me put all the details from my account
The other account you are trying to connect, is it new?
https://devcommunity.x.com/t/whoa-there-the-request-token-for-this-page-is-invalid-it-may-have-already-been-used-or-expired-because-it-is-too-old-please-go-back-to-the-site-or-application-that-sent-you-here-and-try-again-it-was-probably-just-a-mistake/983/21?page=2
It's 10 months old
All the settings seems similar to mine
Maybe it's a caching problem, can you maybe try incognito?
ok let me try
Cool, it worked
Thank you so much
@nithur @Auxaldeus you have a mixed support ticket, can I close it?
Yes, I have resolved my issues
Yeah
Hi @Auxaldeus this thread is closed for now, please open a new one if you need more help