TypeError: '<' not supported between instances of 'FilterSetMetaclass' and 'ID' - graphene-python

I am having some issues with my django app since updating my dependencies. I updated django from 2.2.28 to 3.2. The python version in the application is 3.6. I have problem with graphen.
Error:
File ".../backend_django_3/kidsview-backend/preschool/schema.py", line 1689, in Query
daily_activity = graphene.Node.Field(DailyActivityNode, filterset_class=DailyActivityFilter)
File ".../.virtualenvs/kidsview_django_3/lib/python3.8/site-packages/graphene/relay/node.py", line 86, in Field
return NodeField(cls, *args, **kwargs)
File ".../.virtualenvs/kidsview_django_3/lib/python3.8/site-packages/graphene/relay/node.py", line 56, in __init__
super(NodeField, self).__init__(
File ".../.virtualenvs/kidsview_django_3/lib/python3.8/site-packages/graphene/types/field.py", line 109, in __init__
self.args = to_arguments(args or OrderedDict(), extra_args)
File ".../.virtualenvs/kidsview_django_3/lib/python3.8/site-packages/graphene/types/argument.py", line 80, in to_arguments
extra_args = sorted(extra_args.items(), key=lambda f: f[1])
TypeError: '<' not supported between instances of 'FilterSetMetaclass' and 'ID'
[27/Jun/2022 13:23:22] "POST /graphql HTTP/1.1" 500 253983
This is a large application I chose specific libraries:
aniso8601==7.0.0
asgiref==3.5.2
Django==3.2
django-anymail==6.1.0
django-colorfield==0.1.15
django-cors-headers==3.13.0
django-debug-toolbar==3.2.2
django-extensions==2.2.3
django-filter==21.1
django-graphiql-debug-toolbar==0.1.3
django-graphql-extensions==0.1.0
django-graphql-jwt==0.3.4
django-health-check==3.14.3
django-model-utils==4.2.0
django-nested-inline==0.4.4
django-qr-code==2.2.0
django-safedelete==1.0.0
django-silk==4.0.1
django-simple-history==2.8.0
django-solo==1.1.3
django-stdimage==2.4.1
django-storages==1.12.2
django-tinymce==2.8.0
graphene==2.1.9
graphene-django==2.15.0
graphene-file-upload==1.3.0
graphql-core==2.3.2
graphql-relay==2.0.1
Jinja2==3.0.1
jsonschema==3.2.0
openpyxl==3.0.5
packaging==21.0
parso==0.8.2
phonenumbers==8.10.20
Pillow==8.3.1
progressbar2==3.53.1
prometheus-client==0.8.0
promise==2.3
psycopg2-binary==2.8.5
ptyprocess==0.7.0
Pygments==2.10.0
PyJWT==2.4.0
PyNaCl==1.4.0
pyparsing==2.4.7
PyPDF2==1.26.0
pyrsistent==0.18.0
python-bidi==0.4.2
python-dateutil==2.8.2
python-docx==0.8.11
python-jose-cryptodome==1.3.2
python-utils==2.5.6
pytz==2021.1
PyYAML==5.3.1
qrcode==6.1
singledispatch==3.7.0
six==1.15.0
sqlparse==0.4.1
Anyone have any idea what the problem is?

Related

Splinter WebDriverException: newSession Firefox 63.0

I have been using Splnter with GeckoDriver and Firefox for months and all was well until Firefox upgraded to 63.0 today.
Now, when I try to run Splinter with the code below, I get immediately the error that follows it.
from splinter import Browser
browser = Browser()
Traceback (most recent call last):
File "<ipython-input-2-a8fa3d213da9>", line 16, in <module>
browser = Browser()
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\splinter\browser.py", line 63, in Browser
return driver(*args, **kwargs)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\splinter\driver\webdriver\firefox.py", line 57, in __init__
timeout=timeout, **kwargs)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 154, in __init__
keep_alive=True)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 151, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 240, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: newSession
Thanks in advance!
I had to get the latest version of GeckoDriver and install it where Python.exe is kept.
Problem solved.

FileNotFoundError: [Errno 2] No such file or directory: 'which' when using python pdfkit

