labrad / pylabrad

python interface for labrad
50 stars 31 forks source link

Server exceptions generate unicode error #354

Open jeffdotthompson opened 6 years ago

jeffdotthompson commented 6 years ago

We recently set up labrad on a new computer (Win10, Anaconda python environment, py 2.7.15) and our servers are behaving strangely. In particular, whenever a server raises an exception, the client sees the following exception:

cam.acquireSingle(r'I:\thompsonlab\AMO\Daily\1808\180824\test\test.png') Traceback (most recent call last): File "", line 1, in File "C:\ProgramData\Anaconda2\lib\site-packages\labrad\client.py", line 65, in call return f.result() if wait else f File "C:\ProgramData\Anaconda2\lib\site-packages\concurrent\futures_base.py", line 462, in result return self.get_result() File "C:\ProgramData\Anaconda2\lib\site-packages\concurrent\futures_base.py", line 414, in get_result raise exception_type, self._exception, self._traceback labrad.types.types.Error: (0) TypeError("'unicode' does not have the buffer interface",) [payload=None]

It is always a unicode error, regardless of the exception raised by the underlying server function.

A workaround that we discovered is to set sendTracebacks=False in the server. This works fine.

However, we have not figured out the origin of the issue, or why it does not occur on any of our other computers. Since it appears that twisted is heavily involved in this, we tried downgrading from 18.7.0 to 17.1.0 (which is in use elsewhere in our lab), but this did not change anything.

Thanks!

DanielSank commented 6 years ago

Heya @jeffdotthompson, nice to see you in cyberspace.

However, we have not figured out the origin of the issue, or why it does not occur on any of our other computers

To clarify, are the other computers running the same OS and Python interpreter?

jeffdotthompson commented 6 years ago

Hi, Dan! Actually, the other computers are different--they are all running Windows 7 and Python 2.7.13.

maffoo commented 6 years ago

@jeffdotthompson, which version of pylabrad are you using on the server machines?

jeffdotthompson commented 6 years ago

Here's a running list of versions--if there's anything else you want me to add, or think that I should try downgrading, please let me know!

Not working (generates unicode error): -Win10, Python 2.7.15, labrad 0.97.2, twisted 18.7.0 (also tried 17.1.0)

Working: -Win7, Python 2.7.13, labrad 0.97.2, twisted 17.9.0

DanielSank commented 6 years ago

I would definitely recommend starting with something that works, and changing one thing at a time until you see what breaks. Then we know where to look. I'd start with the Twisted version and go from there.

jeffdotthompson commented 6 years ago

I agree that that would be the best approach, but given that we have a workaround, we probably aren't going to break any working systems in the name of further troubleshooting. I mainly wanted to post it to github so the solution would be available to others!

On Thu, Aug 30, 2018 at 7:23 PM Daniel Sank notifications@github.com wrote:

I would definitely recommend starting with something that works, and changing one thing at a time until you see what breaks. Then we know where to look. I'd start with the Twisted version and go from there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/labrad/pylabrad/issues/354#issuecomment-417499317, or mute the thread https://github.com/notifications/unsubscribe-auth/AFRyo4m0c-p9GqQOV_kAhumnZk6n6ZNmks5uWHQDgaJpZM4WM710 .