SQL Server 2017 crashes when backing up because filepath is wrong
Clash Royale CLAN TAG#URR8PPP
I was trying to restore my database and SQL Server kept crashing. I would get a message in SSMS that said there was a network transport error (the connection dropped bc the crash). I checked the logs and found nothing more than SQL Server closed unexpectedly. I would then have to go and restart the service.
I narrowed the issue down to the script that the GUI was trying to run. The problem is when it goes to take a tail log backup, the path to the backup files is wrong. It should be D:mapbenefits...
BACKUP LOG [mapbenefits]
TO DISK = N'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'
WITH NOFORMAT, NOINIT, NAME = N'mapbenefits_LogBackup_2019-02-21_13-58-24',
NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
I have two questions.
How do I fix this path? I tried going into the server settings and the backup path is
D:
with no slash. If I add the slash the gui removes it. This is SSMS v17.9.1. I can pickD:mapbenefits
and that works but I wantD:DATABASE...
Is this a bug? Should SQL server crash just because a path is incorrectly typed? Once I fixed the file path it has no trouble. I can reproduce anytime just by mucking up the filepath.
If I run a query to check version I get CU13, but if I go into settings I see version 14.0.1000.169.
Looks like this is a bug and is reproducible so I posted it to here: https://feedback.azure.com/forums/908035-sql-server/suggestions/36920542-incorrect-filepath-with-backup-log-command-causes
sql-server backup sql-server-2017
add a comment |
I was trying to restore my database and SQL Server kept crashing. I would get a message in SSMS that said there was a network transport error (the connection dropped bc the crash). I checked the logs and found nothing more than SQL Server closed unexpectedly. I would then have to go and restart the service.
I narrowed the issue down to the script that the GUI was trying to run. The problem is when it goes to take a tail log backup, the path to the backup files is wrong. It should be D:mapbenefits...
BACKUP LOG [mapbenefits]
TO DISK = N'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'
WITH NOFORMAT, NOINIT, NAME = N'mapbenefits_LogBackup_2019-02-21_13-58-24',
NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
I have two questions.
How do I fix this path? I tried going into the server settings and the backup path is
D:
with no slash. If I add the slash the gui removes it. This is SSMS v17.9.1. I can pickD:mapbenefits
and that works but I wantD:DATABASE...
Is this a bug? Should SQL server crash just because a path is incorrectly typed? Once I fixed the file path it has no trouble. I can reproduce anytime just by mucking up the filepath.
If I run a query to check version I get CU13, but if I go into settings I see version 14.0.1000.169.
Looks like this is a bug and is reproducible so I posted it to here: https://feedback.azure.com/forums/908035-sql-server/suggestions/36920542-incorrect-filepath-with-backup-log-command-causes
sql-server backup sql-server-2017
add a comment |
I was trying to restore my database and SQL Server kept crashing. I would get a message in SSMS that said there was a network transport error (the connection dropped bc the crash). I checked the logs and found nothing more than SQL Server closed unexpectedly. I would then have to go and restart the service.
I narrowed the issue down to the script that the GUI was trying to run. The problem is when it goes to take a tail log backup, the path to the backup files is wrong. It should be D:mapbenefits...
BACKUP LOG [mapbenefits]
TO DISK = N'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'
WITH NOFORMAT, NOINIT, NAME = N'mapbenefits_LogBackup_2019-02-21_13-58-24',
NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
I have two questions.
How do I fix this path? I tried going into the server settings and the backup path is
D:
with no slash. If I add the slash the gui removes it. This is SSMS v17.9.1. I can pickD:mapbenefits
and that works but I wantD:DATABASE...
Is this a bug? Should SQL server crash just because a path is incorrectly typed? Once I fixed the file path it has no trouble. I can reproduce anytime just by mucking up the filepath.
If I run a query to check version I get CU13, but if I go into settings I see version 14.0.1000.169.
Looks like this is a bug and is reproducible so I posted it to here: https://feedback.azure.com/forums/908035-sql-server/suggestions/36920542-incorrect-filepath-with-backup-log-command-causes
sql-server backup sql-server-2017
I was trying to restore my database and SQL Server kept crashing. I would get a message in SSMS that said there was a network transport error (the connection dropped bc the crash). I checked the logs and found nothing more than SQL Server closed unexpectedly. I would then have to go and restart the service.
I narrowed the issue down to the script that the GUI was trying to run. The problem is when it goes to take a tail log backup, the path to the backup files is wrong. It should be D:mapbenefits...
BACKUP LOG [mapbenefits]
TO DISK = N'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'
WITH NOFORMAT, NOINIT, NAME = N'mapbenefits_LogBackup_2019-02-21_13-58-24',
NOSKIP, NOREWIND, NOUNLOAD, NORECOVERY , STATS = 5
I have two questions.
How do I fix this path? I tried going into the server settings and the backup path is
D:
with no slash. If I add the slash the gui removes it. This is SSMS v17.9.1. I can pickD:mapbenefits
and that works but I wantD:DATABASE...
Is this a bug? Should SQL server crash just because a path is incorrectly typed? Once I fixed the file path it has no trouble. I can reproduce anytime just by mucking up the filepath.
If I run a query to check version I get CU13, but if I go into settings I see version 14.0.1000.169.
Looks like this is a bug and is reproducible so I posted it to here: https://feedback.azure.com/forums/908035-sql-server/suggestions/36920542-incorrect-filepath-with-backup-log-command-causes
sql-server backup sql-server-2017
sql-server backup sql-server-2017
edited Feb 21 at 20:48
Rick
asked Feb 21 at 19:07
RickRick
1405
1405
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I was able to reproduce this.
On 2016, if I put an invalid path like that, I get this message:
Cannot open backup device 'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'. Operating system error 3(The system cannot find the path specified.)
On 2017 CU 13 (14.0.3048.4), it results in the service crashing. You've already mentioned that in the latest hotfix (14.0.3049.1), the service doesn't crash, but the session is killed.
I've confirmed the same exact behavior applies to RESTORE DATABASE
as well - passing a path like "D:Backups" (with a missing backslash) crashes the SQL Server instance (thanks Michael K Campbell for bringing this up).
If I put a "valid" path that doesn't exist, I get the correct behavior ("cannot find the path specified") in 2017.
This is a bug - in both CU 13 and the hotfix build. Passing incorrect parameters to the BACKUP
or RESTORE
commands shouldn't crash the service or kill your session. You can report it on the feedback site.
Note: the service-crashing version of this bug can be reproduced in the latest public preview version of SQL Server 2019 (CTP2.2 - thanks to Denis Rubashkin for pointing this out)
Looking at this in a debugger, it seems that path validation code is simply broken. It ends up causing a stack overflow by recursively calling into sqlmin!CheckFileStreamReserved
after the normal (and quite extensive) checks on the supplied path fail to make sense of it. The stack overflow brings down the service on build 3048. The same thing happens on 3049 except a sequence of access violations while attempting to handle the stack overflow instead breaks the connection rather than stopping the whole server.
A fix for this bug will be issued soon.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "182"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230419%2fsql-server-2017-crashes-when-backing-up-because-filepath-is-wrong%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I was able to reproduce this.
On 2016, if I put an invalid path like that, I get this message:
Cannot open backup device 'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'. Operating system error 3(The system cannot find the path specified.)
On 2017 CU 13 (14.0.3048.4), it results in the service crashing. You've already mentioned that in the latest hotfix (14.0.3049.1), the service doesn't crash, but the session is killed.
I've confirmed the same exact behavior applies to RESTORE DATABASE
as well - passing a path like "D:Backups" (with a missing backslash) crashes the SQL Server instance (thanks Michael K Campbell for bringing this up).
If I put a "valid" path that doesn't exist, I get the correct behavior ("cannot find the path specified") in 2017.
This is a bug - in both CU 13 and the hotfix build. Passing incorrect parameters to the BACKUP
or RESTORE
commands shouldn't crash the service or kill your session. You can report it on the feedback site.
Note: the service-crashing version of this bug can be reproduced in the latest public preview version of SQL Server 2019 (CTP2.2 - thanks to Denis Rubashkin for pointing this out)
Looking at this in a debugger, it seems that path validation code is simply broken. It ends up causing a stack overflow by recursively calling into sqlmin!CheckFileStreamReserved
after the normal (and quite extensive) checks on the supplied path fail to make sense of it. The stack overflow brings down the service on build 3048. The same thing happens on 3049 except a sequence of access violations while attempting to handle the stack overflow instead breaks the connection rather than stopping the whole server.
A fix for this bug will be issued soon.
add a comment |
I was able to reproduce this.
On 2016, if I put an invalid path like that, I get this message:
Cannot open backup device 'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'. Operating system error 3(The system cannot find the path specified.)
On 2017 CU 13 (14.0.3048.4), it results in the service crashing. You've already mentioned that in the latest hotfix (14.0.3049.1), the service doesn't crash, but the session is killed.
I've confirmed the same exact behavior applies to RESTORE DATABASE
as well - passing a path like "D:Backups" (with a missing backslash) crashes the SQL Server instance (thanks Michael K Campbell for bringing this up).
If I put a "valid" path that doesn't exist, I get the correct behavior ("cannot find the path specified") in 2017.
This is a bug - in both CU 13 and the hotfix build. Passing incorrect parameters to the BACKUP
or RESTORE
commands shouldn't crash the service or kill your session. You can report it on the feedback site.
Note: the service-crashing version of this bug can be reproduced in the latest public preview version of SQL Server 2019 (CTP2.2 - thanks to Denis Rubashkin for pointing this out)
Looking at this in a debugger, it seems that path validation code is simply broken. It ends up causing a stack overflow by recursively calling into sqlmin!CheckFileStreamReserved
after the normal (and quite extensive) checks on the supplied path fail to make sense of it. The stack overflow brings down the service on build 3048. The same thing happens on 3049 except a sequence of access violations while attempting to handle the stack overflow instead breaks the connection rather than stopping the whole server.
A fix for this bug will be issued soon.
add a comment |
I was able to reproduce this.
On 2016, if I put an invalid path like that, I get this message:
Cannot open backup device 'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'. Operating system error 3(The system cannot find the path specified.)
On 2017 CU 13 (14.0.3048.4), it results in the service crashing. You've already mentioned that in the latest hotfix (14.0.3049.1), the service doesn't crash, but the session is killed.
I've confirmed the same exact behavior applies to RESTORE DATABASE
as well - passing a path like "D:Backups" (with a missing backslash) crashes the SQL Server instance (thanks Michael K Campbell for bringing this up).
If I put a "valid" path that doesn't exist, I get the correct behavior ("cannot find the path specified") in 2017.
This is a bug - in both CU 13 and the hotfix build. Passing incorrect parameters to the BACKUP
or RESTORE
commands shouldn't crash the service or kill your session. You can report it on the feedback site.
Note: the service-crashing version of this bug can be reproduced in the latest public preview version of SQL Server 2019 (CTP2.2 - thanks to Denis Rubashkin for pointing this out)
Looking at this in a debugger, it seems that path validation code is simply broken. It ends up causing a stack overflow by recursively calling into sqlmin!CheckFileStreamReserved
after the normal (and quite extensive) checks on the supplied path fail to make sense of it. The stack overflow brings down the service on build 3048. The same thing happens on 3049 except a sequence of access violations while attempting to handle the stack overflow instead breaks the connection rather than stopping the whole server.
A fix for this bug will be issued soon.
I was able to reproduce this.
On 2016, if I put an invalid path like that, I get this message:
Cannot open backup device 'D:mapbenefits_LogBackup_2019-02-21_13-58-24.bak'. Operating system error 3(The system cannot find the path specified.)
On 2017 CU 13 (14.0.3048.4), it results in the service crashing. You've already mentioned that in the latest hotfix (14.0.3049.1), the service doesn't crash, but the session is killed.
I've confirmed the same exact behavior applies to RESTORE DATABASE
as well - passing a path like "D:Backups" (with a missing backslash) crashes the SQL Server instance (thanks Michael K Campbell for bringing this up).
If I put a "valid" path that doesn't exist, I get the correct behavior ("cannot find the path specified") in 2017.
This is a bug - in both CU 13 and the hotfix build. Passing incorrect parameters to the BACKUP
or RESTORE
commands shouldn't crash the service or kill your session. You can report it on the feedback site.
Note: the service-crashing version of this bug can be reproduced in the latest public preview version of SQL Server 2019 (CTP2.2 - thanks to Denis Rubashkin for pointing this out)
Looking at this in a debugger, it seems that path validation code is simply broken. It ends up causing a stack overflow by recursively calling into sqlmin!CheckFileStreamReserved
after the normal (and quite extensive) checks on the supplied path fail to make sense of it. The stack overflow brings down the service on build 3048. The same thing happens on 3049 except a sequence of access violations while attempting to handle the stack overflow instead breaks the connection rather than stopping the whole server.
A fix for this bug will be issued soon.
edited Feb 25 at 13:32
answered Feb 21 at 20:27
Josh DarnellJosh Darnell
6,75522140
6,75522140
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230419%2fsql-server-2017-crashes-when-backing-up-because-filepath-is-wrong%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown