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

Not parsing the RABBIT_PORT env. variable correctly. #3

Open
arcseldon opened this issue Mar 15, 2019 · 1 comment
Open

Not parsing the RABBIT_PORT env. variable correctly. #3

arcseldon opened this issue Mar 15, 2019 · 1 comment

Comments

@arcseldon
Copy link

Hi, I cloned and ran the docker-compose up command - which eventually led to this stacktrace:


gateway_1   | Traceback (most recent call last):
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 42, in __get__
gateway_1   |     return obj.__dict__[self.__name__]
gateway_1   | KeyError: 'channel_errors'
gateway_1   |
gateway_1   | During handling of the above exception, another exception occurred:
gateway_1   |
gateway_1   | Traceback (most recent call last):
gateway_1   |   File "/usr/local/bin/nameko", line 10, in <module>
gateway_1   |     sys.exit(main())
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/main.py", line 107, in main
gateway_1   |     args.main(args)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/commands.py", line 110, in main
gateway_1   |     main(args)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/run.py", line 184, in main
gateway_1   |     run(services, config, backdoor_port=args.backdoor_port)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/run.py", line 119, in run
gateway_1   |     service_runner.add_service(service_cls)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/runners.py", line 51, in add_service
gateway_1   |     container = self.container_cls(cls, self.config)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/containers.py", line 152, in __init__
gateway_1   |     self.subextensions.update(iter_extensions(bound))
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/extensions.py", line 358, in iter_extensions
gateway_1   |     for item in iter_extensions(ext):
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/extensions.py", line 358, in iter_extensions
gateway_1   |     for item in iter_extensions(ext):
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/extensions.py", line 357, in iter_extensions
gateway_1   |     for _, ext in inspect.getmembers(extension, is_extension):
gateway_1   |   File "/usr/local/lib/python3.7/inspect.py", line 341, in getmembers
gateway_1   |     value = getattr(object, key)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 44, in __get__
gateway_1   |     value = obj.__dict__[self.__name__] = self.__get(obj)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/kombu/mixins.py", line 247, in channel_errors
gateway_1   |     return self.connection.channel_errors
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/nameko/messaging.py", line 361, in connection
gateway_1   |     ssl=ssl
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/kombu/connection.py", line 189, in __init__
gateway_1   |     url_params = parse_url(hostname)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/url.py", line 47, in parse_url
gateway_1   |     scheme, host, port, user, password, path, query = _parse_url(url)
gateway_1   |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/url.py", line 81, in url_to_parts
gateway_1   |     parts.port,
gateway_1   |   File "/usr/local/lib/python3.7/urllib/parse.py", line 169, in port
gateway_1   |     port = int(port, 10)
gateway_1   | ValueError: invalid literal for int() with base 10: '${RABBIT_PORT}'
airports_1  | Traceback (most recent call last):
airports_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 42, in __get__
airports_1  |     return obj.__dict__[self.__name__]
airports_1  | KeyError: 'channel_errors'
airports_1  |
airports_1  | During handling of the above exception, another exception occurred:
airports_1  |
airports_1  | Traceback (most recent call last):
airports_1  |   File "/usr/local/bin/nameko", line 10, in <module>
airports_1  |     sys.exit(main())
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/main.py", line 107, in main
airports_1  |     args.main(args)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/commands.py", line 110, in main
airports_1  |     main(args)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/run.py", line 184, in main
airports_1  |     run(services, config, backdoor_port=args.backdoor_port)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/cli/run.py", line 119, in run
airports_1  |     service_runner.add_service(service_cls)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/runners.py", line 51, in add_service
airports_1  |     container = self.container_cls(cls, self.config)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/containers.py", line 159, in __init__
airports_1  |     self.subextensions.update(iter_extensions(bound))
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/extensions.py", line 358, in iter_extensions
airports_1  |     for item in iter_extensions(ext):
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/extensions.py", line 358, in iter_extensions
airports_1  |     for item in iter_extensions(ext):
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/extensions.py", line 357, in iter_extensions
airports_1  |     for _, ext in inspect.getmembers(extension, is_extension):
airports_1  |   File "/usr/local/lib/python3.7/inspect.py", line 341, in getmembers
airports_1  |     value = getattr(object, key)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/objects.py", line 44, in __get__
airports_1  |     value = obj.__dict__[self.__name__] = self.__get(obj)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/mixins.py", line 247, in channel_errors
airports_1  |     return self.connection.channel_errors
airports_1  |   File "/usr/local/lib/python3.7/site-packages/nameko/messaging.py", line 361, in connection
airports_1  |     ssl=ssl
airports_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/connection.py", line 189, in __init__
airports_1  |     url_params = parse_url(hostname)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/url.py", line 47, in parse_url
airports_1  |     scheme, host, port, user, password, path, query = _parse_url(url)
airports_1  |   File "/usr/local/lib/python3.7/site-packages/kombu/utils/url.py", line 81, in url_to_parts
airports_1  |     parts.port,
airports_1  |   File "/usr/local/lib/python3.7/urllib/parse.py", line 169, in port
airports_1  |     port = int(port, 10)
airports_1  | ValueError: invalid literal for int() with base 10: '${RABBIT_PORT}'

Something has changed in later versions of python/nameko/dependencies? (A local quick fix is a search/replace of env variable names with hard-coded values).

Fixing the above, then airport service works, but trips service errors:

curl -i -d "{\"airport_from\": \"f2bddf0e506145f6ba0c28c247c54629\", \"airport_to\": \"565000adcc774cfda8ca3a806baec6b5\"}" localhost:8000/trip
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: text/plain; charset=utf-8
Content-Length: 104
Date: Fri, 15 Mar 2019 00:22:31 GMT

Error: RemoteError: DataError Invalid input of type: 'dict'. Convert to a byte, string or number first.
mervynsimzr added a commit to mervynsimzr/nameko-microservices that referenced this issue Oct 26, 2019
gpkc added a commit that referenced this issue Oct 26, 2019
@gpkc
Copy link
Owner

gpkc commented Oct 26, 2019

@arcseldon A PR was opened by @mervynsimzr that fixes this issue. You might want to test again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants