This is indeed a corner case but I am leaving this ticket in the backlog in case we see evidence that some users actually run in it.
Issue: if there is an "inactive" env directory in the project folder, the installer will generate an appmap.yml with all dev and run dependencies that will likely crash the agent when it runs. This can happen if user forgets to switch to the correct environment before running the appmap installer, or when he has a backup folder of the env, etc.
In my case, I had an old inactive env folder that I was using for testing dev versions of the agent back in April.
Tested app: FlaskBB @ land of apps
Agent version:
(flaskbb) ‣ pip show appmap
Name: appmap
Version: 1.3.1
Summary: Create AppMap files by recording a Python application.
Home-page: https://github.com/applandinc/appmap-python
Author: Alan Potter
Author-email: alan@app.land
License: MIT
Location: /Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages
Requires: importlib-metadata, inflection, PyYAML
Required-by:
(flaskbb) ‣ APPMAP=true pytest
Traceback (most recent call last):
File "/Users/ptrdvrk/work/python_envs/flaskbb/bin/pytest", line 8, in <module>
sys.exit(console_main())
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 592, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 592, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 143, in main
config = _prepareconfig(args, plugins)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 592, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/pluggy/manager.py", line 84, in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 592, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/pluggy/callers.py", line 203, in _multicall
gen.send(outcome)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
config: Config = outcome.get_result()
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
self.parse(args)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1283, in parse
self._preparse(args, addopts=addopts)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1167, in _preparse
self._consider_importhook(args)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1114, in _consider_importhook
self._mark_plugins_for_rewrite(hook)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1135, in _mark_plugins_for_rewrite
hook.mark_rewrite(name)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/assertion/rewrite.py", line 259, in mark_rewrite
self._warn_already_imported(name)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/assertion/rewrite.py", line 266, in _warn_already_imported
self.config.issue_config_time_warning(
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 650, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1320, in issue_config_time_warning
apply_warning_filters(config_filters, cmdline_filters)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 592, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 124, in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/instrument.py", line 81, in call_instrumented
return f.fn(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1606, in apply_warning_filters
warnings.filterwarnings(*parse_warning_filter(arg, escape=True))
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1579, in parse_warning_filter
category: Type[Warning] = warnings._getcategory(category_) # type: ignore[attr-defined]
File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/warnings.py", line 260, in _getcategory
m = __import__(module, None, None, [klass])
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/github/python/flaskbb/flaskbb/__init__.py", line 18, in <module>
from flaskbb.app import create_app # noqa
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/github/python/flaskbb/flaskbb/app.py", line 26, in <module>
from flaskbb.extensions import (alembic, allows, babel, cache, celery, csrf,
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/github/python/flaskbb/flaskbb/extensions.py", line 14, in <module>
from flask_alembic import Alembic
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/flask_alembic/__init__.py", line 13, in <module>
from flask_alembic.extension import Alembic
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/flask_alembic/extension.py", line 6, in <module>
from alembic import util, autogenerate
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/__init__.py", line 3, in <module>
from . import context # noqa
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/context.py", line 1, in <module>
from .runtime.environment import EnvironmentContext
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/runtime/environment.py", line 1, in <module>
from .migration import MigrationContext
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/runtime/migration.py", line 15, in <module>
from .. import ddl
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/ddl/__init__.py", line 1, in <module>
from . import mssql # noqa
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/ddl/mssql.py", line 8, in <module>
from .base import AddColumn
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/ddl/base.py", line 11, in <module>
from ..util import sqla_compat
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/util/__init__.py", line 21, in <module>
from .pyfiles import coerce_resource_to_filename # noqa
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 5, in <module>
from mako import exceptions
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/mako/exceptions.py", line 305, in <module>
_install_highlighting()
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/mako/exceptions.py", line 300, in _install_highlighting
_install_pygments()
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/mako/exceptions.py", line 284, in _install_pygments
from mako.ext.pygmentplugin import syntax_highlight # noqa
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 310, in wrapped_exec_module
exec_module(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/mako/ext/pygmentplugin.py", line 9, in <module>
from pygments.lexer import bygroups
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/wrapt/wrappers.py", line 583, in __call__
return self._self_wrapper(self.__wrapped__, instance,
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 315, in wrapped_exec_module
Recorder().do_import(*args, **kwargs)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 280, in do_import
instrument_functions(FilterableMod(mod))
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 271, in instrument_functions
functions = get_members(filterable.obj)
File "/Users/ptrdvrk/work/python_envs/flaskbb/lib/python3.9/site-packages/appmap/_implementation/recording.py", line 183, in get_members
if value.__module__ != modname:
AttributeError: 'staticmethod' object has no attribute '__module__'
✖ 1
This is indeed a corner case but I am leaving this ticket in the backlog in case we see evidence that some users actually run in it.
Issue: if there is an "inactive" env directory in the project folder, the installer will generate an appmap.yml with all dev and run dependencies that will likely crash the agent when it runs. This can happen if user forgets to switch to the correct environment before running the appmap installer, or when he has a backup folder of the env, etc.
In my case, I had an old inactive env folder that I was using for testing dev versions of the agent back in April.
Tested app: FlaskBB @ land of apps
Agent version:
Environment:
appmap.yml: (generated by
npx appmap install
)Errors: