Lean icon indicating copy to clipboard operation
Lean copied to clipboard

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

Open symbion6 opened this issue 1 year ago • 14 comments

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

symbion6 avatar May 10 '24 15:05 symbion6

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?

Martin-Molinero avatar May 10 '24 16:05 Martin-Molinero

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

symbion6 avatar May 10 '24 17:05 symbion6

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?

Martin-Molinero avatar May 13 '24 21:05 Martin-Molinero

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

symbion6 avatar May 14 '24 08:05 symbion6

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

jhonabreul avatar May 14 '24 21:05 jhonabreul

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

jhonabreul avatar May 14 '24 22:05 jhonabreul

@jhonabreul Thanks! Attached is the verbose output

log_verbose_1.log

symbion6 avatar May 15 '24 17:05 symbion6

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

Martin-Molinero avatar May 15 '24 19:05 Martin-Molinero

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.

symbion6 avatar May 20 '24 13:05 symbion6

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

Martin-Molinero avatar May 24 '24 15:05 Martin-Molinero

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.

symbion6 avatar May 29 '24 16:05 symbion6

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

Martin-Molinero avatar May 29 '24 20:05 Martin-Molinero

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!

symbion6 avatar Jun 06 '24 13:06 symbion6

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 https://github.com/QuantConnect/lean-cli/issues/459 so debugging is easier in the future though Thanks!

Martin-Molinero avatar Jun 06 '24 13:06 Martin-Molinero