system.file.writeFile() and 'Unable to create path to file'

Looking for a bit of a sanity check. Having a file export of the data on the hour for another system to pull in for a customer. It seems to work fine for the first few exports, then all of a sudden it will stop and just put errors in the logs saying 'Unable to create path to file'. I do have the network share mapped in the conf file. I've been exporting local copies as a fall back, but would like to find the root cause.

Is there anything I'm missing on the Ignition side? Or is this likely going to be permissions on the network share itself most likely?

Edit: If communication to the network drive was lost intermittently, would Ignition try and reconnect automatically? Or would a restart have to occur to reconnect?

Yeah, this isn't very reliable. Consider running the Ignition service under a domain account that has privileges on the target file server, then use UNC paths instead of drive letters. But include some timer event that will try to save again later if that fails.

Even better would be to save locally in the gateway, and expose a WebDev endpoint that the external system could use to retrieve the last saved version. (Or generate on the spot--no file saved at all.)

1 Like

Just regarding the .conf file methodology it tries to connect when the gateway starts up but if the connection is lost while the GW is running it will not retry and as far as I can tell (I asked if there was a way to retry programatically via a GW script) it does not seem like there is a way.

Highly recommend using one of the other options Phil listed instead of trying to make the .conf login method be more robust - doesn't seem possible.

2 Likes

Yeah that scenario clicked in my brain right after hitting send. They have some intermittent network issues in that facility, so think that could be our culprit and its just never reconnecting without intervention.

I'll give Phil's solution a shot. Sounds like it should get me there.

1 Like

If you don't have the WebDev module, another option would be to stick the file bytes into your database as a blob, then hand it to external callers with my Blob Server module.

1 Like