Skip to content

Unable to resolve non-existent file. (Path mapping) #533

Description

@stovesy

PHP version: 7.2.24-0ubuntu0.18.04.7
Xdebug version: 2.6.0
PHP Debug: 1.14.11

A previously working setup.
A remote apache web server.
A windows vscode client.
Remote source files are mapped to a local drive (y:) via webdav.

"pathMappings": {
"/srv/www/servernamehere/" : "y:",
}

Breakpoints are hit correctly but VS code cannot now open the source file...... Seems to be prepending where it thinks the local copy of the file should live.......
Unable to open 'EnquiryController.php': Unable to read file 'c:\Users\usernamehere\AppData\Local\Programs\Microsoft VS Code\y:\badger\controllers\EnquiryController.php' (Error: Unable to resolve non-existing file 'c:\Users\usernamehere\AppData\Local\Programs\Microsoft VS Code\y:\badger\controllers\EnquiryController.php').

Notice how the drive letter (y:) appears after the local store folder. The path after y: will correctly find my file.

Here is an example of a log from a debug session.
<- launchResponse
Response {
seq: 0,
type: 'response',
request_seq: 2,
command: 'launch',
success: true
}
new connection 1
<- threadEvent
ThreadEvent {
seq: 0,
type: 'event',
event: 'thread',
body: { reason: 'started', threadId: 1 }
}
<- initializedEvent
InitializedEvent { seq: 0, type: 'event', event: 'initialized' }
-> setBreakpointsRequest
{
command: 'setBreakpoints',
arguments: {
source: {
name: 'BadgerImportController.php',
path: 'y:\badger\controllers\BadgerImportController.php'
},
lines: [],
breakpoints: [],
sourceModified: false
},
type: 'request',
seq: 3
}
-> setBreakpointsRequest
{
command: 'setBreakpoints',
arguments: {
source: {
name: 'EnquiryController.php',
path: 'y:\badger\controllers\EnquiryController.php'
},
lines: [ 69 ],
breakpoints: [ { line: 69 } ],
sourceModified: false
},
type: 'request',
seq: 4
}
-> setBreakpointsRequest
{
command: 'setBreakpoints',
arguments: {
source: {
name: 'PurchaseOrderController.php',
path: 'y:\badger\controllers\PurchaseOrderController.php'
},
lines: [],
breakpoints: [],
sourceModified: false
},
type: 'request',
seq: 5
}
-> setBreakpointsRequest
{
command: 'setBreakpoints',
arguments: {
source: {
name: 'StructureListItemController.php',
path: 'y:\badger\controllers\StructureListItemController.php'
},
lines: [ 461 ],
breakpoints: [ { line: 461 } ],
sourceModified: false
},
type: 'request',
seq: 6
}
<- setBreakpointsResponse
Response {
seq: 0,
type: 'response',
request_seq: 3,
command: 'setBreakpoints',
success: true,
body: { breakpoints: [] }
}
<- setBreakpointsResponse
Response {
seq: 0,
type: 'response',
request_seq: 5,
command: 'setBreakpoints',
success: true,
body: { breakpoints: [] }
}
<- setBreakpointsResponse
Response {
seq: 0,
type: 'response',
request_seq: 4,
command: 'setBreakpoints',
success: true,
body: { breakpoints: [ { verified: true, line: 69 } ] }
}
<- setBreakpointsResponse
Response {
seq: 0,
type: 'response',
request_seq: 6,
command: 'setBreakpoints',
success: true,
body: { breakpoints: [ { verified: true, line: 461 } ] }
}
-> setFunctionBreakpointsRequest
{
command: 'setFunctionBreakpoints',
arguments: { breakpoints: [] },
type: 'request',
seq: 7
}
<- setFunctionBreakpointsResponse
Response {
seq: 0,
type: 'response',
request_seq: 7,
command: 'setFunctionBreakpoints',
success: true,
body: { breakpoints: [] }
}
-> setExceptionBreakpointsRequest
{
command: 'setExceptionBreakpoints',
arguments: { filters: [] },
type: 'request',
seq: 8
}
<- setExceptionBreakpointsResponse
Response {
seq: 0,
type: 'response',
request_seq: 8,
command: 'setExceptionBreakpoints',
success: true
}
-> configurationDoneRequest
{ command: 'configurationDone', type: 'request', seq: 9 }
-> threadsRequest
{ command: 'threads', type: 'request', seq: 10 }
<- threadsResponse
Response {
seq: 0,
type: 'response',
request_seq: 10,
command: 'threads',
success: true,
body: { threads: [ Thread { id: 1, name: 'Request 1 (10:09:11 AM)' } ] }
}
<- configurationDoneResponse
Response {
seq: 0,
type: 'response',
request_seq: 9,
command: 'configurationDone',
success: true
}
<- stoppedEvent
StoppedEvent {
seq: 0,
type: 'event',
event: 'stopped',
body: { reason: 'breakpoint', threadId: 1, allThreadsStopped: false }
}
-> threadsRequest
{ command: 'threads', type: 'request', seq: 11 }
<- threadsResponse
Response {
seq: 0,
type: 'response',
request_seq: 11,
command: 'threads',
success: true,
body: { threads: [ Thread { id: 1, name: 'Request 1 (10:09:11 AM)' } ] }
}
-> threadsRequest
{ command: 'threads', type: 'request', seq: 12 }
<- threadsResponse
Response {
seq: 0,
type: 'response',
request_seq: 12,
command: 'threads',
success: true,
body: { threads: [ Thread { id: 1, name: 'Request 1 (10:09:11 AM)' } ] }
}
-> stackTraceRequest
{
command: 'stackTrace',
arguments: { threadId: 1, startFrame: 0, levels: 20 },
type: 'request',
seq: 13
}
<- stackTraceResponse
Response {
seq: 0,
type: 'response',
request_seq: 13,
command: 'stackTrace',
success: true,
body: {
stackFrames: [
{
id: 1,
name: 'app\controllers\EnquiryController->actionToJob',
source: {
name: 'EnquiryController.php',
path: 'C:\Users\mywindowsusername\AppData\Local\Programs\Microsoft VS Code/y:/badger/controllers/EnquiryController.php'
},
line: 69,
column: 1
},
{
id: 2,
name: 'call_user_func_array:{/srv/www/dev.charnvel.co.uk/badger/vendor/yiisoft/yii2/base/InlineAction.php:57}',
source: {
name: 'InlineAction.php',
path: 'C:\Users\mywindowsusername\AppData\Local\Programs\Microsoft VS Code/y:/badger/vendor/yiisoft/yii2/base/InlineAction.php'
},
line: 57,
column: 1
},
{
id: 3,
name: 'yii\base\InlineAction->runWithParams',
source: {
name: 'InlineAction.php',
path: 'C:\Users\mywindowsusername\AppData\Local\Programs\Microsoft VS Code/y:/badger/vendor/yiisoft/yii2/base/InlineAction.php'
},
line: 57,
column: 1
},
{
id: 4,
name: 'app\controllers\EnquiryController->runAction',
source: {
name: 'Controller.php',
path: 'C:\Users\mywindowsusername\AppData\Local\Programs\Microsoft VS Code/y:/badger/vendor/yiisoft/yii2/base/Controller.php'
},
line: 181,
column: 1
},
{
id: 5,
name: 'yii\web\Application->runAction',
source: {
name: 'Module.php',
path: 'C:\Users\pete.STOVESY-HP\AppData\Local\Programs\Microsoft VS Code/y:/badger/vendor/yiisoft/yii2/base/Module.php'
},
line: 534,
column: 1
},
{
id: 6,
name: 'yii\web\Application->handleRequest',
source: {
name: 'Application.php',
path: 'C:\Users\mywindowsusername\Local\Programs\Microsoft VS Code/y:/badger/vendor/yiisoft/yii2/web/Application.php'
},
line: 104,
column: 1
},
{
id: 7,
name: 'yii\web\Application->run',
source: {
name: 'Application.php',
path: 'C:\Users\pete.STOVESY-HP\AppData\Local\Programs\Microsoft VS Code/y:/badger/vendor/yiisoft/yii2/base/Application.php'
},
line: 392,
column: 1
},
{
id: 8,
name: '{main}',
source: {
name: 'index.php',
path: 'C:\Users\mywindowsusername\AppData\Local\Programs\Microsoft VS Code/y:/badger/web/index.php'
},
line: 12,
column: 1
}
]
}
}

Thank you for your time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions