AnkiConnect Error Message in Anki When Attempting to Add New Flashcards from MPV Video Player - anki

I have installed AnkiConnect, but it doesn't seem to work when attempting to add new flashcards with mpvacious, VocabSieve, or other tools. AnkiConnect v.6 shows it is working at http://localhost:8765/. I am using macOS.
I get the error message below in Anki:
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-04-30 14:46:27
Add-ons possibly involved: ⁨AnkiConnect⁩
Caught exception:
Traceback (most recent call last):
File "/Users/matt/Library/Application Support/Anki2/addons21/2055492159/__init__.py", line 96, in advance
self.server.advance()
File "/Users/matt/Library/Application Support/Anki2/addons21/2055492159/web.py", line 135, in advance
self.advanceClients()
File "/Users/matt/Library/Application Support/Anki2/addons21/2055492159/web.py", line 150, in advanceClients
self.clients = list(filter(lambda c: c.advance(), self.clients))
File "/Users/matt/Library/Application Support/Anki2/addons21/2055492159/web.py", line 150, in <lambda>
self.clients = list(filter(lambda c: c.advance(), self.clients))
File "/Users/matt/Library/Application Support/Anki2/addons21/2055492159/web.py", line 67, in advance
self.writeBuff += self.handler(req)
File "/Users/matt/Library/Application Support/Anki2/addons21/2055492159/web.py", line 190, in handlerWrapper
if params.get('action', '') == 'requestPermission':
UnboundLocalError: local variable 'params' referenced before assignment

Related

How can error GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown be fixed?

I'm trying to customize Ubuntu 22.04. But then i'm entering
sudo gnome-tweaks
it returns
WARNING : Error getting shell mode
CRITICAL: Error getting shell version
WARNING : Could not list shell extensions
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_appearance.py", line 144, in __init__
extensions = self._shell.list_extensions()
File "/usr/lib/python3/dist-packages/gtweak/gshellwrapper.py", line 76, in list_extensions
return self._proxy.proxy_extensions.ListExtensions()
File "/usr/lib/python3/dist-packages/gi/overrides/Gio.py", line 349, in __call__
result = self.dbus_proxy.call_sync(self.method_name, arg_variant,
gi.repository.GLib.GError: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.Shell was not provided by any .service files (2)
Gnome-tweaks opens, but... If i change some parameters in gnome-tweaks, it does just nothing! What can I do with it?

Problem running odoo-bin on MacOS (ValueError: current limit exceeds maximum limit)

I am unable to get Odoo 14 running on my MacOS machine. Some research into the following error suggests that I can manually configure the memory limits which may resolve the issue but I cannot find the relevant config files on my machine.
I've checked and reinstalled all of the requirements and I can't find much information to point me in the right direction.
(venv) kilgow#wmbp odoo-dev % python3 odoo/odoo-bin
2021-09-18 15:56:53,295 1931 INFO ? odoo: Odoo version 14.0
2021-09-18 15:56:53,295 1931 INFO ? odoo: addons paths: ['/Users/kilgow/Desktop/odoo-dev/odoo/odoo/addons', '/Users/kilgow/Library/Application Support/Odoo/addons/14.0', '/Users/kilgow/Desktop/odoo-dev/odoo/addons']
2021-09-18 15:56:53,295 1931 INFO ? odoo: database: default#default:default
2021-09-18 15:56:53,351 1931 INFO ? odoo.addons.base.models.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
Traceback (most recent call last):
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo-bin", line 8, in <module>
odoo.cli.main()
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/cli/command.py", line 61, in main
o.run(args)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/cli/server.py", line 178, in run
main(args)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/cli/server.py", line 172, in main
rc = odoo.service.server.start(preload=preload, stop=stop)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 1298, in start
rc = server.run(preload, stop)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 510, in run
self.start(stop=stop)
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 452, in start
set_limit_memory_hard()
File "/Users/kilgow/Desktop/odoo-dev/odoo/odoo/service/server.py", line 83, in set_limit_memory_hard
resource.setrlimit(rlimit, (config['limit_memory_hard'], hard))
ValueError: current limit exceeds maximum limit
(venv) kilgow#wmbp odoo-dev % python3 odoo/odoo-bin
You should check out this documentation for more info, so the easy way is add an extra argument to your run script like below.
python3 odoo-bin --addons-path=addons -d mydb --limit-memory-hard 0
I believe this could be due to the machine using an M1 chip. Manually increasing the memory limits did not resolve the problem.
I’ve managed to work around the issue by running Odoo and Postgres in Docker containers instead.

Python Firestore insert return error 503 DNS resolution failed

I have a problem during the execution of my python script from crontab, which consists of an insert operation in the firestore database.
db.collection(u'ab').document(str(row["Name"])).collection(str(row["id"])).document(str(row2["id"])).set(self.packStructure(row2))
When I execute normally with python3 script.py command it works, but when I execute it from crontab it return the following error:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/axatel/angel_bridge/esportazione_firebase/main.py", line 23, in <module>
dato.getDati(dato, db, cursor, cursor2, fdb, select, anagrafica)
File "/home/axatel/angel_bridge/esportazione_firebase/dati.py", line 19, in getDati
db.collection(u'ab').document(str(row["Name"])).collection(str(row["id"])).document(str(row2["id"])).set(self.packStructure(row2))
File "/home/axatel/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/document.py", line 234, in set
write_results = batch.commit()
File "/home/axatel/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/batch.py", line 147, in commit
metadata=self._client._rpc_metadata,
File "/home/axatel/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/gapic/firestore_client.py", line 1121, in commit
request, retry=retry, timeout=timeout, metadata=metadata
File "/home/axatel/.local/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 145, in __call__
return wrapped_func(*args, **kwargs)
File "/home/axatel/.local/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
on_error=on_error,
File "/home/axatel/.local/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/home/axatel/.local/lib/python3.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
return func(*args, **kwargs)
File "/home/axatel/.local/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "<string>", line 3, in raise_from
google.api_core.exceptions.ServiceUnavailable: 503 DNS resolution failed for service: firestore.googleapis.com:443
I really don't understand what's the problem, because the connection at the database works every time the script is started in both ways.
Is there a fix for this kind of issue?
I found something that might be helpful. There is nice troubleshooting guide and there is a part there, which seems to be related:
If your command works by invoking a runtime like python some-command.py perform a few checks to determine that the runtime
version and environment is correct. Each language runtime has quirks
that can cause unexpected behavior under crontab.
For python you might find that your web app is using a virtual
environment you need to invoke in your crontab.
I haven't seen such error running Firestore API, but this seems to match to your issue.
I found the solution.
The problem occured because the timeout sleep() value was lower than expected, so the database connection function starts too early during boot phase of machine. Increasing this value to 45 or 60 seconds fixed the problem.
#time.sleep(10) # old version
time.sleep(60) # working version
fdb = firebaseConnection()
def firebaseConnection():
# firebase connection
cred = credentials.Certificate('/database/axatel.json')
firebase_admin.initialize_app(cred)
fdb = firestore.client()
if fdb:
return fdb
else:
print("Error")
sys.exit()

Failed to create a device file using `uinput` module. Python3 on Ubuntu for Windows

I have a python script that runs on python3.4 and uses the package keyboard to allow for keybinds;
keyboard.add_hotkey("enter", self.listener.stop, suppress=True)
keyboard.add_hotkey("shift+enter", self.listener.finish, suppress=True)
When I run this on Windows, it works perfectly listening to both hotkeys, also when run on linux (CentOS) it works.
At work I've gotten a Ubuntu environment on my windows via the windows 10 feature and app store. However this environment has a problem with this keyboard hotkey.
/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/_nixkeyboard.py:110: UserWarning: Failed to create a device file using `uinput` module. Sending of events may be limited or unavailable depending on plugged-in devices.
device = aggregate_devices('kbd')
Traceback (most recent call last):
File "main.py", line 32, in <module>
], 'test')
File "/mnt/.../can_controller.py", line 28, in __init__
self.__initialise_key_handler()
File "/mnt/.../can_controller.py", line 95, in __initialise_key_handler
keyboard.add_hotkey("enter", self.listener.stop, suppress=True)
File "/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/__init__.py", line 637, in add_hotkey
_listener.start_if_necessary()
File "/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/_generic.py", line 35, in start_if_necessary
self.init()
File "/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/__init__.py", line 194, in init
_os_keyboard.init()
File "/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/_nixkeyboard.py", line 113, in init
build_device()
File "/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/_nixkeyboard.py", line 110, in build_device
device = aggregate_devices('kbd')
File "/usr/local/lib/python3.6/dist-packages/keyboard-0.13.2-py3.6.egg/keyboard/_nixcommon.py", line 168, in aggregate_devices
assert fake_device
AssertionError
If anybody knows how to fix this or has a good work-around. Please let me know.

