Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to log in to SkySpark with correct credentials #14

Closed
candronikos opened this issue May 31, 2016 · 20 comments
Closed

Failing to log in to SkySpark with correct credentials #14

candronikos opened this issue May 31, 2016 · 20 comments
Assignees
Labels

Comments

@candronikos
Copy link

Tried testing with some simple code with skyspark with the code at the bottom of this issue. The result is posted below:

RESULT

False
<GetGridOperation failed>

CODE

from pyhaystack.client.skyspark import SkysparkHaystackSession
session = SkysparkHaystackSession(uri='http://url_to_server',
                                username='myusername',
                                password='secretpassword',
                                project = 'project')

if(__name__ == '__main__'):
    about = session.about()
    print(session.is_logged_in)
    print(about)
@ChristianTremblay
Copy link
Owner

Thanks for reaching us.

I've tried your snippet using niagara client and it works. Unfortunately, I don't have actually an access to a Skyspark server.
Would you accept to share your login info in private ? I would then be able to look at it.
My email is in my Github profile

@candronikos
Copy link
Author

Hi,

I might be able to create an account on the demo project and hand you the details. I'll see if I can get permission to do this.

@candronikos
Copy link
Author

Hi Christian,

I have just created a temp account and sent you the details

@ChristianTremblay ChristianTremblay self-assigned this Jun 2, 2016
@ChristianTremblay
Copy link
Owner

Actively working on

@sjlongland
Copy link
Collaborator

Is there any publicly visible documentation for SkySpark? I'll admit I ported the old needle sources to the new API blindly, I don't have access to a SkySpark server to test on.

I recall looking on their website for details but didn't see any.

@candronikos
Copy link
Author

beyon-d.net seems to be up to date

@sjlongland
Copy link
Collaborator

Ahh, that's why I didn't spot it, completely different site. :-)

https://www.beyon-d.net/doc/docSkySpark/Rest.html#auth would have been a big help.

@ChristianTremblay
Copy link
Owner

@candronikos Please have a look to : https://github.com/ChristianTremblay/pyhaystack/tree/skyspark_login

I'm able to login, retrieve site, about... but I have some problems with find_entity. Seems to be related to hszinc... I'll give credentials to @sjlongland so he can make tests.

@ChristianTremblay
Copy link
Owner

Forgot one detail : it works on Python 3.... we'll have a look to make it work with Python 2

@candronikos
Copy link
Author

candronikos commented Jun 3, 2016

Tested the code on my machine. Looks good so far! I removed the details of the response body for privacy but they're correct.

Also, I'm using Python 3 anyway so it's not a problem for me

<GetGridOperation done: <Grid>
    Columns:
        productUri
        whoami
        serverBootTime
        projName
        tz
        moduleName
        serverName
        productName
        haystackVersion
        productVersion
        moduleVersion
        serverTime
        hostModel
    Row    0: ""DETAILS_HIDDEN""
</Grid>>

@ChristianTremblay
Copy link
Owner

Troubles appears with :
sensors = session.find_entity(filter_expr='sensor').result

You can join gitter to share more details :
https://gitter.im/ChristianTremblay/pyhaystack

@sjlongland
Copy link
Collaborator

hszinc is tripping up on the grid that gets returned by SkySpark. A simple read of site entities worked, but not equips, there's something there that the parser doesn't like.

I've grabbed a copy of the offending grid and I'll have a look when I get a chance. In the meantime, you can force pyhaystack to use JSON serialisation by using the following:

import hszinc
from pyhaystack.client.skyspark import SkysparkHaystackSession
session = SkysparkHaystackSession(uri='http://xxx',
                         username='xxx, password='xxx, project='xxx', grid_format=hszinc.MODE_JSON)

This is not ideal, but it might get you going.

@ChristianTremblay
Copy link
Owner

ChristianTremblay commented Jun 7, 2016

Remaining bug : Make Python 2 & 3 work
string encoding is giving me a hard time.
https://github.com/ChristianTremblay/pyhaystack/tree/skyspark_login

@ChristianTremblay
Copy link
Owner

578b269

Solve the Python 2/3 compatibility

@jjproe
Copy link

jjproe commented Oct 28, 2016

Hello. I need a Python 2.6 to Skyspark interface. I try long to make it runable. But i have the same Problem with failed

@ChristianTremblay
Copy link
Owner

ChristianTremblay commented Oct 30, 2016

I can't guaranty it'll work on 2.6 as we use a lot of features that are 2.7-3.
Can you be more precise about the bugs you meet ?
Also, be sure to make your tests with dev branch as some bugs have been noticed in Skyspark with master branch.

If it appears to be version related, please open another issue.

@sjlongland
Copy link
Collaborator

I would seriously not bother with Python 2.6. Most platforms have moved on from that release, the only OSes I can think of that depend on that release are circa 2010 or earlier, which should be considered unsupported security liabilities.

Python 2.7 is still supported because Python 3.x support was in its infancy until very recently on most Linux distributions (IMO it's a mess in Debian even in Jessie), and really is on borrowed time: the upstream Python project wants to kill off the 2.x branch.

If you're starting from scratch, I'd seriously recommend going to Python 3.4 or later if possible, as this was the first of the 3.x series that was particularly well supported. If backward compatibility with Python 2 modules is needed, then recent 2.7 is the best option.

@jjproe
Copy link

jjproe commented Oct 31, 2016

Thanks, but the system i will connect runs under SLES 11 (python 2.6.5).
I had read something about "python" environments.. and the possibility to
run both Versions..
But the effort is too big for me...

I only will get a points-list from SkysPark and perhaps import points from
foreign system..

My idea is to minimize your pyhaystack (only communication to SyksPark).. I
don't need numpy or other numerical manipulations under python..
And if hszinc make trouble to run under this python Version, i'll change to
json...

Are my reflections OK ?

2016-10-30 3:19 GMT+01:00 Stuart Longland notifications@github.com:

I would seriously not bother with Python 2.6. Most platforms have moved on
from that release, the only OSes I can think of that depend on that release
are circa 2010 or earlier, which should be considered unsupported security
liabilities.

Python 2.7 is still supported because Python 3.x support was in its
infancy until very recently on most Linux distributions (IMO it's a mess in
Debian even in Jessie), and really is on borrowed time: the upstream Python
project wants to kill off the 2.x branch.

If you're starting from scratch, I'd seriously recommend going to Python
3.4 or later if possible, as this was the first of the 3.x series that was
particularly well supported. If backward compatibility with Python 2
modules is needed, then recent 2.7 is the best option.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#14 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATDM0RWdpFxoFpv01Zl6JzEXaDRv-kbFks5q4_7EgaJpZM4IqNzN
.

@sjlongland
Copy link
Collaborator

On 31/10/16 20:50, jjproe wrote:

And if hszinc make trouble to run under this python Version, i'll change to
json...

Won't make a sceric of difference. hszinc is used in both modes, just
in ZINC mode it does its own serialisation/deserialisation, whereas in
JSON mode, the json module does the heavy lifting.

The same classes are used to represent values in both modes.

There's talk of a Python 2.7 binary as part of the OpenSuSE distribution:
https://forums.suse.com/showthread.php?5293-Python-2-7-for-SLES-11-SP3

SLES 11 is quite dated by the looks of things, so you likely won't see
anything official in terms of Python 2.7 or 3.x. SLES 12 might be worth
investigating, the other option might be to look at Docker and running a

newer Python environment in a container.

Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.

@ChristianTremblay
Copy link
Owner

Locking the issue and linking here : #31

Repository owner locked and limited conversation to collaborators Nov 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants