using selenium from pythonanywhere? - selenium

I want use selenium in pythonanywhere.
this is error log in pythonanywhere.
Traceback (most recent call last):
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/downtownhub/odermysite/minitwit.py", line 409, in ordercolect
driver = webdriver.Firefox()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
self.service.start()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
So I added geckodrive file in Path('/home/downtownhub/odermysite/env/bin').
but it happen same error.
what can I solve it??

Ah, I see you're using a virtualenv. PythonAnywhere uses an old version of Firefox (v17) which is not compatible with the latest selenium/geckodriver. Switch back to selenium 2:
./env/bin/pip install "selenium<3"

Related

Odoo showing KeyError: 'last_path_node' after migrate from v12 to v13 with Openupgrade

I migrate my odoo instance from v12 to v13 using Openupgrade without errors. I also made change in my code and update my custom modules using
python3 odoo-bin --addons-path="./addons, ./extra_addons, ./OCA/contract" -p 8069 -d database_name -u module_name
also without error. My odoo instance is apparently loading without error, I can even see the odoo main interface but when and click an element from the main menu (lets say "contacts") it shows "Internal Server Error" and when I check the logs I can see the following errors " path = options['last_path_node']
KeyError: 'last_path_node'"
Where is the full log of the error
**Contexto del error:
Vista `App Drawer - Web Client`
[view_id: 941, xml_id: web_responsive.webclient_bootstrap, model: n/a, parent_id: 178]
2022-09-08 13:33:39,610 19400 INFO wimax13 werkzeug: 127.0.0.1 - - [08/Sep/2022 13:33:39] "GET /web HTTP/1.1" 500 - 386 0.534 1.152
2022-09-08 13:33:39,973 19400 ERROR wimax13 werkzeug: Error on request:
Traceback (most recent call last):
File "/home/ernesto/Programming/odoo/wimax13/lib/python3.6/site-packages/werkzeug/serving.py", line 270, in run_wsgi
execute(self.server.app)
File "/home/ernesto/Programming/odoo/wimax13/lib/python3.6/site-packages/werkzeug/serving.py", line 258, in execute
application_iter = app(environ, start_response)
File "/home/ernesto/Programming/odoo/wimax13/odoo/service/server.py", line 439, in app
return self.app(e, s)
File "/home/ernesto/Programming/odoo/wimax13/odoo/service/wsgi_server.py", line 142, in application
return application_unproxied(environ, start_response)
File "/home/ernesto/Programming/odoo/wimax13/odoo/service/wsgi_server.py", line 117, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 1287, in __call__
return self.dispatch(environ, start_response)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 1257, in __call__
return self.app(environ, start_wrapped)
File "/home/ernesto/Programming/odoo/wimax13/lib/python3.6/site-packages/werkzeug/wsgi.py", line 766, in __call__
return self.app(environ, start_response)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 1457, in dispatch
result = ir_http._dispatch()
File "/home/ernesto/Programming/odoo/wimax13/addons/website/models/ir_http.py", line 172, in _dispatch
response = super(Http, cls)._dispatch()
File "/home/ernesto/Programming/odoo/wimax13/addons/auth_signup/models/ir_http.py", line 19, in _dispatch
return super(Http, cls)._dispatch()
File "/home/ernesto/Programming/odoo/wimax13/addons/web_editor/models/ir_http.py", line 21, in _dispatch
return super(IrHttp, cls)._dispatch()
File "/home/ernesto/Programming/odoo/wimax13/addons/utm/models/ir_http.py", line 29, in _dispatch
response = super(IrHttp, cls)._dispatch()
File "/home/ernesto/Programming/odoo/wimax13/addons/http_routing/models/ir_http.py", line 519, in _dispatch
result = super(IrHttp, cls)._dispatch()
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_http.py", line 238, in _dispatch
return cls._handle_exception(e)
File "/home/ernesto/Programming/odoo/wimax13/addons/utm/models/ir_http.py", line 34, in _handle_exception
response = super(IrHttp, cls)._handle_exception(exc)
File "/home/ernesto/Programming/odoo/wimax13/addons/http_routing/models/ir_http.py", line 610, in _handle_exception
return super(IrHttp, cls)._handle_exception(exception)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_http.py", line 206, in _handle_exception
return request._handle_exception(exception)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 750, in _handle_exception
return super(HttpRequest, self)._handle_exception(exception)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/home/ernesto/Programming/odoo/wimax13/odoo/tools/pycompat.py", line 14, in reraise
raise value
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_http.py", line 234, in _dispatch
result = request.dispatch()
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 809, in dispatch
r = self._call_function(**self.params)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 350, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/ernesto/Programming/odoo/wimax13/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 342, in checked_call
result.flatten()
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 1236, in flatten
self.response.append(self.render())
File "/home/ernesto/Programming/odoo/wimax13/odoo/http.py", line 1229, in render
return env["ir.ui.view"].render_template(self.template, self.qcontext)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_ui_view.py", line 1191, in render_template
return self.browse(self.get_view_id(template)).render(values, engine)
File "/home/ernesto/Programming/odoo/wimax13/addons/website/models/ir_ui_view.py", line 336, in render
return super(View, self).render(values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/home/ernesto/Programming/odoo/wimax13/addons/web_editor/models/ir_ui_view.py", line 27, in render
return super(IrUiView, self).render(values=values, engine=engine, minimal_qcontext=minimal_qcontext)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_ui_view.py", line 1199, in render
return self.env[engine].render(self.id, qcontext)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_qweb.py", line 58, in render
result = super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/qweb.py", line 260, in render
self.compile(template, options)(self, body.append, values or {})
File "<decorator-gen-54>", line 2, in compile
File "/home/ernesto/Programming/odoo/wimax13/odoo/tools/cache.py", line 90, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/ir_qweb.py", line 113, in compile
return super(IrQWeb, self).compile(id_or_xml_id, options=options)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/qweb.py", line 277, in compile
element, document = self.get_template(template, options)
File "/home/ernesto/Programming/odoo/wimax13/odoo/addons/base/models/qweb.py", line 364, in get_template
path = options['last_path_node']
KeyError: 'last_path_node' - - -**
Based on the third line of your Traceback, your error seems to be related with this view:
view_id: 941, xml_id: web_responsive.webclient_bootstrap
You can access this view using its id: 941 in this kind of url:
https://your-oerp.odoo.com/web?#id=941&action=28&model=ir.ui.view&view_type=form
to provide me its content... to investigate the error
Is this view (with relativ high id: 941) "not native" / part of your custom module ?
On the other hand, this view name (id:941): "web_responsive.webclient_bootstrap" doesn t exist in Odoo 13 and seems to have been replaced:
In Odoo 13, the existing bootstrap-related views are:
web._assets_bootstrap
web.webclient_bootstrap
web_enterprise.webclient_bootstrap
web_studio.webclient_bootstrap

Flasgger failed to load API definition

I get this error message when trying to see the Swagger UI with Flasgger:
ERROR in app: Exception on /apispec_1.json [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/flask/views.py", line 163, in dispatch_request
return meth(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/flasgger/base.py", line 133, in get
return jsonify(self.loader())
File "/usr/local/lib/python3.6/site-packages/flasgger/base.py", line 465, in get_apispecs
prefix_ids=prefix_ids
File "/usr/local/lib/python3.6/site-packages/flasgger/utils.py", line 747, in extract_definitions
if not getattr(item, 'get'):
AttributeError: 'NoneType' object has no attribute 'get'
I tried everything, but I cannot see anything when I access http://localhost:5000/apidocs. I get error message: Fetch error: INTERNAL SERVER ERROR /apispec_1.json

in __getitem__ return self.models[model_name] KeyError: 'mham_app.mham_app' - - -

try to extend timesheet by adding some fields and change name of other but when i inherited the related model which is 'account.analytic.line':
and add the 'analytic ' module in the manifest as depends
from odoo import models, fields, api
class mham_app(models.Model):
_inherit='account.analytic.line'
date_deadline = fields.Date('Deadline')
is_done = fields.Boolean('Done?')
active = fields.Boolean('Active?', default=True)
the follow is the manifest.py file
# any module necessary for this one to work correctly
'depends': ['analytic'],
the following is full error massage
2019-02-05 20:21:54,528 17339 ERROR New_todo odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/modules/registry.py", line 60, in __new__
return cls.registries[db_name]
File "/odoo/odoo-server/odoo/tools/func.py", line 69, in wrapper
return func(self, *args, **kwargs)
File "/odoo/odoo-server/odoo/tools/lru.py", line 44, in __getitem__
a = self.d[obj].me
KeyError: 'New_todo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 455, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1624, in _process_end
record.unlink()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 637, in unlink
self._prepare_update()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 584, in _prepare_update
model = self.env[rec.model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'mham_app.mham_app'
2019-02-05 20:21:54,532 17339 INFO New_todo werkzeug: 127.0.0.1 - - [05/Feb/2019 20:21:54] "POST /longpolling/poll HTTP/1.1" 500 - 421 0.353 1.094
2019-02-05 20:21:54,541 17339 ERROR New_todo werkzeug: Error on request:
Traceback (most recent call last):
File "/home/msafi/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 270, in run_wsgi
execute(self.server.app)
File "/home/msafi/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 258, in execute
application_iter = app(environ, start_response)
File "/odoo/odoo-server/odoo/service/server.py", line 350, in app
return self.app(e, s)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 128, in application
return application_unproxied(environ, start_response)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 117, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1318, in __call__
return self.dispatch(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1291, in __call__
return self.app(environ, start_wrapped)
File "/home/msafi/.local/lib/python3.6/site-packages/werkzeug/wsgi.py", line 766, in __call__
return self.app(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1469, in dispatch
odoo.registry(db).check_signaling()
File "/odoo/odoo-server/odoo/__init__.py", line 81, in registry
return modules.registry.Registry(database_name)
File "/odoo/odoo-server/odoo/modules/registry.py", line 62, in __new__
return cls.new(db_name)
File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/odoo/odoo-server/odoo/modules/loading.py", line 455, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1624, in _process_end
record.unlink()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 637, in unlink
self._prepare_update()
File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 584, in _prepare_update
model = self.env[rec.model]
File "/odoo/odoo-server/odoo/api.py", line 820, in __getitem__
return self.registry[model_name]._browse((), self)
File "/odoo/odoo-server/odoo/modules/registry.py", line 176, in __getitem__
return self.models[model_name]
KeyError: 'mham_app.mham_app' - - -
although of there is no model name mham_app.mham_app
And the error occure also comes if I change the name to something else

Request' object has no attribute 'full_path after click on logout from website odoo 9 [duplicate]

I am using odoo v9 community in Ubuntu 14.04 installation is perfectly done after all works.
but when i install website module of odoo and after i log out from odoo it show following error:
"500: Internal Server Error"
and my log:
"Traceback (most recent call last):
File "/opt/odoo96/addons/website/models/ir_http.py", line 242, in _handle_exception
response = super(ir_http, self)._handle_exception(exception)
File "/opt/odoo96/openerp/addons/base/ir/ir_http.py", line 147, in _handle_exception
return request._handle_exception(exception)
File "/opt/odoo96/openerp/http.py", line 738, in _handle_exception
return super(HttpRequest, self)._handle_exception(exception)
File "/opt/odoo96/openerp/addons/base/ir/ir_http.py", line 172, in _dispatch
result = request.dispatch()
File "/opt/odoo96/openerp/http.py", line 769, in dispatch
r = self._call_function(**self.params)
File "/opt/odoo96/openerp/http.py", line 316, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo96/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo96/openerp/http.py", line 309, in checked_call
result = self.endpoint(*a, **kw)
File "/opt/odoo96/openerp/http.py", line 888, in __call__
return self.method(*args, **kw)
File "/opt/odoo96/openerp/http.py", line 466, in response_wrap
response = f(*args, **kw)
File "/opt/odoo96/addons/website/controllers/main.py", line 44, in index
return request.registry['ir.http'].reroute(first_menu.url)
File "/opt/odoo96/addons/website/models/ir_http.py", line 209, in reroute
return self._dispatch()
File "/opt/odoo96/addons/website/models/ir_http.py", line 175, in _dispatch
key = self.get_page_key()
File "/opt/odoo96/addons/website/models/ir_http.py", line 94, in get_page_key
return (self._name, "cache", request.uid, request.lang, request.httprequest.full_path)
AttributeError: 'Request' object has no attribute 'full_path'"
but when i uninstall web module all working well again. how can i solve this ?
Thanks
Its a dependency issue.
Install a newer version of werkzeug.
https://github.com/odoo/odoo/issues/10184
pip install werkzeug==0.9.4
Should do the trick.

Scrapyd S3 feed export "Connection Reset by Peer"

I'm running Scrapyd with a FEED_URI set to export to S3, but I received the following error at the very end of my scrape. Note that it successfully uploaded a few hundred kb of data to the bucket as the scrape began, then threw this error at the end:
2014-11-24 10:11:23+0000 [word] ERROR: Error storing csv feed (2285242 items) in: s3://kitchen.bucket/FoodItem.csv
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
self.__bootstrap_inner()
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 191, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/usr/local/lib/python2.7/dist-packages/scrapy/contrib/feedexport.py", line 101, in _store_in_thread
key.set_contents_from_file(file)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 1291, in set_contents_from_file
chunked_transfer=chunked_transfer, size=size)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 748, in send_file
chunked_transfer=chunked_transfer, size=size)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 949, in _send_file_internal
query_args=query_args
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 664, in make_request
retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1068, in make_request
retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 939, in _mexe
request.body, request.headers)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 842, in sender
http_conn.send(chunk)
File "/usr/lib/python2.7/httplib.py", line 805, in send
self.sock.sendall(data)
File "/usr/lib/python2.7/ssl.py", line 329, in sendall
v = self.send(data[count:])
File "/usr/lib/python2.7/ssl.py", line 298, in send
v = self._sslobj.write(data)
socket.error: [Errno 104] Connection reset by peer
Looks similar to boto issue 2207. I'm using gbirke's MultiFeedExporter, and received a similar error on both of my items.