# Internal server error / bool not iterable

**URL:** <https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494>\
**Category:** Beginners\
**Created:** [April 8, 2025, 7:40pm UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494 "2025-04-08T19:40:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![charliebaby2023](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/charliebaby2023/32/32137_2.png) [@charliebaby2023](https://discuss.huggingface.co/u/charliebaby2023)\
**Post date:** [April 8, 2025, 7:40pm UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/1 "2025-04-08T19:40:44Z")

</div>

Am i the only one getting “internal sever error” pasted on my screen after updating spaces?

Seems to have been working fine 12 hours ago (despite significant rise in compile time)

I believe i can edit and update specific previous existing spaces of mine  
Yet cannot in others (which do work fine until i attempt to modify and update them)

Is anyone able to confirm current internal server error ing, before i start mangling my spaces in unnecessary edits

Attempting to duplicate working spaces results in

Internal server error

Then Logs show

Exception in ASGI application  
If “const” in schema:  
Type error, argument of type “bool” is not itterable

Somehow, i managed to duplicate one of my working spaces  
Running a debug report showed

[Api.huggingface.co/hf-inference/models/user/model-name](http://Api.huggingface.co/hf-inference/models/user/model-name) 404

But see, hf-inference isn’t the correct address

[Huggingface.co/api/models](http://Huggingface.co/api/models) is, right?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 9, 2025, 4:06am UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/2 "2025-04-09T04:06:52Z")

</div>

> Exception in ASGI application  
> If “const” in schema:  
> Type error, argument of type “bool” is not itterable

If the cause is something else, we should investigate again, but since the message is very similar to this error, it may be possible to avoid it by specifying the version of pydantic.

> [@Error : No API Found](https://discuss.huggingface.co/t/error-no-api-found/146226):
>
> Hi, I have built a Gemini 2.0 flash based photo editing app with gradio ui. This app is running perfectly fine on my local system, but when I am trying to run it on spaces it is giving me Error : No API Found. I have used gemini api keys in secrects Code : [https://huggingface.co/spaces/Saurabh502/Gemini-photo/resolve/main/app.py](https://huggingface.co/spaces/Saurabh502/Gemini-photo/resolve/main/app.py) Please let me know your thoughts, on how to resolve this. Thanks

> [@Agent Course - First Agent Template](https://discuss.huggingface.co/t/agent-course-first-agent-template/148170):
>
> After duplicating the space [First Agent Template - a Hugging Face Space by agents-course](https://huggingface.co/spaces/agents-course/First_agent_template), I get this blocking exception at startup: File “/usr/local/lib/python3.10/site-packages/gradio\_client/utils.py”, line 898, in get\_type if “const” in schema: TypeError: argument of type ‘bool’ is not iterable Do you have any idea what might be causing this error during startup?

---

<div class="post-metadata">

**Author:** ![hlyangster](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hlyangster/32/39685_2.png) [@hlyangster](https://discuss.huggingface.co/u/hlyangster)\
**Post date:** [April 9, 2025, 5:49am UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/3 "2025-04-09T05:49:21Z")

</div>

me too, I tried to debug my SRT-transcribe ptoject for hours.  
It’s said there’s a wrong attribute “proxies” used in my projects.  
However, I searched every code line but found nothing named “proxies”.  
After I paid to be a pro role, and opne the DEV mode.  
I saw “503” (internal server error). man… that’s a waste of time and money..

---

<div class="post-metadata">

**Author:** ![charliebaby2023](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/charliebaby2023/32/32137_2.png) [@charliebaby2023](https://discuss.huggingface.co/u/charliebaby2023)\
**Post date:** [April 9, 2025, 7:59am UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/4 "2025-04-09T07:59:26Z")

</div>

i think,  
the problem was that i was using a modified gr\_interface\_load  
instead of gr.interface.load  
i was able to get the spaces running after changing that but still problems just cascaded from there

As usual

a MONTH and a HALF of this \*\*\*\*\*  
huggingface BY FAR, has been THE WORST online experience of my entire life  
(seriously, i cannot think of a single experience, site this bad  
from the lack of support (minus john, he’s everywhere answering it seems almost everyone every hour. i really think you deserve the best for all i see you do here)  
to the new unannounced DAILY problems  
to the amount of pro users ive seen questioning to complaining about the service they’ve paid for  
to the bold face lies huggingface has made about democratization  
to the bold face lies huggingface has made about addressing problems  
to the removal of serverless functions as far as i can see  
to the massing of untimely notices of inference calls

time? yeah. and right when i think ive corrected the problems i encounter  
im tossed back to square one, over and over and over

i dont think i can find the right words to express excactly how ANGRY and UPSET i am  
im trying REALLY hard at this point to remain calm and civil  
that i no longer think its healthy for my heart to continue trying to FIX ANYTHING HERE  
I should really just blame myself right? for being so foolish to try and try again  
for wasting all this time waiting for indention errors to post in my logs  
20 minutes for a single indent . please. python is one thing, but servers that cant save themselves from locking up, that says alot

and after all this, now they think they’ve earned the privilege to throw pay walls at us  
for what?

i did get the inferencing to work, now, at the peak of my exhaustion  
just to wait around about 3 minutes for that to load  
experienced even slower response times for it too (5 times slower at least)  
smh

im sorry guys, ive never had a list of complaints this long ive made public  
i know, my level of ignorance very clearly, and because of it, i have always kept my mouth shut and my nose to the grind stone, doing what i can to improve myself other than complain

but here, im seeing its pointless  
and here, and now, seeing this paywall pop up  
i have to stand up and say something

1. im sorry to subject you to this, thank you for your responses. i just imagine someone from the staff might could read this, but, i know they won’t. just us. i guess, im hoping really that john will tell me, “no charlie, you’re mistakened, try \_\_\_\_\_\_ instead” and make all my problems go away (because that, me just being ignorant would make much more sense than what i’m seeing)

2. a few weeks ago, i did look at these prices and i did think, HF, if offering what they do, could deserve some money in their pocket, but yeah  
now, after all this wasted time  
all this wasted code  
all this for nothing  
thats all ive got left to give

but yeah,  
switching from gr\_interface\_load  
to gr.interface.load  
fixed the internal server error, enough for the space to display,  
but from there, im too upset to recall where i hit a wall going down its new chain of hurdles  
maybe next week  
i just cant even look at this site anymore right now  
thank you and my apologies

---

<div class="post-metadata">

**Author:** ![hlyangster](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hlyangster/32/39685_2.png) [@hlyangster](https://discuss.huggingface.co/u/hlyangster)\
**Post date:** [April 9, 2025, 9:29am UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/5 "2025-04-09T09:29:36Z")

</div>

I feel you. I spent **three full days** trying to deploy my project on HF.  
They told me to remove the `proxy` parameter — the one I never even used.  
I checked thousands of lines, rebuilt the Space countless times, nothing worked.

In the end, it was a **dependency version conflict**. Removing all version numbers fixed it.  
I thought I won… until the build broke again.  
Why? HF was missing `wheel`. Yes — _wheel_, the most basic pip package.  
Turned out: **503 error**. Internal update. No notice.

Then I found out the real issue: `pysrt` was broken.

So yeah, you’re not alone. HF nearly broke me too.  
I just wanted to launch a demo, not go on a spiritual debugging journey.

Still recovering.  
Thanks for sharing — made me feel a little less crazy. 😃

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 9, 2025, 10:45am UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/6 "2025-04-09T10:45:21Z")

</div>

For example, I think that some of the HF staff, such as megan and lhonestq, are actively providing support on the forum, but since there aren’t many people in charge of support about Spaces or so, well, even though I’m not a staff member, I think it’s better than not having anyone…

I tried to give that space first aid for the time being.

> **[PoSD80XX - a Hugging Face Space by John6666](https://huggingface.co/spaces/John6666/Diffusion80XX-charlie)**
>
> 5.13.2 Grid jp mdlds

---

<div class="post-metadata">

**Author:** ![HyperX-Sentience](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hyperx-sentience/32/45014_2.png) [@HyperX-Sentience](https://discuss.huggingface.co/u/HyperX-Sentience)\
**Post date:** [April 9, 2025, 12:07pm UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/7 "2025-04-09T12:07:22Z")

</div>

Had this same problem in my Lora training colab notebook. Just use gradio 5.23.2 via  
!pip install gradio==5.23.2

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 9, 2025, 12:18pm UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/8 "2025-04-09T12:18:45Z")

</div>

Try

```auto
pydantic==2.10.6

```

in **requirements.txt**.

> <https://github.com/gradio-app/gradio/issues/10662>
>
> I am installing Kohya on Kaggle Guid
> 
> It gives below error can't make any sense
> …
> It looks like gradio related since entire code is about gradio
> 
> both gradio live share and local run on Kaggle gives error so i doubt related to graido live share
> 
> \`\`\`
> gradio==5.4.0
> gradio\_client==1.4.2
> fastapi==0.115.8
> uvicorn==0.34.0
> starlette==0.45.3
> anyio==3.7.1
> python 3.10.12
> \`\`\`
> 
> \`\`\`
> \* Running on local URL: http://127.0.0.1:7860/
> ERROR: Exception in ASGI application
> Traceback (most recent call last):
> File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11\_impl.py", line 403, in run\_asgi
> result = await app( # type: ignore\[func-returns-value\]
> File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy\_headers.py", line 60, in \_\_call\_\_
> return await self.app(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in \_\_call\_\_
> await super().\_\_call\_\_(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 112, in \_\_call\_\_
> await self.middleware\_stack(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 187, in \_\_call\_\_
> raise exc
> File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 165, in \_\_call\_\_
> await self.app(scope, receive, \_send)
> File "/usr/local/lib/python3.10/dist-packages/gradio/route\_utils.py", line 790, in \_\_call\_\_
> await self.app(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in \_\_call\_\_
> await wrap\_app\_handling\_exceptions(self.app, conn)(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/\_exception\_handler.py", line 53, in wrapped\_app
> raise exc
> File "/usr/local/lib/python3.10/dist-packages/starlette/\_exception\_handler.py", line 42, in wrapped\_app
> await app(scope, receive, sender)
> File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 715, in \_\_call\_\_
> await self.middleware\_stack(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 735, in app
> await route.handle(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 288, in handle
> await self.app(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 76, in app
> await wrap\_app\_handling\_exceptions(app, request)(scope, receive, send)
> File "/usr/local/lib/python3.10/dist-packages/starlette/\_exception\_handler.py", line 53, in wrapped\_app
> raise exc
> File "/usr/local/lib/python3.10/dist-packages/starlette/\_exception\_handler.py", line 42, in wrapped\_app
> await app(scope, receive, sender)
> File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 73, in app
> response = await f(request)
> File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 301, in app
> raw\_response = await run\_endpoint\_function(
> File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 214, in run\_endpoint\_function
> return await run\_in\_threadpool(dependant.call, \*\*values)
> File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 37, in run\_in\_threadpool
> return await anyio.to\_thread.run\_sync(func)
> File "/usr/local/lib/python3.10/dist-packages/anyio/to\_thread.py", line 33, in run\_sync
> return await get\_asynclib().run\_sync\_in\_worker\_thread(
> File "/usr/local/lib/python3.10/dist-packages/anyio/\_backends/\_asyncio.py", line 877, in run\_sync\_in\_worker\_thread
> return await future
> File "/usr/local/lib/python3.10/dist-packages/anyio/\_backends/\_asyncio.py", line 807, in run
> result = context.run(func, \*args)
> File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 549, in main
> gradio\_api\_info = api\_info(request)
> File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 579, in api\_info
> api\_info = utils.safe\_deepcopy(app.get\_blocks().get\_api\_info())
> File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 2982, in get\_api\_info
> python\_type = client\_utils.json\_schema\_to\_python\_type(info)
> File "/usr/local/lib/python3.10/dist-packages/gradio\_client/utils.py", line 911, in json\_schema\_to\_python\_type
> type\_ = \_json\_schema\_to\_python\_type(schema, schema.get("$defs"))
> File "/usr/local/lib/python3.10/dist-packages/gradio\_client/utils.py", line 965, in \_json\_schema\_to\_python\_type
> des = \[
> File "/usr/local/lib/python3.10/dist-packages/gradio\_client/utils.py", line 966, in \<listcomp\>
> f"{n}: {\_json\_schema\_to\_python\_type(v, defs)}{get\_desc(v)}"
> File "/usr/local/lib/python3.10/dist-packages/gradio\_client/utils.py", line 973, in \_json\_schema\_to\_python\_type
> f"str, {\_json\_schema\_to\_python\_type(schema\['additionalProperties'\], defs)}"
> File "/usr/local/lib/python3.10/dist-packages/gradio\_client/utils.py", line 919, in \_json\_schema\_to\_python\_type
> type\_ = get\_type(schema)
> File "/usr/local/lib/python3.10/dist-packages/gradio\_client/utils.py", line 880, in get\_type
> if "const" in schema:
> TypeError: argument of type 'bool' is not iterable
> ERROR: Exception in ASGI application
> \`\`\`
> 
> !\[Image\](https://github.com/user-attachments/assets/6fedd063-dc3a-4bf3-a269-33e64dd442b2)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 9, 2025, 2:11pm UTC](https://discuss.huggingface.co/t/internal-server-error-bool-not-iterable/149494/10 "2025-04-09T14:11:42Z")

</div>

Your English is not bad.

> I think pydantic is not the problem

I also think that this is not a root cause.

As you say, for example, even if you duplicate an old Gradio 4 space, the GUI is Gradio 4, but it seems that Gradio 5 or the latest version of FastAPI? is used internally, and the same crash occurs.  
I [have actually successfully avoided this with pydantic==2.10.6](https://huggingface.co/spaces/John6666/Enhance-This-HiDiffusion-SDXL-Zero-Gradio4)…

However, this is only a forced workaround for one part of the problem that is currently being displayed, and it is probably necessary to wait for a fix to be released for Gradio or FastAPI, or for the backend of HF, or for the server settings of HF.

**Adam (lunarflu)** announced a few days ago that **the Hugging Face team is currently investigating this 500 error**.

Incidentally, the same phenomenon has been reported for Google’s API libraries, not just Gradio.
