tnesbitt210 / interactive-smartlog-issues

12 stars 0 forks source link

Unable to fetch commits + Crash bug #4

Closed jcjp closed 8 months ago

jcjp commented 8 months ago

Description

Error: Unable to fetch commits

Visual studio code crash

Additional details

Exact error & trace

Remove some details for brevity. Happens on initial load of the repository.

Unable to fetch commits
`git merge-base <hash>` returned empty
Error: `git merge-base <hash>` returned empty
    at Xs.mergeBase (...\interactive-smartlog.interactive-smartlog-0.0.65\dist\extension.js:2:525146)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:538:9)
    at process.processTimers (node:internal/timers:512:7)
    at async Su.getCommitInfosOnBranch (...\.vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.65\dist\extension.js:2:570864)
    at async Promise.all (index 16)
    at async Su.getCommitInfos (...\.vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.65\dist\extension.js:2:569224)
    at async Su.getResultAsync (...\.vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.65\dist\extension.js:2:571604)
    at async Promise.all (index 1)
    at async ...\.vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.65\dist\extension.js:2:562494

Environment / OS:

tnesbitt210 commented 8 months ago

Wow, thank you so much @jcjp for the detailed report. The fact that only one hash (instead of two) is passed into merge-base is a huge clue.

I've pushed an update in v0.0.66 which should give a useful error message. If you're able, could you update the extension and let me know what the error message & trace are?

Some more info , if you're curious.... ISL runs git rev-parse to get hashes for:

It then runs git merge-base with the hashes it got from git rev-parse.

If git merge-base is only being passed only one hash (as your error message indicates), then git rev-parse must have returned an empty string for one of the branches. I'm hoping that the updated error message will tell us which branch it is doing this for. Maybe that branch's name has an escape character or something.

jcjp commented 8 months ago

After updating the extension it seems to now work properly, I tested it 4x times and I did not encounter the first issue. However since it is now loading properly when clicking the load more branches button it loads and then a popup / modal appears that saying that visual studio code crashed it's giving me 3 options: 1. Retry 2. Close 3. Wait. I tried Retry and it tried loading again but shows up the same modal, I tried wait and same thing happens, for Close it just closes the visual studio code entirely. I can't also see no trace or error logs shown.

Okay after re-opening VSC it seems to be not working again. I opened developer tools and here are some logs found on console.

[Extension Host] establish client connection for <repo>
console.ts:137 [Extension Host] Setup analytics, session:  <sessionId>
console.ts:137 [Extension Host] [track] ClientConnection  
console.ts:137 [Extension Host] getRepoInfo <repo>
log.ts:437   ERR [Extension Host] Watchman:  Watchman was not found in PATH.  See <link> for installation instructions
console.ts:137 [Extension Host] Watchman:  Watchman was not found in PATH.  See <link> for installation instructions
isl.js:2 Loaded initial params from URL:  
Map(7) {...}
[[Entries]]
0: {"id" => "5b15..."}
1: {"origin" => "0ac0..."}
2: {"swVersion" => "4"}
3: {"extensionId" => "interactive-smartlog.interactive-smartlog"}
4: {"platform" => "electron"}
5: {"vscode-resource-base-authority" => "vscode-resource.vscode-cdn.net"}
6: {"parentOrigin" => "vscode-file://vscode-app"}
size: 7
[[Prototype]]: Map
isl.js:2 Duplicate atom key "isFetchingUncommittedChanges". This is a FATAL ERROR in
      production. But it is safe to ignore this warning if it occurred because of
      hot module replacement.
console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: The client was ended
console.ts:137 [Extension Host] stack trace: Error: The client was ended
    at u.cancelCommands (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:70185)
    at u.end (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:73429)
    at u.<anonymous> (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:530927)
    at u.emit (node:events:514:28)
    at p (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:72260)
    at ChildProcess.<anonymous> (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:71551)
    at ChildProcess.emit (node:events:514:28)
    at Process.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