I have a strange error. I try to use pdfkit to convert an HTML string to PDF, but i get a "No such file or directory: 'which'". I know that pdfkit uses wkhtmltopdf, and it tries to find this utility by using which. I have no idea what's happening. 'which' works ok and wkhtmltopdf is installed on /usr/bin/. I get the error in this line:
pdf = pdfkit.from_string(html, False, options=options)
and the traceback:
Traceback:
File "/srv/zboss-git/venv/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)
File "/srv/zboss-git/venv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/srv/zboss-git/venv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/srv/zboss-git/venv/lib/python3.5/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "/srv/zboss-git/venv/lib/python3.5/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "/srv/zboss-git/zboss/issues/views.py" in export_comments
453. pdf = pdfkit.from_string(html, False, options=options)
File "/srv/zboss-git/venv/lib/python3.5/site-packages/pdfkit/api.py" in from_string
66. configuration=configuration)
File "/srv/zboss-git/venv/lib/python3.5/site-packages/pdfkit/pdfkit.py" in __init__
38. self.configuration = (Configuration() if configuration is None
File "/srv/zboss-git/venv/lib/python3.5/site-packages/pdfkit/configuration.py" in __init__
18. ['which', 'wkhtmltopdf'], stdout=subprocess.PIPE).communicate()[0].strip()
File "/usr/lib/python3.5/subprocess.py" in __init__
947. restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py" in _execute_child
1551. raise child_exception_type(errno_num, err_msg)
Exception Type: FileNotFoundError at /issues/export_comments/
Exception Value: [Errno 2] No such file or directory: 'which'
I found a solution.
According the documentation of python-pdfkit:
Warning! Version in debian/ubuntu repos have reduced functionality (because it compiled without the wkhtmltopdf QT patches), such as adding outlines, headers, footers, TOC etc. To use this options you should install static binary from wkhtmltopdf site or you can use this script.
Script:
https://github.com/JazzCore/python-pdfkit/blob/master/travis/before-script.sh
I uninstall my version and run this version. I also set up manually my configuration:
config = pdfkit.configuration(wkhtmltopdf=bytes('/usr/bin/wkhtmltopdf', 'utf-8'))
pdf = pdfkit.from_string(html, False, options=options, configuration=config)
and voila!

Hue server error "checkJobBrowserStatus" cloudera hadoop

I have some problem with accessing to Hue webUI. I just get
"500 server error"
to every acces to any web page on the Hue. The sample of the error:
From log file i got some information about type of this error
[12/Dec/2017 01:00:53 -0800] views ERROR JS ERROR: {"msg":"ReferenceError: checkJobBrowserStatus is not defined","url":"http://10.40.2.89:8888/hue/","line":1584,"column":12,"stack":"#http://10.40.2.89:8888/hue/:1584:13\nn.Callbacks/j#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:26852\nn.Callbacks/k.fireWith#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:27661\n.ready#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:29482\nI#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:29656\n"}
when i try to open other web pages i get the same error
[12/Dec/2017 01:04:56 -0800] views ERROR JS ERROR: {"msg":"ReferenceError: checkJobBrowserStatus is not defined","url":"http://10.40.2.89:8888/metastore/tables/","line":1584,"column":12,"stack":"#http://10.40.2.89:8888/metastore/tables/:1584:13\nn.Callbacks/j#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:26852\nn.Callbacks/k.fireWith#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:27661\n.ready#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:29482\nI#http://10.40.2.89:8888/static/desktop/ext/js/jquery/jquery-2.1.1.min.e40ec2161fe7.js:2:29656\n"}
and so on , similar errors on the any web page.
I've attached the full log file on Google Drive
I'm trying to open a web interface HUE with Iceweasel on Debian.
Cloudera version is CDH5 (CDH 5.13.0).
It seems like [indexer] app was blacklisted ([desktop] section in /hue/desktop/dump_config), so Hue won't work properly.
Also, looks like you are on the old UI, it is recommended to switch back to
Hue 4.
[12/Dec/2017 01:04:53 -0800] middleware INFO Processing exception: u'indexer' is not a registered namespace: Traceback (most recent call last):
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/db/transaction.py", line 371, in inner
return func(*args, **kwargs)
File "/usr/lib/hue/apps/metastore/src/metastore/views.py", line 240, in show_tables
'source_type': _get_servername(db),
File "/usr/lib/hue/desktop/core/src/desktop/lib/django_util.py", line 230, in render
**kwargs)
File "/usr/lib/hue/desktop/core/src/desktop/lib/django_util.py", line 148, in _render_to_response
return django_mako.render_to_response(template, *args, **kwargs)
File "/usr/lib/hue/desktop/core/src/desktop/lib/django_mako.py", line 125, in render_to_response
return HttpResponse(render_to_string(template_name, data_dictionary), **kwargs)
File "/usr/lib/hue/desktop/core/src/desktop/lib/django_mako.py", line 114, in render_to_string_normal
result = template.render(**data_dict)
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Mako-0.8.1-py2.7.egg/mako/template.py", line 443, in render
return runtime._render(self, self.callable_, args, data)
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Mako-0.8.1-py2.7.egg/mako/runtime.py", line 786, in _render
**_kwargs_for_callable(callable_, data))
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Mako-0.8.1-py2.7.egg/mako/runtime.py", line 818, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Mako-0.8.1-py2.7.egg/mako/runtime.py", line 844, in _exec_template
callable_(context, *args, **kwargs)
File "/tmp/tmpMMurVL/metastore/metastore.mako.py", line 142, in render_body
__M_writer(escape(unicode( assist.assistPanel() )))
File "/tmp/tmpMMurVL/metastore/assist.mako.py", line 497, in render_assistPanel
__M_writer(escape(unicode( url('indexer:importer_prefill', source_type='all', target_type='table') )))
File "/usr/lib/hue/desktop/core/src/desktop/lib/django_mako.py", line 131, in url
return reverse(view_name, args=args, kwargs=view_args)
File "/usr/lib/hue/build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/core/urlresolvers.py", line 532, in reverse
key)
NoReverseMatch: u'indexer' is not a registered namespace
This might be a bit late, but thought of posting the solution to help others.
I was able to get this page working by setting "share_jobs" to "true" in "/etc/hue/conf.empty/hue.ini"
So the following worked for me:
[jobbrowser]
# Share submitted jobs information with all users. If set to false,
# submitted jobs are visible only to the owner and administrators.
share_jobs=true

Error when I Update Module List in OpenERP

I am trying to update my modulo list using the Update Module List menu item, but I get the follwing error:
OpenERP Server Error
Client Traceback (most recent call last):
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/controllers/main.py", line 1132, in call_button
action = self._call_kw(req, model, method, args, {})
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/controllers/main.py", line 1120, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/session.py", line 42, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/session.py", line 103, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)
Server Traceback (most recent call last):
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/base/module/wizard/base_module_update.py", line 42, in update_module
update, add = module_obj.update_list(cr, uid,)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/base/module/module.py", line 617, in update_list
handler.load_addons()
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/web/http.py", line 580, in load_addons
m = __import__('openerp.addons.' + module)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/magento_integration-develop/__init__.py", line 9, in <module>
import magento_
File "/opt/bitnami/apps/openerp/lib/openerp-7.0_20140330_231328-py2.7.egg/openerp/addons/magento_integration-develop/magento_.py", line 17, in <module>
import magento
ImportError: No module named magento
I am trying to install a Magento OpenERP connector, but in order to to that I must locate it in the Installed Module list.
Thanks
Please check your file magento_.py, and see whether the class has been called.And if it has been called correctly check whether it has been correctly specified in the import line in your init.py file.

gdata.docs.client.DocsClient

I have the following code, reads oauth2 token form file, then try's to perform a doc's list query to find a specific spreadsheet that I want to copy, however no matter what I try the code either errors out or returns with an object containing no document data.
I am using gdata.docs.client.DocsClient which as far as I can tell is version 3 of the API
def CreateClient():
"""Create a Documents List Client."""
client = gdata.docs.client.DocsClient(source=config.APP_NAME)
client.http_client.debug = config.DEBUG
# Authenticate the user with CLientLogin, OAuth, or AuthSub.
if os.path.exists(config.CONFIG_FILE):
f = open(config.CONFIG_FILE)
tok = pickle.load(f)
f.close()
client.auth_token = tok.auth_token
return client
1st query attempt
def get_doc():
new_api_query = gdata.docs.client.DocsQuery(title='RichSheet', title_exact=True, show_collections=True)
d = client.GetResources(q = new_api_query)
this fails with the following stack trace
Traceback (most recent call last):
File "/Users/richard/PycharmProjects/reportone/make_my_report.py", line 83, in <module>
get_doc()
File "/Users/richard/PycharmProjects/reportone/make_my_report.py", line 57, in get_doc
d = client.GetResources(q = new_api_query)
File "/Users/richard/PycharmProjects/reportone/gdata/docs/client.py", line 151, in get_resources
**kwargs)
File "/Users/richard/PycharmProjects/reportone/gdata/client.py", line 640, in get_feed
**kwargs)
File "/Users/richard/PycharmProjects/reportone/gdata/docs/client.py", line 66, in request
return super(DocsClient, self).request(method=method, uri=uri, **kwargs)
File "/Users/richard/PycharmProjects/reportone/gdata/client.py", line 267, in request
uri=uri, auth_token=auth_token, http_request=http_request, **kwargs)
File "/Users/richard/PycharmProjects/reportone/atom/client.py", line 115, in request
self.auth_token.modify_request(http_request)
File "/Users/richard/PycharmProjects/reportone/gdata/gauth.py", line 1047, in modify_request
token_secret=self.token_secret, verifier=self.verifier)
File "/Users/richard/PycharmProjects/reportone/gdata/gauth.py", line 668, in generate_hmac_signature
next, token, verifier=verifier)
File "/Users/richard/PycharmProjects/reportone/gdata/gauth.py", line 629, in build_oauth_base_string
urllib.quote(params[key], safe='~')))
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1266, in quote
if not s.rstrip(safe):
AttributeError: 'bool' object has no attribute 'rstrip'
Process finished with exit code 1
then my second attempt
def get_doc():
other = gdata.docs.service.DocumentQuery(text_query='RichSheet')
d = client.GetResources(q = other)
this returns an ResourceFeed object, but has no content. I have been through the source code for these function but thing are not any obvious.
Have i missed something ? or should i go back to version 2 of the api ?

Resources