Community discussions

MikroTik App
 
JSchoenecker
just joined
Topic Author
Posts: 3
Joined: Mon Apr 21, 2014 5:38 pm

Fetch for .json files in an automated script

Thu Jan 14, 2016 11:23 pm

We are trying to write an automated script to run after we get a CPE installed and it works if we tell it to run scripts ourselves, but if is ran by scheduler we get this error.

script,error script error: failure: cannot open file: permission denied

Have tried everything we can to get this to work. Have seen where dst-path people are having issues. The only thing I have gotten it to work with is changing the file extension from .json to any other 3 character combination and it will work. But all skins must be .json to work and we are not allowed to change filenames with scripts. I have tried pulling just the .json without any dst-path just to see if it would put it in main directory and still got same error. I have pulled the .json to a .jso to dst-path=skin.jso and it works. We have tried different modes and different fetch commands and nothing works. We have tried setting owner on all scripts to a full access account and still same error. Made sure correct options are checked on the script policies, even tried with all turned on, same with scheduler. have tried creating it's own script to run the fetch then remove the script once is finished and still same error.

Here is the fetch command we are currently using but still trying different things to get it to work.
/tool fetch url=http://locationOfFileByIP/skinname.json mode=http dst-path=skins/skinname.jso

It seems to be an issue with how long the file extension is on an automated script. I am testing now with .jsog just to see if get the same error as with .json. Changing it from .jso to .jsog it would download the file but still get error trying to create user group since skin was not found. Have been trying to get this to work for about a day now and have exhausted all options I can think of and have asked others in my department.

Any and all help would be appreciated.
 
JSchoenecker
just joined
Topic Author
Posts: 3
Joined: Mon Apr 21, 2014 5:38 pm

Re: Fetch for .json files in an automated script

Fri Jan 15, 2016 10:56 pm

Have also tried to create an .rsc file that it fetched with the fetch for the .json file in it. Still getting same error. RouterOS is 6.30 with updated firmware, and this is on SXT (all different styles) and QRT 5.
 
JSchoenecker
just joined
Topic Author
Posts: 3
Joined: Mon Apr 21, 2014 5:38 pm

Re: Fetch for .json files in an automated script

Wed Jan 20, 2016 5:58 pm

We have finally got it to work. We were trying to check for existing configuration if found reset board with no defaults and then run the import again. When it done this it would set the owner of the schedulers as *sys and that is why we were getting the permission denied. We could not get it to set owner of scheduler to anything else so we just have it so field techs have to run the import twice if they forget to remove default configuration.

Didn't fix the problem where our field techs only have to import once, but we did resolve the problem so that they can get everything configured easier then before.
 
viktorc
just joined
Posts: 18
Joined: Mon Jun 05, 2006 4:00 pm

Re: Fetch for .json files in an automated script

Wed Dec 13, 2017 11:54 am

Hello,

have same problem without solution.

See viewtopic.php?f=9&t=98385&p=632029#p631506