scalyr / scalyr-agent-2

The source code for Scalyr Agent 2, the daemon process Scalyr customers run on their servers to collect metrics and logs.
Apache License 2.0
70 stars 56 forks source link

Cannot install scalyr-agent-2 on Ubuntu with Python2 and Python3 installed #1217

Open stormentt opened 12 months ago

stormentt commented 12 months ago

596cab27 introduced two imports for ThreadPoolExecutor from concurrent.futures, which was introduced in python 3.2.

agent_build_refactored/managed_packages/non-aio/install-scriptlets/check-python.sh can set the python interpreter to python 2.7 if it's installed on the system, which causes the package install to fail:

. Trying to switch the Python interpreter for the Scalyr Agent.
 . Searching for python in PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin":
 + command python [2.7.17] is found and matches the minimum required version - Success!
 + The Scalyr Agent will use the default system python binary (/usr/bin/env python).
 Traceback (most recent call last):
   File "/usr/share/scalyr-agent-2/bin/scalyr-agent-2", line 101, in <module>
     from scalyr_agent.monitors_manager import MonitorsManager
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 20, in <module>
     from scalyr_agent.builtin_monitors.thread_pool import ThreadPoolExecutorFactory
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/builtin_monitors/thread_pool.py", line 20, in <module>
     from concurrent.futures import ThreadPoolExecutor
 ImportError: No module named concurrent.futures
 Traceback (most recent call last):
   File "/usr/sbin/scalyr-agent-2", line 101, in <module>
     from scalyr_agent.monitors_manager import MonitorsManager
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/monitors_manager.py", line 20, in <module>
     from scalyr_agent.builtin_monitors.thread_pool import ThreadPoolExecutorFactory
   File "/usr/share/scalyr-agent-2/py/scalyr_agent/builtin_monitors/thread_pool.py", line 20, in <module>
     from concurrent.futures import ThreadPoolExecutor
 ImportError: No module named concurrent.futures
weilliu commented 11 months ago

@stormentt Alex has also opened a support ticket. I just added you to cc of the ticket. We'll use the ticket for the ongoing investigations.