'The network path was not found' intermittent error only on VPN

조회 수: 15 (최근 30일)
Chris Nygren
Chris Nygren 2024년 3월 29일
댓글: Chris Nygren 2024년 4월 3일
Hello, I have code that scrapes a database and saves data in seperate directories by station, year, and month.
Because I'm pulling data regularly, I have the following code to create a new directory if the directory doesn't yet exist.
if ~exist(stationfolderloc, 'dir');
mkdir(stationfolderloc);
end
stationfolderloc is formatted as '[servername]\[some sub directories]\[station_name]\[year]\[month]' with the station_name, year, and month updating based on the data being pulled.
This never fails when I have a wired ethernet connection to the office network (the directory is on a server on that network). However, when I am out of office and connecting via VPN I inconsistantly get the following error. (is red text)
Error using mkdir
The network path was not found.
Error in [Code_name] (line XXX)
mkdir(stationfolderloc);
However, I am able to navigate to the directory in windows explorer, and have no problem navigating to it in Matlab such that it can be the Current Folder. Using the exist function in Matlab gives an output of 7 (exists and is a directory). Using ~exist(stationfolderloc, 'dir') returns 0. So the 'IF' statement shouldn't even allow the code to get to the mkdir command.
I've setup monitoring for the VPN and confirmed the connection never drops when the error occurs. VPN is FortiClient, if that matters, I've been working with them to troubleshoot and they believe its a matlab issue.
  댓글 수: 2
chrisw23
chrisw23 2024년 4월 3일
It seems to be a security issue. Probably you are authenticated different via VPN. It may be a different group membership that prevents the creation of new folders. This is no Matlab issue.
You can try to map your root folder (ServerShare\...) and access the mapped drive by Matlab.
Chris Nygren
Chris Nygren 2024년 4월 3일
@chrisw23 Thank you for your suggestion. Alas, during troubleshooting I mapped/remapped the location where the error originated and confirmed I was able to access the location through the full path string and the mapped abreviation. I also confirmed I had permissions not only to access but to create directories, execute code, and delete files and directories at that location. I'll reach out to our network team to check on group membership nonetheless. If I find anything I'll update this comment.
Thanks again

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by