Skip to content

greengrass discovery throwing bytestream issue #295

Closed
@manasir66

Description

@manasir66

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'**

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.pending-releaseThis issue will be fixed by an approved PR that hasn't been released yet.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions