You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Unknown sourceReference 0" on debug initialization error #1020
Edit: This issue is very likely tied to an ongoing issue with VSCode and the way it initializes a debugger instance when it's tied to communicating with a debug extensions, like Xdebug.
Original issue message:
I don't know how or why, but the last PR to main (#876) broke the extension for Linux upon debug session start. The error Exception has occurred: Error: Unknown sourceReference 0 keeps appearing in my Linux machines with PoP_OS and CachyOS. This issue doesn't happen in WSL2 (because, I presume it uses Ubuntu 22)
I have tested debugging the extension and checking out to the previous commit (c954087) and this problem doesn't appear anymore.
Out of curiosity, what is and what does OVSX_PAT? Why was this ENV removed?
Hi @Unradelic. OVSX_PAT and VSCE_PAT are Open VSX and Visual Studio Code Extension Personal Access Tokens that are used to automatically publish this extension to both marketplaces. I removed OVSX_PAT because I needed to push out a fix and Eclipse Foundation that hosts OpenVSX.org was down for a long time. So this has nothing to do with the extensions functionality.
In the referenced commit however, I did some manipulation of "Evaluate Request" handling that is linked to how VSC handles the watch window.
Regarding your error. Please provide the full log from DEBUG CONSOLE, so I can try to reproduce the issue. Please also provide the configuration from launch.json that you are using. sourceRequest is called by the IDE when it wants to get the contents of a virtual file.
Important update: It looks like some inicialization problem, not at all regarding a random ENV being removed. I tried installing other versions directly from VSCode Marketplace and the same problem occurs. Then, I updated to the latest version within VSCode, reloaded extensions and now it works.
Then, if I close VSCode, reopen and run (no changes at all anywhere) I then get this...
And finally, if I run Developer: Restart Extension Host (without closing VSCode) then it works!
Regarding of the DEBUG CONSOLE output, when this error ocurrs there is NO output there, like at all.
With all this, I assume it's a VSCode issue and not the extension. For the time being, I now know that it's an initialization error down the line between the extension host and extensions communication, so a workaround is, if this happens I just have to Developer: Restart Extension Host
changed the title [-]"Unknown sourceReference 0" if OVSX_PAT env variable is not set[/-][+]"Unknown sourceReference 0" on debug initialization error[/+]on May 18, 2025
I was writing another reply (sorry for so many replies xD) but I get inconsistent behaviours... For days, every time I got this error upon launching VSCode debugger I just kept working with the debugger still running just in case at some point it suddenly starts working, but no chance. But now, I got the error, left the debugger active, made a request and hit a breakpoint... Im puzzled. I wish to know if it's me D:
No problem at all! And that actually is a very good inquiry. Here's a list of the output for --list-extensions:
I should probably tidy up and wipe many of them. I am going to do that now.
Thanks, but I was not yet able to reproduce the issue. I'm intrigued by this replinput word. There is no reference to it in php-debug extension nor in the vscode source (this exact format). So it could be it is somehow coming from some other extension. I'll try to search around to see if I can find a reference to it, but if you have the time and energy you can do a bisect extension search to figure out which extension is the bad one. Not sure how you can force vscode bisect to always load php-debug.
There is also a very simple first step. Since I saw you compiled php-debug from source, you can add "--disable-extensions" parameter to Launch Extensionargs and this will load no extensions - except the one you are developing (php-debug).
If you cannot reproduce the problem, then the fault is in some other extension.
@zobo, did you find out anything about replinput btw.? I also got a report for my own debugger where a replinput source was requested and now I am curious what it does. The only mention of it I could find was in the elixir debugger, where there's a comment saying it's just "a special path that VSCode uses for debugger console"
Hi! Sadly no. I've still never seen this problem in my day-to-day usage. Are you seeing it? If yes, can you also lost the extensions you have installed.
The comment from Elixir debugger extension is interesting, I'll look into it. Can you also give a link to your specific issue?
Somebody also reported this to Xdebug directly https://bugs.xdebug.org/view.php?id=2302
Unfortunately, I didn't have any success reproducing this either. I can't link to my issue because it was reported through Discord, but I'll see if they want to post the info here as well.
Here's the log, but there doesn't seem to be anything interesting about it: dap_log.txt
We've also tested that this doesn't happen when all other extensions are disabled, however, running an extension bisect does not find any extension causing the issue, it actually says this might be a problem with VSCode.
I might install all the extensions in the future to see if I can reproduce it that way.
I'm seeing this happen consistently, can this be related in any way to paths mapping? My project runs under docker. And I map project paths to container paths.
Activity
zobo commentedon May 18, 2025
Hi @Unradelic. OVSX_PAT and VSCE_PAT are Open VSX and Visual Studio Code Extension Personal Access Tokens that are used to automatically publish this extension to both marketplaces. I removed OVSX_PAT because I needed to push out a fix and Eclipse Foundation that hosts OpenVSX.org was down for a long time. So this has nothing to do with the extensions functionality.
In the referenced commit however, I did some manipulation of "Evaluate Request" handling that is linked to how VSC handles the watch window.
Regarding your error. Please provide the full log from DEBUG CONSOLE, so I can try to reproduce the issue. Please also provide the configuration from launch.json that you are using.
sourceRequestis called by the IDE when it wants to get the contents of a virtual file.Unradelic commentedon May 18, 2025
Important update: It looks like some inicialization problem, not at all regarding a random ENV being removed. I tried installing other versions directly from VSCode Marketplace and the same problem occurs. Then, I updated to the latest version within VSCode, reloaded extensions and now it works.
Then, if I close VSCode, reopen and run (no changes at all anywhere) I then get this...

