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

Debugging with VSCode results in error "No usable version of libssl was found" #8015

Closed
symbion6 opened this issue May 10, 2024 · 14 comments
Closed

Comments

@symbion6
Copy link

symbion6 commented May 10, 2024

Expected Behavior

Debugging the Lean Engine (docker container) using VSCode works as expected.

Actual Behavior

Debugging start the container and the algorithm, but before any breakpoints are hit, the container breaks and the following error is shown in the debug console:

Error from pipe program 'docker': No usable version of libssl was found
The pipe program 'docker' exited unexpectedly with code 134.

This started happening overnight; it has worked for over a year before, flawlessly.

Potential Solution

Not sure. I've tried manually installing libssl in the docker container; this did not help at all.
Before that, I've made sure to pull the latest version of the lean docker image.

Reproducing the Problem

It's reproducable on my system 100% of the time; I cannot debug anything at the moment.

System Information

MacOS 14.1.1
Latest Lean Engine, latest VSCode

Checklist

  • [V] I have completely filled out this template
  • [V] I have confirmed that this issue exists on the current master branch
  • [V] I have confirmed that this is not a duplicate issue by searching issues
  • [n/a] I have provided detailed steps to reproduce the issue
@Martin-Molinero
Copy link
Member

Hey @symbion6!
We actually solve a similar error by using a new debugger version, see https://github.com/QuantConnect/Lean/pull/8000/files, this might of caused the issue for you. We will need more information details & logs to debug this further, please share the logs and details how are u debugging. Is your host running on ARM architecture?

@symbion6
Copy link
Author

Interesting. My host is a Macbook running an Intel processor, no ARM.

I'm starting the debugging process using this command:
lean backtest ProjectName --debug vsdbg

When "waiting for debugger to attach..." appears, I go to the "Run and Debug" tab of Visual Studio Code and start with "Debug with Lean CLI".

The weird thing is that it runs for a bit before it exits.

Attached are the log files:
debug_console.log
log.txt

@Martin-Molinero
Copy link
Member

Hey @symbion6! The log.txt is showing there seems to be a corrupted data file Symbol: BTCUSD, SecurityType: Crypto, Resolution: Hour, Date: 2015-05-31, Message: System.FormatException: String '00:00 that might be causing ur issues, suggest deleting it an retesting. How was this file created?

@symbion6
Copy link
Author

Hi @Martin-Molinero. Just fixed that issue and ran again. The process keeps exiting and giving the reported error:

Error from pipe program 'docker': No usable version of libssl was found
The pipe program 'docker' exited unexpectedly with code 134.

New log file:
log-1.txt

@jhonabreul
Copy link
Collaborator

Hi @symbion6
If you have more logs to share, it would be nice for us to take a better look asap.
Thanks

@jhonabreul
Copy link
Collaborator

@symbion6
You can run your backtest with the Lean CLI verbose flag: lean backtest Project --debug vsdbg --verbose and share the logs, pelase

@symbion6
Copy link
Author

@jhonabreul Thanks! Attached is the verbose output

log_verbose_1.log

@Martin-Molinero
Copy link
Member

Hey @symbion6!
The lean cli version ur using is old, please update to the latest pip install --upgrade lean, current version is at 1.0.196. My guess is that ur local dotnet version on the host is old too, lean is running dotnet 6, could you make sure u've installed the latest dotnet 6 release on the host and retest? Same for vscode & the C# extension too, but those are usually upgraded automatically

@symbion6
Copy link
Author

Hi @Martin-Molinero, thanks for the instructions! I've followed them all. The results are, unfortunately, still the same.
Here's the result of the "dotnet --list-runtimes" command:

Microsoft.AspNetCore.App 3.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.17 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.30 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Same for "--list-sdks":

5.0.408 [/usr/local/share/dotnet/sdk]
6.0.422 [/usr/local/share/dotnet/sdk]
7.0.400 [/usr/local/share/dotnet/sdk]

This is the result of the pip upgrade:

Successfully installed lean-1.0.196 quantconnect-stubs-16427

I've restarted the machine after the installs and then tried the debugging again, resulting in the same libssl error.

@Martin-Molinero
Copy link
Member

Hey @symbion6!
Believe this is some issue with dotnet, mac & openssl versions, there are a few bug reports about it, the error is happening on your host not inside lean container.
It's had for us to give support for issues on each host given the variety of potential configurations. But what version of openssl is installed? Can you try updating the openssl version on the host? Can also try running a simple dotnet program on the host & debugging it I think would reproduce the same issue as well

@symbion6
Copy link
Author

symbion6 commented May 29, 2024

Hi @Martin-Molinero,
Running a simple dotnet program on the host & debugging works flawlessly.
OpenSSL version:
OpenSSL 3.3.0 9 Apr 2024 (Library: OpenSSL 3.3.0 9 Apr 2024)

I remember you've mentioned this:

We actually solve a similar error by using a new debugger version, see https://github.com/QuantConnect/Lean/pull/8000/files, this might of caused the issue for you.

Is this something to checkout? If so, how can I upgrade the debugger version?

UPDATE:
Turns out, that when no breakpoints are enabled, everything runs until the end.
If enabled, the crash occurs when the first breakpoint is hit.

@Martin-Molinero
Copy link
Member

UPDATE:
Turns out, that when no breakpoints are enabled, everything runs until the end.
If enabled, the crash occurs when the first breakpoint is hit.

This is on the host?

Is this something to checkout? If so, how can I upgrade the debugger version?

Locally u can update the foundation file (like done in https://github.com/QuantConnect/Lean/pull/8000/files) and build a custom image, see https://www.quantconnect.com//docs/v2/lean-cli/projects/custom-docker-images#01-Introduction.
The current debugger version is already at 17.11.10506.2, can try with this version or even go back to previous version 16.9.20122.2 to confirm that's working for u

@symbion6
Copy link
Author

symbion6 commented Jun 6, 2024

Hi @Martin-Molinero!

After a lot of experimenting, it turned out to be the version of the debugger.
The error occurs with the previous version 16.9.20122.2 and not with the new 17.10.20209.7

I'm happy it works again and I've gained some useful knowledge on working with custom images.
Thanks for your support!

@Martin-Molinero
Copy link
Member

Hey @symbion6! I'm glad it's working, just to be clear the current version is 17.10.20209.7 so the current lean image is working correctly for you? If so, think we can close this issue, we will keep QuantConnect/lean-cli#459 so debugging is easier in the future though
Thanks!

@Martin-Molinero Martin-Molinero closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
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

3 participants