lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

uploadTestCaseAttachment() raise ProtocolError: 500 Internal Server Error #116

Closed yuechuanx closed 5 years ago

yuechuanx commented 5 years ago

Try to run TestLinkExample.py in python version 3.5, then got a Error as follows:

Traceback (most recent call last):
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/site-packages/testlink/testlinkapigeneric.py", line 1992, in _callServer
    response = getattr(self.server.tl, methodNameAPI)(argsAPI)
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/xmlrpc/client.py", line 1092, in __call__
    return self.__send(self.__name, args)
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/xmlrpc/client.py", line 1432, in __request
    verbose=self.__verbose
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/xmlrpc/client.py", line 1134, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/xmlrpc/client.py", line 1167, in single_request
    dict(resp.getheaders())
xmlrpc.client.ProtocolError: <ProtocolError for localhost/lib/api/xmlrpc/v1/xmlrpc.php: 500 Internal Server Error>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xiaoy/PycharmProjects/TLVisualizer/TestLinkExample.py", line 693, in <module>
    description='PNG Attachment Example for a TestCase')
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/site-packages/testlink/testlinkdecorators.py", line 168, in wrapperAddAttachment
    return methodAPI(self, *argsPositional, **argsAttachment)
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/site-packages/testlink/testlinkdecorators.py", line 100, in wrapperWithArgs
    *argsPositional, **argsOptional)
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/site-packages/testlink/testlinkapigeneric.py", line 1517, in callServerWithPosArgs
    response = self._callServer(methodNameAPI, argsOptional)
  File "/Users/xiaoy/anaconda3/envs/py35/lib/python3.5/site-packages/testlink/testlinkapigeneric.py", line 1996, in _callServer
    raise testlinkerrors.TLConnectionError(new_msg)
testlink.testlinkerrors.TLConnectionError: problems connecting the TestLink Server http://localhost/lib/api/xmlrpc/v1/xmlrpc.php
<ProtocolError for localhost/lib/api/xmlrpc/v1/xmlrpc.php: 500 Internal Server Error>

code position is here: image

lczub commented 5 years ago

Hello Yuechuan Xiao,

the 500 Internal Server Error indicates, that the Testlink Server itself runs into a code error, either in its php source or sql statements. One starting point for debugging the reason would be analyse the the error log of your httpd server or to observe it (e..g tail -f /var/log/appache2/error.log), while you are running TestLinkExample.py.

I tested the client release with py27 and py36, while you are using py35. But i guess, this should make no difference. More interessting beside the httpd error log messages would be, which TestLink Server version you use and which TestLink-API-Python-client version.

Regards Luiko

yuechuanx commented 5 years ago

Sorry I haven't got back to you sooner.

Yes, i tried py36 & py37 & py27 to run the script but just same result. so python version is not the cause and I use docker file to build TestLink server(docker image from bitnami), i'm not sure where the logs file locates.

I will try another TestLink version and TestLink-API-Python-client version. Hope it will fix it.

Thanks for the quick reply.