And finally, if I run
Developer: Restart Extension Host(without closing VSCode) then it works!Unradelic commentedon May 18, 2025
Regarding of the DEBUG CONSOLE output, when this error ocurrs there is NO output there, like at all.
With all this, I assume it's a VSCode issue and not the extension. For the time being, I now know that it's an initialization error down the line between the extension host and extensions communication, so a workaround is, if this happens I just have to
Developer: Restart Extension Host[-]"Unknown sourceReference 0" if OVSX_PAT env variable is not set[/-][+]"Unknown sourceReference 0" on debug initialization error[/+]zobo commentedon May 18, 2025
What about this in your screenshot?
log:trueneeds to be set inlaunch.json.If you can give me the whole output?
Unradelic commentedon May 18, 2025
Sorry, Im an idiot, forgot to set
"log":true... 😅zobo commentedon May 18, 2025
I have not yet seen this replinput. Can you paste the exact vscode version from the help about menu?
Unradelic commentedon May 18, 2025
Of course, and thank you for your replies btw:
I was writing another reply (sorry for so many replies xD) but I get inconsistent behaviours... For days, every time I got this error upon launching VSCode debugger I just kept working with the debugger still running just in case at some point it suddenly starts working, but no chance. But now, I got the error, left the debugger active, made a request and hit a breakpoint... Im puzzled. I wish to know if it's me D:
zobo commentedon May 18, 2025
Sorry about the never ending questions. Can you also list all installed extensions? I think one way to get them is with code --list-extensions
Unradelic commentedon May 18, 2025
No problem at all! And that actually is a very good inquiry. Here's a list of the output for
--list-extensions:I should probably tidy up and wipe many of them. I am going to do that now.
Enabled
Disabled:
zobo commentedon May 19, 2025
Thanks, but I was not yet able to reproduce the issue. I'm intrigued by this
replinputword. There is no reference to it in php-debug extension nor in the vscode source (this exact format). So it could be it is somehow coming from some other extension. I'll try to search around to see if I can find a reference to it, but if you have the time and energy you can do a bisect extension search to figure out which extension is the bad one. Not sure how you can force vscode bisect to always load php-debug.There is also a very simple first step. Since I saw you compiled php-debug from source, you can add
"--disable-extensions"parameter toLaunch Extensionargsand this will load no extensions - except the one you are developing (php-debug).If you cannot reproduce the problem, then the fault is in some other extension.
Papierkorb2292 commentedon Jul 30, 2025
@zobo, did you find out anything about
replinputbtw.? I also got a report for my own debugger where areplinputsource was requested and now I am curious what it does. The only mention of it I could find was in the elixir debugger, where there's a comment saying it's just "a special path that VSCode uses for debugger console"zobo commentedon Jul 31, 2025
Hi! Sadly no. I've still never seen this problem in my day-to-day usage. Are you seeing it? If yes, can you also lost the extensions you have installed.
The comment from Elixir debugger extension is interesting, I'll look into it. Can you also give a link to your specific issue?
Somebody also reported this to Xdebug directly https://bugs.xdebug.org/view.php?id=2302
Papierkorb2292 commentedon Jul 31, 2025
Unfortunately, I didn't have any success reproducing this either. I can't link to my issue because it was reported through Discord, but I'll see if they want to post the info here as well.
Kesuaheli commentedon Jul 31, 2025
@zobo Hey, I'll get the issue on @Papierkorb2292's extension.
These are all my extensions I currently have installed:
zobo commentedon Jul 31, 2025
Thanks a lot. Many extensions :)
Are you able to also record a log of the DAP messages between vscode and the extension?
Papierkorb2292 commentedon Aug 9, 2025
Here's the log, but there doesn't seem to be anything interesting about it: dap_log.txt
We've also tested that this doesn't happen when all other extensions are disabled, however, running an extension bisect does not find any extension causing the issue, it actually says this might be a problem with VSCode.
I might install all the extensions in the future to see if I can reproduce it that way.
furai commentedon Nov 18, 2025
I'm seeing this happen consistently, can this be related in any way to paths mapping? My project runs under docker. And I map project paths to container paths.
zobo commentedon Nov 18, 2025
Could you provide one full log and the list of extensions like above. Thanks