Perspective Mapping a Network Drive

I am trying to map a network drive in Perspective.

I went over the following page and I think I did everything
https://docs.inductiveautomation.com/display/DOC81/Mapping+a+Network+Drive

I think I have tried every possible combination of the path. I also turned on the wrapper.debug and down see anything useful there.

ignition.conf
1

script
2

error
3

Even if you solve your problem (probably network rights in the service account), you are setting yourself up for grief. When the target server reboots or is briefly unavailable, or is unavailable when Ignition starts, this breaks. Ignition won't reconnect without a (another) gateway restart.

Use UNC paths for all network resources. Run the gateway service with a domain account that has privileges to all the needed network resources. This is the only robust way to do this.

6 Likes

I am currently running this on my box and I have access to all of those resources but I cannot access those files. I can if I use the script console. I went through a bunch of posts on this on thought this was the way to go.

How do I define the account that runs the gateway service?

The gateway runs as a service. It is totally separate from whatever you do on the desktop on that box. Go to computer management, find services, find the Ignition service, and alter it to run with a suitably privileged account. (You might have to dig around--I avoid Windows like the plague, myself.)

Keep in mind that whatever you do in your own box will have to be set up similarly in a production environment. That might be much more trouble.

Consider not using an external network resource, but instead expose a network resource (named share) from the gateway. Then Ignition needs no dedicated user account for privileges, just read/write access to the folder you expose. Then you grant privileges as appropriate to the external consumers of the data.

I am sorry but you lost me here. Is there some documentation you could point me to. Thank you very much for this.

No, I avoid the plague that is Windows. Others here can chime in if they please.

However, if you right-click on any arbitrary folder on a local disk in Windows, and open "Properties", one of the tabs available is "Sharing". Setting that up makes that folder reachable from other Windows machines just like mapping to any other file server.

So I tried this and now the gateway will not start. I tried going back and running the installation and nothing. Service will not start

Never mind, I forgot that I tried

wrapper.share.1.startup.failure=SHUTDOWN

Apparently that works and drive was not mapping

So I was able to get the firs thing working.

On our drives we have network drives that are mapped and I was trying to map a folder on one of those drives. I tried to map the root drive that we map to our network drives and that worked.

Just so you know that it will break if the mapped drive is ever not available when Ignition starts. And if it ever becomes unavailable after Ignition is started, you have to restart Ignition to make it work again.

Just because IA documents this drive mapping option doesn't make it a good idea.

1 Like

Would you please show us details? How do you tie your local folder and a network folder?

I have circled back to this and would like to get this working properly,

As a test,
I am logged into my dev box with an account that has access to the network drive in question and I starting the service with the same account.

If I use os.path.exists in the Script Console I get true. If I use os.path.exists in a view I get false.

Using a drive letter? Completely expected.

Test using a UNC path instead of a drive letter.

I am using UNC in both places

Well, you've exhausted my experience with Windows. UNC paths work where I've done this, where the service user account's name and password were acceptable to the network share.

That's the rub. I have access to the drive but I am not able to share it.

I don't think you will succeed until IT allows your network share to trust the gateway service's user (in a domain environment) or user/password (non-domain).

3 Likes

I am back to this. It is not working and I am not getting any debug entries in the wrapper log.

wrapper.debug = TRUE

wrapper.share.1.location=\fileserver\folder
wrapper.share.1.target=Z:
wrapper.share.1.type=DISK

wrapper.ntservice.account=user
wrapper.ntservice.password=password
wrapper.share.1.account=domain\user
wrapper.share.1.password=password

wrapper.share.1.shutdown.unmap=TRUE
wrapper.share.1.startup.max_retries=2
wrapper.share.1.startup.retry_interval=10
wrapper.share.1.startup.failure=SHUTDOWN

Let me repeat: I strongly recommend against using mapped drives. If you get mapped drives working with any credentials in the wrapper, you can use those credentials to run the service to make UNC paths work reliably. :man_shrugging:

I got nothing more for you. Get your IT group to fix this.