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

greengrass discovery throwing bytestream issue #295

Closed
manasir66 opened this issue Sep 23, 2021 · 3 comments · Fixed by #302
Closed

greengrass discovery throwing bytestream issue #295

manasir66 opened this issue Sep 23, 2021 · 3 comments · Fixed by #302
Assignees
Labels
bug This issue is a bug. pending-release This issue will be fixed by an approved PR that hasn't been released yet.

Comments

@manasir66
Copy link

manasir66 commented Sep 23, 2021

Hi,

I am running into a TypeError when calling the discover() function from DiscoverInfoProvider module.

Below is the my code snippet (following the example in the documentation) and the error encountered.

from AWSIoTPythonSDK.core.greengrass.discovery.providers import DiscoveryInfoProvider
rootCAPath = "<path_to_file>"
certificatePath = "<path_to_file>"
privateKeyPath = "<path_to_file>"
host = "<IoTHost>"
thingName = "name"

discoveryInfoProvider = DiscoveryInfoProvider()
discoveryInfoProvider.configureEndpoint(host)
discoveryInfoProvider.configureCredentials(rootCAPath, certificatePath, privateKeyPath)

#Error causing line
discoveryInfo = discoveryInfoProvider.discover(thingName)

This is the error :

'Traceback (most recent call last):
  File "/inference/discover.py", line 37, in <module>
    discoveryInfo = discoveryInfoProvider.discover(thingName)
  File "/inference/AWSIoTPythonSDK/core/greengrass/discovery/providers.py", line 230, in discover
    status_code, response_body = self._receive_discovery_response(ssl_sock)
  File "/inference/AWSIoTPythonSDK/core/greengrass/discovery/providers.py", line 356, in _receive_discovery_response
    rc1, response_header = self._receive_until(ssl_sock, self._got_two_crlfs)
  File "/inference/AWSIoTPythonSDK/core/greengrass/discovery/providers.py", line 371, in _receive_until
    response.append(self._convert_to_int_py3(ssl_sock.read(1)))
**TypeError: 'bytes' object cannot be interpreted as an integer'**
@jmklix jmklix self-assigned this Sep 29, 2021
@jmklix jmklix added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 29, 2021
@KaibaLopez KaibaLopez removed the needs-triage This issue or PR still needs to be triaged. label Nov 12, 2021
@jmklix
Copy link
Member

jmklix commented Jan 26, 2022

How often are you getting this error?

@jmklix jmklix added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Jan 26, 2022
@jmklix
Copy link
Member

jmklix commented Feb 17, 2022

Thanks for pointing this out. This sdk was incorrectly using append when using a bytearray when it should be using extend. I have created a PR for this. Sorry this has taken a long time.

@jmklix jmklix added pending-release This issue will be fixed by an approved PR that hasn't been released yet. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 17, 2022
@jmklix jmklix linked a pull request Feb 17, 2022 that will close this issue
@github-actions
Copy link

github-actions bot commented Mar 3, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. pending-release This issue will be fixed by an approved PR that hasn't been released yet.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants