# Spaces Gradio app - Build error: ValueError: Cannot queue with encryption or authentication enabled

**URL:** <https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692>\
**Category:** Spaces\
**Created:** [July 21, 2022, 4:46pm UTC](https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692 "2022-07-21T16:46:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teemu](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Teemu](https://discuss.huggingface.co/u/Teemu)\
**Post date:** [July 21, 2022, 4:46pm UTC](https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692/1 "2022-07-21T16:46:19Z")

</div>

Hi!

I created a fully working local Gradio app with authentication, using environmental variables for the API keys from OpenAI GPT-3. Once I replicate the app in the Spaces, the app build returns error:  
“ValueError: Cannot queue with encryption or authentication enabled.” The app runs fine, if I remove the authentication from the launch-method.

My app uses a login function to pass in the launch-method: “launch(auth=login)” and it works perfectly in my local Gradio app, but not in the Spaces. I know the environmental variables are passed correctly from Spaces settings, as the API works fine without the authentication.

Is there a way to overcome this issue with the authentication?

I understand the Spaces is meant for open collaboration, so I tend to understand the authentication is less relevant. However, I wonder if there is anyway of implementing user authentication, since it is a working feature in the Gradio.

The main point for me is to know, if user authentication is possible / works in Spaces, so I could implement this “best practices” from OpenAI API.

Thanks,

---

<div class="post-metadata">

**Author:** ![osanseviero](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/osanseviero/32/38738_2.png) [@osanseviero](https://discuss.huggingface.co/u/osanseviero)\
**Post date:** [July 24, 2022, 8:51am UTC](https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692/2 "2022-07-24T08:51:53Z")

</div>

Hey there! You can set `enable_queue=False` to disable the queue. It’s enabled by default in Spaces, which would explain why this issue is popping up in Spaces but not locally.

cc @abidlabs @freddyaboulton

---

<div class="post-metadata">

**Author:** ![kenndanielso](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/kenndanielso/32/12431_2.png) [@kenndanielso](https://discuss.huggingface.co/u/kenndanielso)\
**Post date:** [November 6, 2022, 8:01am UTC](https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692/3 "2022-11-06T08:01:10Z")

</div>

@osanseviero I set enable\_queue=False and it did load the log in interface. But its not logging in with the right credentials. It just keeps reloading the log in interface when I sign in correctly. And when I sign in incorrectly, interface will say incorrect credentials. Know how to fix this?

@Teemu did you face this problem also?

---

<div class="post-metadata">

**Author:** ![kenndanielso](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/kenndanielso/32/12431_2.png) [@kenndanielso](https://discuss.huggingface.co/u/kenndanielso)\
**Post date:** [November 6, 2022, 5:29pm UTC](https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692/4 "2022-11-06T17:29:05Z")

</div>

I don’t get this issue when launching locally. Anyone can help on what’s happening with Spaces?

---

<div class="post-metadata">

**Author:** ![freddyaboulton](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/freddyaboulton/32/32732_2.png) [@freddyaboulton](https://discuss.huggingface.co/u/freddyaboulton)\
**Post date:** [November 6, 2022, 6:08pm UTC](https://discuss.huggingface.co/t/spaces-gradio-app-build-error-valueerror-cannot-queue-with-encryption-or-authentication-enabled/20692/5 "2022-11-06T18:08:54Z")

</div>

Hi @kenndanielso ! Sorry for the trouble. I think the problem is with hugging face spaces and not your particular demo. Will take a look this week.
