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

agent segfaults when instantating boto3 #1276

Open
yrobla opened this issue Dec 23, 2024 · 1 comment
Open

agent segfaults when instantating boto3 #1276

yrobla opened this issue Dec 23, 2024 · 1 comment

Comments

@yrobla
Copy link

yrobla commented Dec 23, 2024

I try to monitor an async app using newrelic agent. When i run it, it segfaults on one of the classes of the app, that instantiates boto3:

this is the sample code:

if __name__ == "__main__":
    conf = Config()
    if conf.new_relic_license_key and conf.new_relic_app_name:
        telemetry.initialize_new_relic(
            license_key=conf.new_relic_license_key, app_name=conf.new_relic_app_name
        )

    asyncio.run(main())
    
 @newrelic.agent.background_task()
async def main() -> None:
    conf = Config()
    await setup_database(database_url=conf.database_url)
    store = Store(db_url=conf.database_url)
    downloader = Downloader()
    
    
 class Downloader:
    def __init__(self) -> None:
        self.s3 = boto3.client("s3")

then it segfaults with:

Thread 0x00000001e5bfb240 (most recent call first):
  File "/Users/yolanda/.pyenv/versions/3.10.15/lib/python3.10/genericpath.py", line 30 in isfile
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/loaders.py", line 168 in exists
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/loaders.py", line 317 in list_available_services
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/loaders.py", line 143 in _wrapper
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/loaders.py", line 407 in load_service_model
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/loaders.py", line 143 in _wrapper
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/client.py", line 239 in _load_service_model
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/client.py", line 132 in create_client
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/botocore/session.py", line 997 in create_client
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/boto3/session.py", line 297 in client
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/boto3/__init__.py", line 92 in client
  
  File "/Users/yolanda/development/muse/python/cmd/chat-core/src/file_downloader/downloader.py", line 65 in __init__
  File "/Users/yolanda/development/muse/python/cmd/chat-core/./src/chat_core/__main__.py", line 32 in main
  File "/Users/yolanda/Library/Caches/pypoetry/virtualenvs/chat-core-ejsR8P4g-py3.10/lib/python3.10/site-packages/newrelic/common/async_proxy.py", line 119 in send
  File "/Users/yolanda/.pyenv/versions/3.10.15/lib/python3.10/asyncio/events.py", line 80 in _run
  File "/Users/yolanda/.pyenv/versions/3.10.15/lib/python3.10/asyncio/base_events.py", line 1909 in _run_once
  File "/Users/yolanda/.pyenv/versions/3.10.15/lib/python3.10/asyncio/base_events.py", line 603 in run_forever
  File "/Users/yolanda/.pyenv/versions/3.10.15/lib/python3.10/asyncio/base_events.py", line 636 in run_until_complete
  File "/Users/yolanda/.pyenv/versions/3.10.15/lib/python3.10/asyncio/runners.py", line 44 in run
  File "/Users/yolanda/development/muse/python/cmd/chat-core/./src/chat_core/__main__.py", line 116 in <module>
@workato-integration
Copy link

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

1 participant