Back

[SOLVED] Getting "general_phone_disabled" even though _APP_SMS_PROVIDER is provided in .env

  • 0
  • General
  • Flutter
  • Accounts
PoojaBhaumik
20 Mar, 2023, 08:41

I'm integrating with Twilio and have added the sms provider string and sms from number in the .env file, restarted the instance multiple number of times and yet I'm getting the error from my Flutter client app

AppwriteException: general_phone_disabled, Phone provider not configured (503)

Code to trigger the call: final models.Token token = await account.createPhoneSession( userId: ID.unique(), phone: '+91xxxxxxxx' );

Even the appwrite-worker-messaging container is running fine (screenshot attached)

Is there anything else I need to do in my client project instead?

TL;DR
The user is getting an "general_phone_disabled" error even though they have provided the _APP_SMS_PROVIDER in their .env file. The solution is to recreate the containers after making changes to the .env file. Restarting the containers from the Docker GUI won't apply the changes. They need to use "docker compose down" to stop the containers and then "docker compose up -d" to start them again.
Meldiron
20 Mar, 2023, 09:25

Hey there 👋 After changes to .env, Appwrite needs to be restarted. Stop with docker compose down and start with docker compose up -d. That should apply your changes to .env, and allow phone sessions. Please let me know if this works for you

PoojaBhaumik
20 Mar, 2023, 10:33

yess! it worked! I didn't realize that restarting the container from the Docker GUI doesnt really do much. Thanks for the quick solution though!

Drake
20 Mar, 2023, 13:42

Fyi, restarting the containers won't apply environment variables changes. They need to be recreated. docker compose down will remove the containers, so that docker compose up -d can recreate them.

joeyouss
24 Mar, 2023, 18:46

[SOLVED] Getting "general_phone_disabled" even though _APP_SMS_PROVIDER is provided in .env

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more