njr0 / fish

The Fluidinfo shell; a command line for Fluidinfo
http://fluiddb.fluidinfo.com/about/fish/njr/index.html
MIT License
5 stars 2 forks source link

Can't connect to FluidInfo from fish? #2

Closed rodrigobarnes closed 12 years ago

rodrigobarnes commented 12 years ago

This is probably a newbie error, but in running fish from a vanilla git clone + credentials, I get a 404 error reported:

This is fish version 4.29.
Synchronizing . . . Fish failure:
  Bad status 404 (expected 200)
synchronized.

> ```
> ```

Environment is OS X Lion, X11, Python 2.7.1, fish github commit "3396f4b3585bcda6e8712638920496c2c7ac4221
". 

Similar error obtains when running fish test:

bash-3.2$ ./fish test ................E.......

ERROR: testValuesAPISetGet (testfish.TestFluidinfo)

Traceback (most recent call last): File "/Users/rodrigo/workspace/fish/testfish.py", line 96, in testValuesAPISetGet db.tag_by_query(query, tagsToSet) File "/Users/rodrigo/workspace/fish/fishlib.py", line 1086, in tag_by_query (v, r) = self.call(u'PUT', u'/values', strHash, {u'query': query}) File "/Users/rodrigo/workspace/fish/fishlib.py", line 518, in call % (len(url), url)) Exception: URL Fetch failure (URL len 104): http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22


Ran 24 tests in 40.026s

njr0 commented 12 years ago

Hi Rodrigo

No, I think they're both my fault. Thanks for mailing; it's a reason to fix things.

I think the first one is probably because you haven't typed fish init. It should probably figure that out and do it for you.

I've seen the second one running against python 2.7. I'm not sure, yet, what causes it. It's some kind of unicode/UTF-8/encoding thing. I should obviously fix it. (It doesn't occur with python 2.5 or 2.6, as far as I can see.)

They're both bad; thanks for encouraging me to fix them.

If fish init doesn't fix it, let me know.

Regards

Nick

On 25 Jan 2012, at 10:07, rodrigobarnes wrote:

This is probably a newbie error, but in running fish from a vanilla git clone + credentials, I get a 404 error reported:

This is fish version 4.29.
Synchronizing . . . Fish failure:
 Bad status 404 (expected 200)
synchronized.

> ```
> ```

Environment is OS X Lion, X11, Python 2.7.1, fish github commit "3396f4b3585bcda6e8712638920496c2c7ac4221
". 

Similar error obtains when running fish test:

bash-3.2$ ./fish test ................E.......

ERROR: testValuesAPISetGet (testfish.TestFluidinfo)

Traceback (most recent call last): File "/Users/rodrigo/workspace/fish/testfish.py", line 96, in testValuesAPISetGet db.tag_by_query(query, tagsToSet) File "/Users/rodrigo/workspace/fish/fishlib.py", line 1086, in tag_by_query (v, r) = self.call(u'PUT', u'/values', strHash, {u'query': query}) File "/Users/rodrigo/workspace/fish/fishlib.py", line 518, in call % (len(url), url)) Exception: URL Fetch failure (URL len 104): http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22


Ran 24 tests in 40.026s



---

Reply to this email directly or view it on GitHub:
https://github.com/njr0/fish/issues/2

Nicholas J Radcliffe Stochastic Solutions Limited. www.stochasticsolutions.com njr@stochasticsolutions.com +44 7713 787 602

njr0 commented 12 years ago

Ah...the first part of that (fish init) is nonsense. (I just tried it.) I'll look into them both.

Regards

Nick

On 25 Jan 2012, at 10:07, rodrigobarnes wrote:

This is probably a newbie error, but in running fish from a vanilla git clone + credentials, I get a 404 error reported:

This is fish version 4.29.
Synchronizing . . . Fish failure:
 Bad status 404 (expected 200)
synchronized.

> ```
> ```

Environment is OS X Lion, X11, Python 2.7.1, fish github commit "3396f4b3585bcda6e8712638920496c2c7ac4221
". 

Similar error obtains when running fish test:

bash-3.2$ ./fish test ................E.......

ERROR: testValuesAPISetGet (testfish.TestFluidinfo)

Traceback (most recent call last): File "/Users/rodrigo/workspace/fish/testfish.py", line 96, in testValuesAPISetGet db.tag_by_query(query, tagsToSet) File "/Users/rodrigo/workspace/fish/fishlib.py", line 1086, in tag_by_query (v, r) = self.call(u'PUT', u'/values', strHash, {u'query': query}) File "/Users/rodrigo/workspace/fish/fishlib.py", line 518, in call % (len(url), url)) Exception: URL Fetch failure (URL len 104): http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22


Ran 24 tests in 40.026s



---

Reply to this email directly or view it on GitHub:
https://github.com/njr0/fish/issues/2

Nicholas J Radcliffe Stochastic Solutions Limited. www.stochasticsolutions.com njr@stochasticsolutions.com +44 7713 787 602

njr0 commented 12 years ago

Hey Rodrigo

The first problem you had is just a straightforward bug I don't see because I have stuff defined. Sorry about that.

The easy, short term fix is to say (at least)

fish touch .fish/alias fish perms private .fish/alias

which will create the tag whose non-existence is causing the problem. Obviously I'll change things so it does that for you, but it might be a few days ebfore I can easily get that to Github because I made some other changes that are an improvement but need a little bit more bedding down.