Selenium: NoSuchFrameException for Chrome Extension

I have a Chrome extension and I'd like to test it with Selenium. The extension places an iframe tag to pages.
I can successfully get the iframe tag by running the following command:
top_frame = driver.find_element(By.XPATH, value='//iframe[#class="top-frame"]')
However, when I try switching to the frame I get 'NoSuchFrameException' error.
driver.switch_to.frame(top_frame)
The following line outputs the frame's class name correctly
print(top_frame.get_attribute('class'))
Error log:
Testing http://www.google.com
Traceback (most recent call last):
File "test/run_tests.py", line 200, in <module>
main()
File "test/run_tests.py", line 197, in main
run_tests(args.plugin, args.out, args.url)
File "test/run_tests.py", line 167, in run_tests
button = check_button(driver, url)
File "test/run_tests.py", line 84, in check_button
driver.switch_to.frame(top_frame)
File "/home/burak/.virtualenv/extension/lib/python3.5/site-packages/selenium/webdriver/remote/switch_to.py", line 87, in frame
self._driver.execute(Command.SWITCH_TO_FRAME, {'id': frame_reference})
File "/home/burak/.virtualenv/extension/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/home/burak/.virtualenv/extension/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchFrameException: Message: no such frame: element is not a frame
(Session info: chrome=60.0.3112.90)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.10.0-30-generic x86_64)
Try this man,
driver.switch_to.frame(driver.find_element(By.XPATH,value=".//iframe[#src='give your frame source name here..']"));
In the latest version of Chrome, most likely there is a bug that breaks the switch_to_frame() call. Therefore, I started using Firefox instead, everything is smooth for now.
This link is to the associated issue report on Chromium. It has not been resolved yet. (25/10/17)
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2019

Resources