Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
Hi,
I am using manageontap-5.3.jar from scala and I am seeing this error intermittently when trying to create/delete snapshots:
not authorized for that command (errno=13003)
Here is the code that I am using in order to reproduce this (can rewrite in java if needed, but its fairly self-explanatory)
import netapp.manage.{NaAPIFailedException, NaElement, NaServer}
val srvr = new netapp.manage.NaServer("ourserver",1,20)
srvr.setStyle(NaServer.STYLE_LOGIN_PASSWORD)
srvr.setAdminUser("ouruser", "ourpass")
srvr.setVserver("vs01")
val api = new NaElement("snapshot-create")
api.addNewChild("comment","User=" + System.getProperty("user.name"))
api.addNewChild("snapshot","testsnapshot11")
api.addNewChild("volume","volumenamehere")
srvr.invokeElem(api)
It is quite easy to reproduce this error, I can run the above code several times (changing the snapshot name), and it would work sometimes and not others, which makes the "not authorized" error confusing, since I would expect to be either authorized with the given credentials all the time or never!
Also, on occasion when it works, I also see a NullPointerException when using snapshot-list-info. e.g. running this immediately after the above code:
val api2 = new NaElement("snapshot-list-info")
api2.addNewChild("volume","HTD_na_test")
val res = srvr.invokeElem(api2)
// throws nullpointerexception
Also worth noting that snapshot-delete always fails with the above message. I am not sure how to proceed, please advise.
Thank you
David
Hi David,
NMSDK does not officially support scala.
However, we will try to fiigure out the root cause of this failure.
Can you reproduce the same issue using the "apitest" tool?
You can find the script under "<nmsdk_root>/src/sample/Data_ONTAP/Java/apitest" directory.
You can run the tool as:
#javac -cp <path to manageontap jar> apitest.java
#java -cp <path to manageontap jar>:. apitest -v vs01 ourserver ouruser ourpass snapshot-create snapshot testsnapshot11 volume volumenamehere
Also, please let us know what client system (operating system and java versions) and Data ONTAP version you are using.
Regards,
Sen.
Hi,
Thanks for your reply, I just ran the test you suggested, which is reproducing the same issue that we are seeing from Scala. It worked the first time, then consequent runs gave "not authorized for that command (errno=13003)" errors
[d.riley@wint-app-vm168 apitest]$ java -cp ~/manageontap-5.3.jar:. apitest -v vs01 wint-filer-clust1 <our user> <our pass> snapshot-create snapshot testsnapshot11 volume <our volume name>
OUTPUT:
<results status='passed'/>
[d.riley@wint-app-vm168 apitest]$ ll /network/<our volume name>/.snapshot
total 88
drwxr-xr-x 20 kxdev KDBUserDev 8192 Feb 7 17:21 daily.2015-02-08_0010
drwxr-xr-x 20 kxdev KDBUserDev 8192 Feb 8 17:21 daily.2015-02-09_0010
drwxr-xr-x 18 kxdev KDBUserDev 8192 Dec 31 17:23 monthly.2015-01-01_0005
drwxr-xr-x 20 kxdev KDBUserDev 8192 Jan 31 17:21 monthly.2015-02-01_0005
drwxr-xr-x 20 kxdev KDBUserDev 8192 Jan 7 13:47 snap_07_01_2015__15_28_59
drwxr-xr-x 20 kxdev KDBUserDev 8192 Feb 8 17:21 snapmirror.6cc6bdbc-6631-11e2-ac31-123478563412_2147484774.2015-02-09_150500
drwxr-xr-x 20 kxdev KDBUserDev 8192 Jan 14 17:21 test123
drwxr-xr-x 20 kxdev KDBUserDev 8192 Jan 14 17:21 test1234
drwxr-xr-x 20 kxdev KDBUserDev 8192 Feb 8 17:21 testsnapshot11
drwxr-xr-x 20 kxdev KDBUserDev 8192 Jan 31 17:21 weekly.2015-02-01_0015
drwxr-xr-x 20 kxdev KDBUserDev 8192 Feb 7 17:21 weekly.2015-02-08_0015
[d.riley@wint-app-vm168 apitest]$ java -cp ~/manageontap-5.3.jar:. apitest -v vs01 wint-filer-clust1 <our user> <our pass> snapshot-create snapshot testsnapshot12 volume <our volume name>
netapp.manage.NaAPIFailedException: not authorized for that command (errno=13003)
[d.riley@wint-app-vm168 apitest]$ java -cp ~/manageontap-5.3.jar:. apitest -v vs01 wint-filer-clust1 <our user> <our pass> snapshot-create snapshot testsnapshot13 volume <our volume name>
netapp.manage.NaAPIFailedException: not authorized for that command (errno=13003)
Please advise how to diagnose why this is occuring.
Thank you
David
Hi David,
Can you please let us know what client (operating system), java version and Data ONTAP version you are using?
Regards,
Sen.
Hi,
Sorry -
Red Hat Linux wint-app-vm168 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
The node we are using to test this is running on Data ONTAP 8.2.1
Thanks
David