mainThreadExtensionService.ts:81 [interactive-smartlog.interactive-smartlog]The client was ended
mainThreadExtensionService.ts:82 Error: The client was ended
    at u.cancelCommands (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:70185)
    at u.end (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:73429)
    at u.<anonymous> (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:530927)
    at u.emit (node:events:514:28)
    at p (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:72260)
    at ChildProcess.<anonymous> (...\interactive-smartlog.interactive-smartlog-0.0.66\dist\extension.js:2:71551)
    at ChildProcess.emit (node:events:514:28)
    at Process.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
console.ts:137 [Extension Host] [track] InitialFetchSmartlogCommits InitialFetchSmartlogCommitsError 
console.ts:137 [Extension Host] [track] TopLevelErrorShown CommitsFetchError 
tnesbitt210 commented 8 months ago

Hmm, interesting. I just pushed v0.0.67, which should give us more error information for the errors described on the last two lines of the output you sent. Next time you update the extension, feel free to share the updated error from the developer tools console :)

Thanks for the ongoing updates!!

jcjp commented 8 months ago

Here is what is shown on the developer tools for the stack trace of the last two logs.

[Extension Host] [track] InitialFetchSmartlogCommits InitialFetchSmartlogCommitsError 
log.ts:437   ERR [Extension Host] [error] InitialFetchSmartlogCommits InitialFetchSmartlogCommitsError Error: `git merge-base d8c0...` returned empty
    at Xs.mergeBase (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:525313)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:538:9)
    at process.processTimers (node:internal/timers:512:7)
    at async Tu.getCommitInfosOnBranch (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:571014)
    at async Promise.all (index 47)
    at async Tu.getCommitInfos (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:569374)
    at async Tu.getResultAsync (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:571754)
    at async Promise.all (index 1)
    at async ....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:562644

[Extension Host] [track] TopLevelErrorShown CommitsFetchError 
log.ts:437   ERR [Extension Host] [error] TopLevelErrorShown CommitsFetchError Error: `git merge-base d8c0...` returned empty
    at Xs.mergeBase (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:525313)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:538:9)
    at process.processTimers (node:internal/timers:512:7)
    at async Tu.getCommitInfosOnBranch (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:571014)
    at async Promise.all (index 47)
    at async Tu.getCommitInfos (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:569374)
    at async Tu.getResultAsync (....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:571754)
    at async Promise.all (index 1)
    at async ....vscode\extensions\interactive-smartlog.interactive-smartlog-0.0.67\dist\extension.js:2:562644
tnesbitt210 commented 8 months ago

Thanks @jcjp . I'm honestly not really sure what's going on here. My leading theories are:

ref: refs/heads/main    HEAD
 1ab13b...        HEAD

If you're getting something different than this output, then let me know, because that's likely the culprit.

Thanks so much for your help. I want to be respectful of your time, so I'll pause on asking any more questions for now unless I have some strong idea of what the issue might be.

If you observe any changes in errors or behavior, do let me know. And if anyone else reading this is experiencing this issue, please comment!

jcjp commented 8 months ago

Here is the result from the git command:

➜ git ls-remote --symref origin HEAD
ref: refs/heads/develop HEAD
d8c0...     HEAD

Hopefully in the future this will get fixed, it somehow works from time to time and then when I try to re-open visual studio code it doesn't load properly.

tnesbitt210 commented 8 months ago

I updated to throw errors in a few suspected spots. If you update to version 0.0.72, let me know if you see the same merge-base error or if it's something new 🧐

jcjp commented 8 months ago

When I open my visual studio code for the first time and enabled the plugin it didn't load properly and same error was shown which is merge-base, and then when I tried to re-open visual studio code on the same repository it loaded the plugin correctly. Here is a different logs other than merge-base.

workbench.desktop.main.js:sourcemap:148 [Extension Host] establish client connection for <location>
workbench.desktop.main.js:sourcemap:148 [Extension Host] Setup analytics, session:  b0f5...
workbench.desktop.main.js:sourcemap:148 [Extension Host] [track] ClientConnection  
workbench.desktop.main.js:sourcemap:651   ERR [Extension Host] Watchman:  Watchman was not found in PATH.  See ... for installation instructions
workbench.desktop.main.js:sourcemap:148 [Extension Host] Watchman:  Watchman was not found in PATH.  See ... for installation instructions
p @ workbench.desktop.main.js:sourcemap:148
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1609
S @ workbench.desktop.main.js:sourcemap:1609
Q @ workbench.desktop.main.js:sourcemap:1609
M @ workbench.desktop.main.js:sourcemap:1609
L @ workbench.desktop.main.js:sourcemap:1609
(anonymous) @ workbench.desktop.main.js:sourcemap:1609
y @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:624
V.onmessage @ workbench.desktop.main.js:sourcemap:1632
isl.js:2 Loaded initial params from URL:  Map(7) {'id' => '3e22...', 'origin' => '0ac0...', 'swVersion' => '4', 'extensionId' => 'interactive-smartlog.interactive-smartlog', 'platform' => 'electron', …}
workbench.desktop.main.js:sourcemap:148 [Extension Host] rejected promise not handled within 1 second: Error: The client was ended
p @ workbench.desktop.main.js:sourcemap:148
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1609
S @ workbench.desktop.main.js:sourcemap:1609
Q @ workbench.desktop.main.js:sourcemap:1609
M @ workbench.desktop.main.js:sourcemap:1609
L @ workbench.desktop.main.js:sourcemap:1609
(anonymous) @ workbench.desktop.main.js:sourcemap:1609
y @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:624
V.onmessage @ workbench.desktop.main.js:sourcemap:1632
workbench.desktop.main.js:sourcemap:148 [Extension Host] stack trace: Error: The client was ended
    at u.cancelCommands (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:70185)
    at u.end (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:73429)
    at u.<anonymous> (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:531253)
    at u.emit (node:events:514:28)
    at p (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:72260)
    at ChildProcess.<anonymous> (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:71551)
    at ChildProcess.emit (node:events:514:28)
    at Process.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
p @ workbench.desktop.main.js:sourcemap:148
$logExtensionHostMessage @ workbench.desktop.main.js:sourcemap:1609
S @ workbench.desktop.main.js:sourcemap:1609
Q @ workbench.desktop.main.js:sourcemap:1609
M @ workbench.desktop.main.js:sourcemap:1609
L @ workbench.desktop.main.js:sourcemap:1609
(anonymous) @ workbench.desktop.main.js:sourcemap:1609
y @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:624
V.onmessage @ workbench.desktop.main.js:sourcemap:1632
workbench.desktop.main.js:sourcemap:1985 [interactive-smartlog.interactive-smartlog]The client was ended
$onExtensionRuntimeError @ workbench.desktop.main.js:sourcemap:1985
S @ workbench.desktop.main.js:sourcemap:1609
Q @ workbench.desktop.main.js:sourcemap:1609
M @ workbench.desktop.main.js:sourcemap:1609
L @ workbench.desktop.main.js:sourcemap:1609
(anonymous) @ workbench.desktop.main.js:sourcemap:1609
y @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:624
V.onmessage @ workbench.desktop.main.js:sourcemap:1632
workbench.desktop.main.js:sourcemap:1985 Error: The client was ended
    at u.cancelCommands (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:70185)
    at u.end (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:73429)
    at u.<anonymous> (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:531253)
    at u.emit (node:events:514:28)
    at p (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:72260)
    at ChildProcess.<anonymous> (...interactive-smartlog.interactive-smartlog-0.0.72\dist\extension.js:2:71551)
    at ChildProcess.emit (node:events:514:28)
    at Process.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
$onExtensionRuntimeError @ workbench.desktop.main.js:sourcemap:1985
S @ workbench.desktop.main.js:sourcemap:1609
Q @ workbench.desktop.main.js:sourcemap:1609
M @ workbench.desktop.main.js:sourcemap:1609
L @ workbench.desktop.main.js:sourcemap:1609
(anonymous) @ workbench.desktop.main.js:sourcemap:1609
y @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:87
fire @ workbench.desktop.main.js:sourcemap:624
V.onmessage @ workbench.desktop.main.js:sourcemap:1632
workbench.desktop.main.js:sourcemap:148 [Extension Host] [track] InitialFetchSmartlogCommits  {"numCommits":12,"numPublicCommits":10,"numBranches":13,"watchmanInstalled":false,"brewInstalled":false}
isl.js:2 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' https://*.vscode-cdn.net". Either the 'unsafe-inline' keyword, a hash ('<hash>'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

