question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'Server' object has no attribute 'task'

See original GitHub issue

I am trying to run a asynchronous webserver using microdot libraries microdot.py and microdot_asyncio.py and came across the following error:

Traceback (most recent call last): File "<stdin>", line 40, in <module> File "uasyncio/core.py", line 1, in run File "uasyncio/core.py", line 1, in run_until_complete File "uasyncio/core.py", line 1, in run_until_complete File "<stdin>", line 37, in main File "microdot_asyncio.py", line 165, in start_server File "uasyncio/stream.py", line 1, in wait_closed AttributeError: 'Server' object has no attribute 'task'

Does it have to do with my asyncio version? I am running MicroPython v1.15 with the microdot files frozen into a custom build. Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
miguelgrinbergcommented, Jun 7, 2021

@dpgeorge Sure. While I was debugging this yesterday I came up with a fix as well, so I have created a PR: https://github.com/micropython/micropython/pull/7365.

0reactions
dpgeorgecommented, Jun 7, 2021

You can’t basically call server.wait_closed() too soon after calling create_server(). Sometimes you may get lucky and everything works, other times, wait_closed() tries to access attributes of the server object that haven’t been created yet.

That does sound like a bug in uasyncio, which should probably be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'Server' object has no attribute 'services'
Solved: Greetings, I used the ESRI Python code to get a list of Services. URL: arcgis.gis.server module — arcgis 1.8.5 documentation Using ...
Read more >
Server' object has no attribute 'serve_forever · Issue #4 - GitHub
Hello! I am running a python example.py application and get an error AttributeError: 'Server' object has no attribute 'serve_forever'.
Read more >
Starting Celery: AttributeError: 'module' object has no attribute ...
I forgot to create a celery object in tasks.py: from celery import Celery from celery import task celery = Celery('tasks', ...
Read more >
When using the S3Upload task from the task library, I'm getting ...
When using the S3Upload task from the task library, I'm getting an error: "AttributeError: 'str' object has no attribute 'bucket'" - how to...
Read more >
AttributeError: 'Server' object has no attribute 'volumes'
The issue seems related to bad ownership. The volume attached to the VM was owned by a different project. Then the member of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found