Flasgger execution is a success but not showing the XML body - machine-learning

While Deploying iris prediction model using flasgger API, i can enter the lengths and widths of the iris flower with http/200 ok , but i do not see an xml output with the prediction results.
From ipython notebook:
Running on http://127.0.0.1:5001/ (Press CTRL+C to quit)
127.0.0.1 - - [20/Jan/2020 17:16:23] "GET /predict?s_length=3.2&s_width=2.0&p_length=3.0&p_width=4.5 HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:23] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /apidocs/ HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui.css HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui-bundle.js HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:47] "GET /flasgger_static/swagger-ui-standalone-preset.js HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /flasgger_static/lib/jquery.min.js HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /apispec_1.json HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:16:48] "GET /flasgger_static/favicon-32x32.png HTTP/1.1" 200 -
127.0.0.1 - - [20/Jan/2020 17:17:03] "GET /predict?s_length=4.2&s_width=5.6&p_length=2.6&p_width=6.3 HTTP/1.1" 200 -

Hope you all are keeping well.
So i found the problem after few days of struggling with it, looking for solution ,I guess i was too lazy to post it on GitHub or maybe got busy , the error indicated above was a result of incomplete XML missing 200 body for an HTTP Response , which did not output any XML Result when I entered the input parameters and run the prediction from the GUI , which is expected in my case.
So it is important that we provide a complete XML body with 200 response , we can also add the kind of results you would expect under the 200 XML Body for the prediction based on your Project.
Adding the 200 in the XML body as shown below, fixed the problem.
def predict_iris_file():
"""Example file endpoint returning a prediction of iris
---
parameters:
- name: input_file
in: formData
type: file
required: true
responses:
200:
description: "0: Iris-setosa, 1: Iris-versicolor, 2: Iris-virginica"
"""
Regards
akudnaver

Sorted the issue.
Responses should be in the same indent as parameters and 200 should be indented below responses

Related

got 301 and then 404 error response while calling end point in odoo15

here is my code:
from odoo import http
_logger = logging.getLogger(__name__)
class CrmController(http.Controller):
#http.route('/crm/lead', type='json', auth='none', website=True, methods=['POST'])
def post_data_end_point(self):
print("==== api called successfully ====")
return "api called successfully---"
after call this end point on postman i got this error
2022-09-14 09:44:09,925 167674 INFO odoo15 werkzeug: 127.0.0.1 - - [14/Sep/2022 09:44:09] "POST /crm/lead/ HTTP/1.1" 301 - 35 0.020 0.817
2022-09-14 09:44:10,421 167674 INFO odoo15 werkzeug: 127.0.0.1 - - [14/Sep/2022 09:44:10] "GET /crm/lead HTTP/1.1" 404 - 214 0.116 0.357
you have define type='json' it means it response only json(dictionary) object not string.

Element cannot located in parent view when replace div in custom receipt

I am using odoo 15 ; I am customizing receipt in point_of_sale module
I have a problem when trying to replace div( have a class related to other div inherits the same templates)
my code as following :
<xml version="1.0" encoding="UTF-8"?>
<templates id="pos_custom"xml:space="preserve">
<t t-inherit="point_of_sale.OrderReceipt"t-inherit-mode="extension"owl="1">
<xpathexpr="//div[hasclass('pos-receipt-contact')]"position="replace">
<p>Success !p>
</xpath>
</t>
</templates>
my log error :
ValueError: Element '<xpath expr="//div[hasclass('pos-receipt-contact')]">' cannot be located in parent view - - -
2022-07-28 08:05:21,977 351769 INFO ? werkzeug: 192.168.0.61 - - [28/Jul/2022 08:05:21] "GET /web/static/lib/stacktracejs/stacktrace.js HTTP/1.1" 200 - - - -
2022-07-28 08:05:21,993 351769 INFO newestDB07021 werkzeug: 192.168.0.61 - - [28/Jul/2022 08:05:21] "GET /web/webclient/locale/en_US HTTP/1.1" 200 - 1 0.001 0.004
2022-07-28 08:05:22,057 351769 INFO newestDB07021 werkzeug: 192.168.0.61 - - [28/Jul/2022 08:05:22] "GET /web/assets/debug/web.assets_backend_prod_only.js HTTP/1.1" 200 - 3 0.003 0.058
2022-07-28 08:05:22,057 351769 INFO newestDB07021 werkzeug: 192.168.0.61 - - [28/Jul/2022 08:05:22] "GET /web/assets/debug/web.assets_backend.js HTTP/1.1" 200 - 3 0.002 0.061

Tests failing because of a 500 internal server error

[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ng-file-upload-shim.min.js HTTP/1.1" 200 bytesIn:568 bytesOut:3062 reqTime:0
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ng-file-upload-all.min.js HTTP/1.1" 200 14565 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ngBootbox.min.js HTTP/1.1" 200 1407 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/bootbox.min.js HTTP/1.1" 200 4166 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ngBootbox.min.js HTTP/1.1" 200 bytesIn:557 bytesOut:1407 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/bootbox.min.js HTTP/1.1" 200 bytesIn:556 bytesOut:4166 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/ng-file-upload-all.min.js HTTP/1.1" 200 bytesIn:567 bytesOut:14565 reqTime:0
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment.min.js HTTP/1.1" 200 20933 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/angular-moment.min.js HTTP/1.1" 200 2281 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment-locale-en-gb.js HTTP/1.1" 200 1385 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/smart-table/smart-table.min.js HTTP/1.1" 200 2902 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/lrStickyHeader.js HTTP/1.1" 200 1905 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/lrStickyHeader.js HTTP/1.1" 200 bytesIn:559 bytesOut:1905 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment-locale-en-gb.js HTTP/1.1" 200 bytesIn:563 bytesOut:1385 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/angular-moment.min.js HTTP/1.1" 200 bytesIn:563 bytesOut:2281 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/smart-table/smart-table.min.js HTTP/1.1" 200 bytesIn:572 bytesOut:2902 reqTime:0
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/moment.min.js HTTP/1.1" 200 bytesIn:555 bytesOut:20933 reqTime:0
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/stStickyHeader.js HTTP/1.1" 200 816 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /assets/d5e561ce/js/stStickyHeader.js HTTP/1.1" 200 bytesIn:558 bytesOut:816 reqTime:0
[php-fpm:access] 127.0.0.1 - 13/Sep/2019:14:02:09 +0000 "GET /index.php?compDur=0+DAY&getKids=none&open=0&team=50&type=team" 200 /var/www/secure.curtisbanks.co.uk/htdocs/index.php 323.680 8192 30.89%
docker.vm:ip - - [13/Sep/2019:14:02:09 +0000] "GET /tasks/tasksApi/tasks?compDur=0+DAY&getKids=none&open=0&team=50&type=team HTTP/1.1" 200 57634 "http://servertest01:8082/apex/team/50" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
[httpd:access] servertest01:ip - - [13/Sep/2019:14:02:09 +0000] "GET /tasks/tasksApi/tasks?compDur=0+DAY&getKids=none&open=0&team=50&type=team HTTP/1.1" 200 bytesIn:587 bytesOut:576
So I have my tests running each morning at 3 AM aprox. I have some tests that are failing with the same error which is:
03:12:18.785 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.
03:12:53.997 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.
03:13:18.146 SEVERE - http://servertest/portal/messages/team/id/46/view/onldgdl7g7SrCYl93uyGVFon1yfJP6OGpRpyiJmpQUYuoXKk - [DOM] Found 2 elements with non-unique id #undefined_hint: (More info: https://goo) %o %o
03:13:25.395 SEVERE - http://servertest/portal/messages/exportForKW/ref/onldgdl7g7SrCYl93uyGVFon1yfJP6OGpRpyiJmpQUYuoXKk/ajax/1 - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I have tried to change the id's where is it filling the user name and password as I can see on the screenshot that the last part of the password is sometimes filled in the username filed, after the user name was already filled in.
$I = new AcceptanceTester($scenario);
$I->wantTo('Search for a caller, go through security, save it and add notes');
//Log in
$I->amOnPage('/user/account/login');
$I->fillField("UserLogin[username]", "");
$I->fillField("UserLogin[password]", "");
$I->click('Log In');
$I->wait(2);
$I->waitForElementVisible('#AdminMemberGrid_status', 30);
//Access the call tab
$I->click('//*[#id="secondaryMenu"]/li[1]/a');
$I->waitForText('Search for caller :');
Here the popup where I wait for text search for caller and pick up transferred call is not visible, in the screenshot it barley appears in front of the first page when I click the Call tab $I->click('//*[#id="secondaryMenu"]/li[1]/a');
I am expecting to see the text and fill the fields, adding a longer wait won't make any difference.
The other tests pass, and they have the same code.
Clicking on the google links will redirect me to the security blog, online google security blog: 2016/09/moving-towards-more-secure-web.html
09:39:55.676 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see
09:41:09.738 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:41:10.182 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:41:22.316 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:41:42.15 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:42:12.869 SEVERE - http://servertest/nii/index/show/id/144904/type/40x40.max - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
09:42:29.88 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see
09:43:04.33 WARNING - http://servertest/user/account/login - This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see
09:43:30.640 SEVERE - - [DOM] Found 2 elements with non-unique id #undefined_hint: (More info: ) %o %o

react native map issue

My app gives me error when I import MapView on react nativ
Here is my code:
`import MapView from 'react-native-maps'`
just importing it like that gives me an erorr
Here is my dpendency:
"dependencies": {
"react": "16.6.1",
"react-native": "0.57.7",
"react-native-maps": "^0.22.1",
"react-native-router-flux": "^4.0.6"
},
Opening /Users/Desktop/snl/reactNative/ChatApp/node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js with /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
BUNDLE [ios, dev] ../../index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.
BUNDLE [ios, dev] ../../index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)::1 - - [09/Dec/2018:08:42:21 +0000] "GET /index.bundle?platform=ios&dev=true&minify=false HTTP/1.1" 200 - "-" "ChatApp/1 CFNetwork/975.0.3 Darwin/17.7.0"
::1 - - [09/Dec/2018:08:42:24 +0000] "POST /symbolicate HTTP/1.1" 200 - "-" "ChatApp/1 CFNetwork/975.0.3 Darwin/17.7.0"
::1 - - [09/Dec/2018:08:42:25 +0000] "POST /symbolicate HTTP/1.1" 200 - "-" "ChatApp/1 CFNetwork/975.0.3 Darwin/17.7.0"
^[[1;2D

Log output too verbose - how to change log level?

I'm trying to debug my simple Rails app and find navigating and printing with puts works well but the log in Bash is way too verbose. I've looked through lots of questions/responses here and have tried some of them but without success. I tried importing the quiet_assets Gem with
gem 'quiet_assets', group: :development
and have tried changing log levels to :error in production.rb
config.log_level = Logger::error
But I still get all the GET requests of Assets when navigating making review of logs difficult.
Worth noting I've tried restarting the server and ran bundle just in case. I did hard refresh even though browser cache shouldn't have anything to do with this.
Here's example navigation:
20:08:55 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:55] "GET /application.js HTTP/1.1" 304 - 0.0185
20:08:55 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:55] "GET /application.css HTTP/1.1" 304 - 0.0790
20:08:56 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:56] "GET /brands/46 HTTP/1.1" 304 - 0.0111
20:08:56 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:56] "GET /application.js HTTP/1.1" 304 - 0.0062
20:08:56 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:56] "GET /application.css HTTP/1.1" 304 - 0.0066
20:08:57 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:57] "GET /brands/46 HTTP/1.1" 304 - 0.0105
20:08:57 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:57] "GET /application.js HTTP/1.1" 304 - 0.0056
20:08:57 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:57] "GET /application.css HTTP/1.1" 304 - 0.0063
20:09:13 web.1 | E, [2014-10-22T20:09:13.695412 #5880] ERROR -- : worker=0 PID:5916 timeout (16s > 15s), killing
20:09:13 web.1 | E, [2014-10-22T20:09:13.704183 #5880] ERROR -- : reaped #<Process::Status: pid 5916 SIGKILL (signal 9)> worker=0
20:09:13 web.1 | I, [2014-10-22T20:09:13.710805 #5923] INFO -- : worker=0 ready
It seems you are seeing production log, are you? if that is the case quiet_assets should be included in production too.
gem 'quiet_assets'

Resources