Inject and delete - can it lead to disaster?

Post Reply
cwswitch
Member
Posts: 95
Joined: Fri Feb 24, 2017 12:25 am

Inject and delete - can it lead to disaster?

Post by cwswitch »

Hi all,

If we Inject with the standard Inject tool and have it set to delete - can we have a disaster if:

1) the file does not exist
2) the path resolves to null

Scenarios may be

1) A signal from an MIS to archive a certain file - but that file was moved by a person or other system ahead of time
2) a bad input giving us path/to/file/null

My concern is from reading viewtopic.php?t=1497
While the stock Inject configurator is extremely powerful, for many operations, it poses a significant risk. The ability to copy and remove a remote file (which may be a variable) is extremely dangerous. The target variable could resolve incorrectly causing the destruction of Switch's own backing files, or other sensative files. In some cases, users have reported using the "Job repository" method of Inject, where "Job name" property resolves to null, which results in the entire repository being injected (and removed).
Thanks
User avatar
tdeschampsBluewest
Member
Posts: 64
Joined: Tue Jun 01, 2021 11:57 am

Re: Inject and delete - can it lead to disaster?

Post by tdeschampsBluewest »

Hi,
It's a very old post (from 2016, so 8 year ago). The default "inject" element have been redesigned by Enfocus and now support a "fail" outgoing connection.

There is no reason to be afraid of inject a file, except if it's from a switch folder, where it can lead to some odd behaviour with switch client until the next clean-up.

I strongly suggest you to use a loop, with the retry-it app + hold job set at few minutes, just to avoid conflict if the file is open by someone-else at the time of injection.
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
cwswitch
Member
Posts: 95
Joined: Fri Feb 24, 2017 12:25 am

Re: Inject and delete - can it lead to disaster?

Post by cwswitch »

Ok, this is great news and comforting to hear. Thank you.
cwswitch
Member
Posts: 95
Joined: Fri Feb 24, 2017 12:25 am

Re: Inject and delete - can it lead to disaster?

Post by cwswitch »

I'm still a little worried here.

Lets say we have a hardcoded path and a some data, but in some scenario the data is missing.
  • Good scenario: /path/to/job/variable
  • Bad scenario: /path/to/job/
In the bad scenario the data for the variable is missing.

Would Switch inject the entire folder and delete it?
User avatar
magnussandstrom
Advanced member
Posts: 437
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Inject and delete - can it lead to disaster?

Post by magnussandstrom »

If /path/to/job/variable does not exist the job goes to fail output. Nothing will happen with /path/to/job/. It's easy to test this scenario if you are still worried.
cwswitch
Member
Posts: 95
Joined: Fri Feb 24, 2017 12:25 am

Re: Inject and delete - can it lead to disaster?

Post by cwswitch »

Great to know thanks.

Scary thing to test though :D
Post Reply