Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

VSCode: Debug Strategies #1581

Closed
pharindoko opened this issue Dec 29, 2017 · 8 comments
Closed

VSCode: Debug Strategies #1581

pharindoko opened this issue Dec 29, 2017 · 8 comments
Labels

Comments

@pharindoko
Copy link

Note: for support questions, please join our Discord server

  • I'm submitting a ...
    [ X] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository

  • Action taken (what you did)
    Created launch.json in VSCode with following settings

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Launch Server",
            "type": "node",
            "request": "launch",
            "program": "${workspaceRoot}/gekko.js",
            "cwd": "${workspaceRoot}",
            "preLaunchTask": null,
            "runtimeExecutable": null,
            "args": [
                "--ui",
                "--config", "config.js"
            ],
            "env": {
                "NODE_ENV": "development"
            },
            //"console": "internalConsole",
            "sourceMaps": false,
            "outFiles": []
        }
    ]
}

Set a breakpoint
Start to debug gekko.js and then get deeper into details to debug a strategy

  • Expected result (what you hoped would happen)
    History data (local data) is available in history folder and will be loaded the same way as it does if I start gekko via commandline.
    No difference if I run it in a debug session or via commandline

  • Actual result (unexpected outcome)
    I can debug into gekko.js and even import.js
    Issue:
    No local data or history data for back testing is available.
    When I try to run the importer to add additional data it fails I receive following error in Import.js

RECEIVED ERROR IN IMPORT 999433617504825
Child process has died.

Assumption - something wents wrong with backend (sqlite)
Can someone else try to replicate and see if it works ?

@gdomod
Copy link

gdomod commented Jan 9, 2018

same here. any help ?

@Nimrasol
Copy link

I made the same experience. Is there a solution available? Is there an other way to debug gecko with brake points? Thank you for the help!

@kalitas
Copy link

kalitas commented Feb 22, 2018

same here

1 similar comment
@goldistan
Copy link

same here

@mikemichaelis
Copy link

I'm having the same issue, but discovered it has nothing to do with VS Code. If you execute node 8.10.0 in --inspect mode, gekko will not find any history data.

node --inspect gekko --ui

I also tried node 7.10.1 using the legacy debug protocol and it also fails to load historical data.

node --debug gekko --ui

@evertondanilo
Copy link

evertondanilo commented Sep 24, 2018

I found the bug:

Go to this file: Gekko\core\workers\dateRangeScan\parent.js

Original:

module.exports = function(config, done) {
  var debug = typeof v8debug === 'object';
  if (debug) {
    process.execArgv = [];
  }

Changed:

module.exports = function(config, done) {
  var debug = typeof v8debug === 'object';
  if (debug || config.debug) {  //LOOK HERE <<
    process.execArgv = [];
  }

So, what I've seen here is that when debugging we need to clear out the execArgv parameter. However the debug variable was set as false.

@askmike
Copy link
Owner

askmike commented Sep 25, 2018

This was added here on purpose: #1666 by @mronus. Note @evertondanilo that this issue was opened before that PR was merged.

I don't use any of these tools in my debug flow and which way is best depends on how you are debugging I guess.

@stale
Copy link

stale bot commented Nov 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me.

@stale stale bot added the wontfix label Nov 24, 2018
@stale stale bot closed this as completed Dec 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants