Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error assembling blockwise response, passing on error NotImplemented() #55

Closed
gcerar opened this issue Jan 10, 2017 · 5 comments
Closed

Comments

@gcerar
Copy link

gcerar commented Jan 10, 2017

Reading from /.well-known/core on contiki (v2.7) device raises error.NotImplemented(). My guess is that something around block2 is not implemented.

Error assembling blockwise response, passing on error NotImplemented()

Traceback (most recent call last):
File "aiocoap_examples.py", line 31, in <module>
    asyncio.get_event_loop().run_until_complete(main())
File "/usr/lib64/python3.5/asyncio/base_events.py", line 387, in run_until_complete
    return future.result()
File "/usr/lib64/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
File "/usr/lib64/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
File "aiocoap_examples.py", line 21, in main
    response = await protocol.request(request).response
File "/usr/lib64/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
File "/usr/lib64/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
File "/usr/lib64/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
File "/home/gcerar/workspace/logatec2-tools/env35/lib64/python3.5/site-packages/aiocoap/protocol.py", line 742, in process_block2_in_response
    self._assembled_response._append_response_block(response)
File "/home/gcerar/workspace/logatec2-tools/env35/lib64/python3.5/site-packages/aiocoap/message.py", line 257, in _append_response_block
    raise error.NotImplemented()
aiocoap.error.NotImplemented

Code where this raises:

import aiocoap as coap
import asyncio

# skipped config of address and port
async def main():
    uri = 'coap://[{}]:{}/.well-known/core'.format(address, port)

    protocol = await coap.Context.create_client_context()
    request = coap.Message(code=coap.GET, uri=uri)

    try:
        response = await protocol.request(request).response
    except Exception as e:
        print(e)
        raise
    else:
        print('Result: %s\n%r' % (response.code, response.payload))

if __name__ == '__main__':
    asyncio.get_event_loop().run_until_complete(main())
@chrysn
Copy link
Owner

chrysn commented Jan 10, 2017 via email

@gcerar
Copy link
Author

gcerar commented Jan 11, 2017

Nodes are not in public network. Inside institute I don't have permissions to change that. Security is very tight here. I have sent you on an email tcpdumps of working comm (Firefox's Copper) and non working comm (aiocoap) right before it enters contiki sensor network. Hope it helps.

@chrysn
Copy link
Owner

chrysn commented Jan 11, 2017 via email

@gcerar
Copy link
Author

gcerar commented Jan 12, 2017

After few exchanged emails with @chrysn, we figured out that issue is on server side. There is a bug at advertising Block2 as @chrysn mentioned. He even gratefully suggested workaround in aiocoap. Until this is fixed, workaround will be kept at my fork, "contiki27-workaround" branch.

Issue can now be closed.

@gcerar gcerar closed this as completed Jan 12, 2017
@chrysn
Copy link
Owner

chrysn commented Jan 12, 2017

Re-opening because aiocoap did not properly report the issue at the first corrupt message but gave a mislieading error description at a later message.

@chrysn chrysn reopened this Jan 12, 2017
@chrysn chrysn closed this as completed in bcd1358 Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants