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

[BUG] Logger redirect does not work properly when running locally #484

Open
marcusforby opened this issue Oct 3, 2024 · 0 comments
Open
Labels
code/bug Something isn't working

Comments

@marcusforby
Copy link

I trying to run my algorithm in multiple iteration and after approximately 155 iterations the following error message is received:

Traceback (most recent call last): File "/Users/mapet/PycharmProjects/omni-channel-mip/test_lead_time_penalty/main_run_payloads.py", line 107, in <module> result = omni_channel_model.solve(time_limit=config_dict['solver_time_limit_seconds']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mapet/PycharmProjects/omni-channel-mip/omni_channel_mip/oc_mip_model.py", line 52, in solve super().solve(time_limit=time_limit, **kwargs) File "/Users/mapet/Library/Caches/pypoetry/virtualenvs/omni-channel-mip-CIBSmqiu-py3.11/lib/python3.11/site-packages/generic_mip/abstract_mip.py", line 100, in solve with self._logger.redirect(log_level=LogLevel.INFO): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in __enter__ return next(self.gen) ^^^^^^^^^^^^^^ File "/Users/mapet/Library/Caches/pypoetry/virtualenvs/omni-channel-mip-CIBSmqiu-py3.11/lib/python3.11/site-packages/adapta/logs/_internal_logger.py", line 323, in _redirect tmp_symlink_out, tmp_symlink_err = self._activate_redirect(libc, tmp_file_out, tmp_file_err) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mapet/Library/Caches/pypoetry/virtualenvs/omni-channel-mip-CIBSmqiu-py3.11/lib/python3.11/site-packages/adapta/logs/_internal_logger.py", line 244, in _activate_redirect os.chmod(tmp_symlink_stderr, 420) FileNotFoundError: [Errno 2] No such file or directory: b'/var/folders/zs/4gh0wr6s6vq0217l6v_pjz280000gp/T/e2e29796-c547-416a-87b7-24f72e2cb617-err'

I have instantiated the logger like this:
logger = SemanticLogger().add_log_source( log_source_name=f"MyModel_{request_id}", min_log_level=LogLevel.ERROR, log_handlers=[StreamHandler(sys.stdout)], is_default=True )

@marcusforby marcusforby added the code/bug Something isn't working label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant