The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Software Development Kit (SDK) and API Discussions

Python SDK Issue: Couldn't find end of Start Tag netapp

salalonde

I get the following problem when trying to use the SDK with Python (2.7, 3.3, or 3.4). If I intentionally put bad credentials I get authentication failure, so I think it is getting to the Netapp.

 

python apitest.py -s <myfiler> admin <mypassword> system-get-version

 

OUTPUT:
<results status="failed" errno="13001" reason="Couldn't find end of Start Tag netapp "></results>

 

Any ideas?

2 REPLIES 2

IST

Had same problem with Perl, turned out that my Linux distribution had some bad characters on the first line of /etc/issue, a dirty quick solution was to delete that first line so I got a hit on a text-string.

 

Problem is in the SDK (Perl in this case, guess it is the same in Python.

 

In NaServer.pm:

 

sub get_platform_info .....

 

if ($osType eq 'linux') {
if (-e "/etc/SuSE-release") {
chomp($osName = `head -n 1 /etc/SuSE-release`);
} else {
choIn mp($osName = `head -n 1 /etc/issue`);
}
if ($osName =~ m/(.*?) \(.*?\)/) {
$osName = $1;
}
chomp($processor = `uname -p`);
$osInfo = $osName . " " . $processor;
}

 

As you see, it does a head -n 1 /etc/issue.

 

Of course, you might have a completly diffrent problem, but it is worth looking into.

 

You can add set_debug_style("NA_PRINT_DONT_PARSE") (don't know the Python syntax here, but should be similar) to your code and get some verbose debug.

 

salalonde

Thanks!!!

 

Your reply got me pointed in the right direction and I managed to find a workaround. My employer has a large security blurb in /etc/issue and I guess the API doesn't like it. Rather than changing /etc/issue, I updated the code a bit so it would be able to find my OS. For the benefit of anyone else who finds this, in NaServer.py I changed:

 

if os.path.isfile("/etc/SuSE-release"):

    pipe = os.popen('head -n 1 /etc/SuSE-release')

else:

    pipe = os.popen("head -n 1 /etc/issue")

 

 

to:

 

if os.path.isfile("/etc/SuSE-release"):

    pipe = os.popen('head -n 1 /etc/SuSE-release')

elif os.path.isfile("/etc/redhat-release"):

    pipe = os.popen('head -n 1 /etc/redhat-release')

else:

    pipe = os.popen("head -n 1 /etc/issue")

 

 

Thanks again. This has been driving me crazy for a long time.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public