(Obviously, I could patch, but I'd rather just do it all together.)

Nick

On 25 Jan 2012, at 10:07, rodrigobarnes wrote:

This is probably a newbie error, but in running fish from a vanilla git clone + credentials, I get a 404 error reported:

This is fish version 4.29.
Synchronizing . . . Fish failure:
 Bad status 404 (expected 200)
synchronized.

> ```
> ```

Environment is OS X Lion, X11, Python 2.7.1, fish github commit "3396f4b3585bcda6e8712638920496c2c7ac4221
". 

Similar error obtains when running fish test:

bash-3.2$ ./fish test ................E.......

ERROR: testValuesAPISetGet (testfish.TestFluidinfo)

Traceback (most recent call last): File "/Users/rodrigo/workspace/fish/testfish.py", line 96, in testValuesAPISetGet db.tag_by_query(query, tagsToSet) File "/Users/rodrigo/workspace/fish/fishlib.py", line 1086, in tag_by_query (v, r) = self.call(u'PUT', u'/values', strHash, {u'query': query}) File "/Users/rodrigo/workspace/fish/fishlib.py", line 518, in call % (len(url), url)) Exception: URL Fetch failure (URL len 104): http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22


Ran 24 tests in 40.026s



---

Reply to this email directly or view it on GitHub:
https://github.com/njr0/fish/issues/2

Nicholas J Radcliffe Stochastic Solutions Limited. www.stochasticsolutions.com njr@stochasticsolutions.com +44 7713 787 602

rodrigobarnes commented 12 years ago

Hi Nick

Thanks for the notes - I tried what you suggested (both init and the alias settings) and although I get the shell working, I still get the failing test.

If you go directly via the web, the URL in the test gives a 404 (actually, an odd blank page but that must be the way fluiddb returns 404.)

http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22

Cheers

Rodrigo

njr0 commented 12 years ago

Yes, the failing test is something different.

I have fixed the problem starting an interactive shell the first time on my working copy, but it's movd to using requests rather than httplib2. This is a huge improvement, but I think I'd like to offer a fallback to httplib2, as that's more widespread.

I'll look at the unicode problem: maybe it's something simple!

Nick

On 25 Jan 2012, at 11:24, rodrigobarnes wrote:

Hi Nick

Thanks for the notes - I tried what you suggested (both init and the alias settings) and although I get the shell working, I still get the failing test.

If you go directly via the web, the URL in the test gives a 404 (actually, an odd blank page but that must be the way fluiddb returns 404.)

http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22

Cheers

Rodrigo


Reply to this email directly or view it on GitHub: https://github.com/njr0/fish/issues/2#issuecomment-3649074


Nicholas J Radcliffe Stochastic Solutions Limited. www.stochasticsolutions.com njr@stochasticsolutions.com +44 7713 787 602

njr0 commented 12 years ago

Hi Rodrigo

I pushed a new version to git that should solve both your problems. (You can verify that, if you particularly want to, by doing

fish rm .fish/alias

checking that

fish

fails again, then updating and trying the new one.

FYI:

  1. The reason for the test failure was that I was lazily creating a JSON serialization by hand and wasn't encoding non-ASCII characters properly. For some reason, that didn't cause a problem in versions of python before 2.7, but httplib complained in 2.7. I'm now doing it properly.
  2. The new version defaults to using Kenneth Reitz's requests library, which seems dramatically more reliable than httplib2 to me, though it falls back to that if requests is not available. Strangely, however, in the last few days, Kenneth Reitz seems to have upgraded requests from 0.9.2 to 1.0.0 or 1.0.1, and fish isn't working with that. He has made non-backwards-compatible changes, but it looks like something different to me. I'll investigate more later. In the meantime, if you want to try it with requests, you need to use something like 0.9.1 or similar. So it does a conditional import for now.

Thanks for pointing out the problems. I'll blog later today or tomorrow probably.

Let me know if there are any problems with the new stuff if you try it.

Regards

Nick

On 25 Jan 2012, at 11:24, rodrigobarnes wrote:

Hi Nick

Thanks for the notes - I tried what you suggested (both init and the alias settings) and although I get the shell working, I still get the failing test.

If you go directly via the web, the URL in the test gives a 404 (actually, an odd blank page but that must be the way fluiddb returns 404.)

http://fluiddb.fluidinfo.com/values?query=fluiddb%2Fabout+%3D+%22%CE%94%CE%91%CE%94%CE%93%CE%91%CE%94%22

Cheers

Rodrigo


Reply to this email directly or view it on GitHub: https://github.com/njr0/fish/issues/2#issuecomment-3649074


Nicholas J Radcliffe Stochastic Solutions Limited. www.stochasticsolutions.com njr@stochasticsolutions.com +44 7713 787 602

rodrigobarnes commented 12 years ago

Hi

looks like your changes fixed both issues thanks! Now I can explore.

Rodrigo

njr0 commented 12 years ago

Cool.

Do shout if you find other problems.

Nick

On 25 Jan 2012, at 19:22, rodrigobarnes wrote:

Hi

looks like your changes fixed both issues thanks! Now I can explore.

Rodrigo


Reply to this email directly or view it on GitHub: https://github.com/njr0/fish/issues/2#issuecomment-3657041


Nicholas J Radcliffe Stochastic Solutions Limited. www.stochasticsolutions.com njr@stochasticsolutions.com +44 7713 787 602

njr0 commented 12 years ago

Fixed