Hiya! I looked at the source for werkzeug, and found that they check for valid mimetypes (that is, ones with '/', etc.)
I think it's a recent-ish change. I'll remove the 'xml' handling code. Right now, the file server/common/extensions.py: Comment out: 17 'xml': output_xml, To: 17 #'xml': output_xml, Hopefully that fixes that error. And we can move on to the next one, lol. Thanks. -C On 03/30/15, Arpit Goel wrote: > Hi, > > I seem to have done away with 404 problem. It seems my server name in > config.py was incorrect. Now its value is "localhost:5000". I tried > running *http://localhost:5000 <http://localhost:5000>* on the browser and > now I get an empty reply but when i try *http://localhost:5000/Patient > <http://localhost:5000/Patient>*, I get a login screen and when I enter my > credentials again I get an empty reply. > The FHIR server running shows the following error*:* > > ERROR:tornado.application:Uncaught exception > Traceback (most recent call last): > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/tornado/http1connection.py", > line 236, in _read_message > delegate.finish() > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/tornado/httpserver.py", > line 267, in finish > self.server.request_callback(self.request) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/tornado/wsgi.py", > line 277, in __call__ > WSGIContainer.environ(request), start_response) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1836, in __call__ > return self.wsgi_app(environ, start_response) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1820, in wsgi_app > response = self.make_response(self.handle_exception(e)) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask_restful/__init__.py", > line 265, in error_router > return original_handler(e) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1403, in handle_exception > reraise(exc_type, exc_value, tb) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask_restful/__init__.py", > line 262, in error_router > return self.handle_error(e) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1817, in wsgi_app > response = self.full_dispatch_request() > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1477, in full_dispatch_request > rv = self.handle_user_exception(e) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask_restful/__init__.py", > line 265, in error_router > return original_handler(e) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1381, in handle_user_exception > reraise(exc_type, exc_value, tb) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask_restful/__init__.py", > line 262, in error_router > return self.handle_error(e) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1475, in full_dispatch_request > rv = self.dispatch_request() > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask/app.py", line > 1461, in dispatch_request > return self.view_functions[rule.endpoint](**req.view_args) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask_restful/__init__.py", > line 450, in wrapper > return self.make_response(data, code, headers=headers) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/flask_restful/__init__.py", > line 469, in make_response > default=default_mediatype, > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/werkzeug/datastructures.py", > line 1662, in best_match > if (self._value_matches(server_item, client_item) > File > "/home/gnuhealth/venv/local/lib/python2.7/site-packages/werkzeug/datastructures.py", > line 1688, in _value_matches > raise ValueError('invalid mimetype %r' % value) > ValueError: invalid mimetype 'xml' > > This error is thrown each time I get an empty reply (whatever the URI > maybe). > > On Fri, Mar 27, 2015 at 12:37 PM, Arpit Goel <[email protected]> wrote: > > > Hi Chris, > > > > This is the reply I get while running the *ProductionConfig*. The browser > > shows 404. > > *curl -v --header "Accept:text/xml" http://localhost:5000 > > <http://localhost:5000>* > > * About to connect() to localhost port 5000 (#0) > > * Trying 127.0.0.1... connected > > > GET / HTTP/1.1 > > > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 > > OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 > > > Host: localhost:5000 > > > Accept:text/xml > > > > > < HTTP/1.1 404 NOT FOUND > > < Content-Type: text/html > > < Content-Length: 233 > > < Server: TornadoServer/4.1 > > < > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> > > <title>404 Not Found</title> > > <h1>Not Found</h1> > > <p>The requested URL was not found on the server. If you entered the URL > > manually please check your spelling and try again.</p> > > * Connection #0 to host localhost left intact > > * Closing connection #0 > > > > And this is the reply I get while running *DebugConfig.* The browser > > shows no data received. > > curl -v --header "Accept:text/xml" http://localhost:5000 > > * About to connect() to localhost port 5000 (#0) > > * Trying 127.0.0.1... connected > > > GET / HTTP/1.1 > > > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 > > OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 > > > Host: localhost:5000 > > > Accept:text/xml > > > > > * Empty reply from server > > * Connection #0 to host localhost left intact > > curl: (52) Empty reply from server > > * Closing connection #0 > > > > When I run http://localhost:5000/Patient through DebugConfig, I get a > > login screen on the browser. > > I was reading the documentation again it says to specify config file in > > TRYTON_CONFIG. Is this the server "trytond.conf" or something else? > > > > Thanks, > > Arpit > > > > On Thu, Mar 26, 2015 at 11:43 PM, Chris <[email protected]> wrote: > > > >> Hiya! > >> > >> Sorry about delay -- busy week for me! > >> > >> > I'm trying to connect to the server using same machine but different > >> user. > >> > I tried using both browser and cURL through terminal. Here are the > >> outputs: > >> > >> Yeah, the user shouldn't matter. > >> > >> > Client (username - arpit): > >> > > >> > curl http://localhost:5000 > >> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> > >> > <title>404 Not Found</title> > >> > <h1>Not Found</h1> > >> > <p>The requested URL was not found on the server. If you entered the > >> URL > >> > manually please check your spelling and try again.</p> > >> > >> Yeah, that's not good. Try this: > >> > >> $ curl -v --header "Accept: text/xml" http://localhost:5000 > >> > >> The -v switch should show more info. > >> > >> The --header switch overrides the content-type accepted. > >> > >> I've had annoying issues with content negotiation, but Flask and its > >> addons support json by default, but I haven't coded the custom json > >> standard for FHIR. And curl, by default, accepts json (I think), so... > >> issues. I thought I fixed these issues... but maybe not. > >> > >> > >> Are you running the production config? Or? > >> > >> Does the browser do the same thing? Show 404s? > >> > >> > arpit@ubuntu:~$ curl http://localhost:5000/Patient > >> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> > >> > <title>404 Not Found</title> > >> > <h1>Not Found</h1> > >> > <p>The requested URL was not found on the server. If you entered the > >> URL > >> > manually please check your spelling and try again.</p> > >> > > >> > Server (username - gnuhealth): > >> > > >> > python run_server.py > >> > No handlers could be found for logger "party" > >> > WARNING:tornado.access:404 GET / (127.0.0.1) 21.02ms > >> > WARNING:tornado.access:404 GET /Patient (127.0.0.1) 3.08ms > >> > >> Yeah, the 404s may be those json requests and error responses to them. > >> Or, something more mysterious. > >> > >> Thanks! > >> > >> -C > >> > >> > >