create @ isl.js:2
render @ isl.js:2
renderTemplate @ isl.js:2
finishInitialization @ isl.js:2
onConnectedCallback @ isl.js:2
connectedCallback @ isl.js:2
connectedCallback @ isl.js:2
connectedCallback @ isl.js:1170
ul @ isl.js:2
yl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
gl @ isl.js:2
vl @ isl.js:2
(anonymous) @ isl.js:2
xc @ isl.js:2
cc @ isl.js:2
Vi @ isl.js:2
rc @ isl.js:2
$s @ isl.js:2
(anonymous) @ isl.js:2
Kn @ isl.js:2
u @ isl.js:2
ut @ isl.js:2
dt @ isl.js:2
mt @ isl.js:2
(anonymous) @ isl.js:2
(anonymous) @ isl.js:2
(anonymous) @ isl.js:2
(anonymous) @ isl.js:2
(anonymous) @ isl.js:2
workbench.desktop.main.js:sourcemap:148 [Extension Host] [track] CommitTreesLoaded
tnesbitt210 commented 8 months ago

The reason it didn't load the first time may have been due to some caching that the extension uses.

Is it consistently loading for you now? If so, I'll close this ticket.

Thanks so much again for all of your responses. As a result of our conversation, I've added some improvements (in v0.0.74) that will help with debugging in the future:

jcjp commented 8 months ago

The reason it didn't load the first time may have been due to some caching that the extension uses.

Is it consistently loading for you now? If so, I'll close this ticket.

Thanks so much again for all of your responses. As a result of our conversation, I've added some improvements (in v0.0.74) that will help with debugging in the future:

  • The "output" panel now displays logs.
  • You can click on the bug nub (at the top right) to "report an issue", which will automatically create a draft github issue prepopulated with all of a user's debugging info, which they can then edit and submit.

Sure you can close it for now, it's still intermittently loading but most of the time it's showing error. Will report new issues that I will experience while using this in the future. Last thing I experience was when it loaded I tried loading more branches or commit history and it showed up to two pages then on the third page it was taking awhile to load but no crash modal shown.

tnesbitt210 commented 8 months ago

Ah, I didn't realize it was still happening. Ok, I updated the error thrown in merge-base (in v0.0.76) to tell us which branches it's trying to merge-base against. Next time you get the error in v0.0.76 or above, kindly let me know what the message says. And post the contents of the "output" panel if you don't mind.

tnesbitt210 commented 8 months ago

I found a way to repro the error you ran into... there's a command called git checkout --orphan <branchname>, which creates a branch that doesn't share history with any other branch. Is it possible that you used that at some point in the history of your repo? If even a single orphaned branch exists in the repo (even if you're not checked out on it), then that'll break the extension.

I'll write a fix, but the fix will just be to not show any of the orphaned branches. Will update here when I publish the fix.

jcjp commented 8 months ago

I found a way to repro the error you ran into... there's a command called git checkout --orphan <branchname>, which creates a branch that doesn't share history with any other branch. Is it possible that you used that at some point in the history of your repo? If even a single orphaned branch exists in the repo (even if you're not checked out on it), then that'll break the extension.

I'll write a fix, but the fix will just be to not show any of the orphaned branches. Will update here when I publish the fix.

Okay, will test once you pushed the latest fix.

tnesbitt210 commented 8 months ago

Ok, I just published version 0.0.77. I really hope this fixes the issue 🤞

jcjp commented 8 months ago

Ok, I just published version 0.0.77. I really hope this fixes the issue 🤞

Okay I tried reloading my visual studio code 3x and it seems to be now constantly working, thanks! 🥳 Feel free to close this issue.

tnesbitt210 commented 8 months ago

Awesome, so happy to hear that! Please let me know if you have any other issues or feedback in the future!