AndyGrant / OpenBench

OpenBench is a Distributed SPRT Testing Framework for Chess Engines
GNU General Public License v3.0
149 stars 147 forks source link

Error when registering new machine #35

Closed tryingsomestuff closed 5 years ago

tryingsomestuff commented 5 years ago

I now have a user configured and was able to define Minic engine parameters and submit a job. But when I try to use the client I get this

python3 Client/OpenBench.py -U test -P thegoodpassword -S http://127.0.0.1:8000/ -T 1
<Warning> Machine unregistered, will register with Server
Downloading : <!DOCTYPE html><html lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="content-type"/><title>Page not found at //getFiles/</title><meta content="NONE,NOARCHIVE" name="robots"/><style type="text/css">html * { padding:0; margin:0; } body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; background:#eee; color:#000; } body>div { border-bottom:1px solid #ddd; } h1 { font-weight:normal; margin-bottom:.4em; } h1 span { font-size:60%; color:#666; font-weight:normal; } table { border:none; border-collapse: collapse; width:100%; } td, th { vertical-align:top; padding:2px 3px; } th { width:12em; text-align:right; color:#666; padding-right:.5em; } #info { background:#f6f6f6; } #info ol { margin: 0.5em 4em; } #info ol li { font-family: monospace; } #summary { background: #ffc; } #explanation { background:#eee; border-bottom: 0px none; }</style></head><body><div id="summary"><h1>Page not found <span>(404)</span></h1><table class="meta"><tbody><tr><th>Request Method:</th><td>GET</td></tr><tr><th>Request URL:</th><td>http://127.0.0.1:8000//getFiles/</td></tr></tbody></table></div><div id="info"><p>Using the URLconf defined in <code>OpenSite.urls</code>, Django tried these URL patterns, in this order:</p><ol><li>admin/</li><li>register/</li><li>login/</li><li>logout/</li><li>viewProfile/</li><li>editProfile/</li><li>index/</li><li>index/&lt;int:page&gt;/</li><li>greens/</li><li>greens/&lt;int:page&gt;/</li><li>search/</li><li>viewUser/&lt;str:username&gt;/</li><li>viewUser/&lt;str:username&gt;/&lt;int:page&gt;/</li><li>users/</li><li>machines/</li><li>eventLog/</li><li>eventLog/&lt;int:page&gt;/</li><li>newTest/</li><li>viewTest/&lt;int:id&gt;/</li><li>editTest/&lt;int:id&gt;/</li><li>approveTest/&lt;int:id&gt;/</li><li>restartTest/&lt;int:id&gt;/</li><li>stopTest/&lt;int:id&gt;/</li><li>deleteTest/&lt;int:id&gt;/</li><li>getFiles/</li><li>getWorkload/</li><li>wrongBench/</li><li>submitNPS/</li><li>submitResults/</li><li></li></ol><p>The current path, <code>/getFiles/</code>, didn't match any of these.</p></div><div id="explanation"><p>You're seeing this error because you have <code>DEBUG = True</code> in your Django settings file. Change that to <code>False</code>, and Django will display a standard 404 page.</p></div></body></html>cutechess-linux
Traceback (most recent call last):
  File "Client/OpenBench.py", line 418, in <module>
    getCoreFiles()
  File "Client/OpenBench.py", line 74, in getCoreFiles
    getFile(location + 'cutechess-linux', 'cutechess')
  File "Client/OpenBench.py", line 54, in getFile
    request = requests.get(url=source, stream=True, timeout=HTTP_TIMEOUT)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 640, in send
    adapter = self.get_adapter(url=request.url)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 731, in get_adapter
    raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for

Am i doing something wrong ?

tryingsomestuff commented 5 years ago

Feels like a url is expected instead of this html big string

AndyGrant commented 5 years ago

http://127.0.0.1:8000/ should be http://127.0.0.1:8000? What a silly error, I need to fix that. And I suppose your config.py needs a trailing slash or removing a trailing slash for the REPO URL

I'm in the process of fixing all these silly inconsistencies in the new client file

AndyGrant commented 5 years ago

Sorry, its 8AM and I'm still awake. Ignore my previous comment.

In both the client and the server, there are a few places where a trailing "/" is needed explicitly. This is an error on my part, as I should be joining URLs together in a better way than just adding two strings together. I'm guessing that your FRAMEWORK_REPO_URL in OpenBench/config.py needs a trailing /

tryingsomestuff commented 5 years ago

In fact the "/" on my command line shall not be here. So your fist comment is good ;) Thanks. Indeed you probably need to use urlparse.urlparse(url) at some point to sanitize urls.