Unhandled Exception for Downloader for Reddit - sqlite

Having difficulty downloading a series of results when using the GUI. I'm able to log into my account, find a user and/or subreddit, but when I download I only get 1 result and it say
ERROR: Failed to extract due to: Unsupported Domain
Have downloaded all of the requirements in the requirements.txt file but not sure how to resolve this issue. Latest logfile result below:
"levelname": "CRITICAL",
"asctime": "02/12/2023 02:12:47 PM",
"filename": "main.py",
"module": "main",
"name": "DownloaderForReddit.main",
"funcName": "log_unhandled_exception",
"lineno": 48,
"message": "Unhandled exception",
"exc_info": "Traceback (most recent call last):\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2276, in _wrap_pool_connect\n return fn()\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 363, in connect\n return _ConnectionFairy._checkout(self)\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 773, in _checkout\n fairy = _ConnectionRecord.checkout(pool)\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 492, in checkout\n rec = pool._do_get()\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/impl.py", line 238, in _do_get\n return self._create_connection()\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection\n return _ConnectionRecord(self)\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 437, in init\n self.__connect(first_connect_check=True)\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/pool/base.py", line 652, in __connect\n connection = pool._invoke_creator(self)\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect\n return dialect.connect(*cargs, **cparams)\n File "/home/ads/projects/DownloaderForReddit-master/venv/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 489, in c###
I think it has something to do with the SQLite package or lack there of. I'm very new to coding and trying to run on my linux machine in a virtual environment.

Related

python integration with azure gremlin not working

I am trying to mimic as mentioned in GIT.
I almost commented everything, and just trying to run simply
g.V().count()
my connection details are correct, and matched to documentation...
I am getting following error.
Traceback (most recent call last):
File "c:\Users\PrasaRak\OneDrive\gremlin_azure_function\connect.py", line 193, in <module>
count_vertices(client)
File "c:\Users\PrasaRak\OneDrive\gremlin_azure_function\connect.py", line 116, in count_vertices
callback = client.submit(_gremlin_count_vertices)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\client.py", line 127, in submit
return self.submitAsync(message, bindings=bindings, request_options=request_options).result()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\client.py", line 148, in submitAsync
return conn.write(message)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\connection.py", line 55, in write
self.connect()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\connection.py", line 45, in connect
self._transport.connect(self._url, self._headers)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\gremlin_python\driver\tornado\transport.py", line 40, in connect
self._ws = self._loop.run_sync(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\ioloop.py", line 576, in run_sync
return future_cell[0].result()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\simple_httpclient.py", line 269, in run
stream = yield self.tcp_client.connect(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\gen.py", line 1147, in run
yielded = self.gen.send(value)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 232, in connect
af, addr, stream = yield connector.start(connect_timeout=timeout)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 87, in start
self.try_connect(iter(self.primary_addrs))
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 104, in try_connect
stream, future = self.connect(af, addr)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\tcpclient.py", line 276, in _create_stream
return stream, stream.connect(addr)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\iostream.py", line 1325, in connect
self._add_io_state(self.io_loop.WRITE)
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\iostream.py", line 1157, in _add_io_state
self.io_loop.add_handler(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\site-packages\tornado\platform\asyncio.py", line 83, in add_handler
self.asyncio_loop.add_writer(
File "C:\Users\PrasaRak\Miniconda3\envs\learn-gremlin\lib\asyncio\events.py", line 507, in add_writer
raise NotImplementedError
NotImplementedError
I think i got the answer.
issue was with python 3.8 & Tornado compatibility, when it comes to asyncio.
more info is at this link
fix was to add following line in tornado/platform/asyncio.py
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # python-3.8.0a4

Unable to export jupyter notebook to any other format using nbconvert

I am using Python 3.8.5 on Windows 10. I installed Jupyterlab and it works correctly. However nbconvert does not. When I try to export notebook to any format, I get the following error in the terminal:
[W 16:14:06.733 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20200928161400 (::1) 8.46ms referer=http://localhost:8889/notebooks/tester1/testing_epr_py.ipynb
[I 16:14:07.066 NotebookApp] Kernel started: 1e1cd4f1-55e7-4583-b343-98ed9670e8f9, name: python3
[E 16:14:10.773 NotebookApp] Uncaught exception GET /nbconvert/html/tester1/testing_epr_py.ipynb?download=true (::1)
HTTPServerRequest(protocol='http', host='localhost:8889', method='GET', uri='/nbconvert/html/tester1/testing_epr_py.ipynb?download=true', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 535, in get
value = obj._trait_values[self.name]
KeyError: 'template_paths'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\tornado\web.py", line 1703, in _execute
result = await result
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\notebook\nbconvert\handlers.py", line 93, in get
exporter = get_exporter(format, config=self.config, log=self.log)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\notebook\nbconvert\handlers.py", line 67, in get_exporter
Exporter = get_exporter(format)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\base.py", line 102, in get_exporter
if getattr(exporter(config=config), 'enabled', True):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 328, in __init__
super().__init__(config=config, **kw)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\exporter.py", line 114, in __init__
self._init_preprocessors()
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 494, in _init_preprocessors
conf = self._get_conf()
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 510, in _get_conf
for path in map(Path, self.template_paths):
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 575, in __get__
return self.get(obj, cls)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 538, in get
default = obj.trait_defaults(self.name)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 1577, in trait_defaults
return self._get_trait_default_generator(names[0])(self)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.py", line 975, in __call__
return self.func(*args, **kwargs)
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 521, in _template_paths
template_names = self.get_template_names()
File "C:\Users\draco.malfoy\AppData\Roaming\Python\Python38\site-packages\nbconvert\exporters\templateexporter.py", line 582, in get_template_names
raise ValueError('No template sub-directory with name %r found in the following paths:\n\t%s' % (base_template, paths))
ValueError: No template sub-directory with name 'lab' found in the following paths:
C:\Users\draco.malfoy\AppData\Roaming\jupyter
C:\Program Files\Python38\share\jupyter
C:\ProgramData\jupyter
I also tried to use nbconvert through command line but got the same error. nbconvert version is 6.0.6. Any help is greatly appreciated.
Copying files from "C:\Users\{username}\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\share\jupyter"
to "C:\ProgramData\jupyter" helped me solve this issue, kindly note that you will have to install Pandoc and MiKTex on Windows if you want to convert notebooks.

AuthorizationFailed - "The client 'xxx' with object id 'xxx does not have authorization to perform action

I've tried to get Workspace from config which I do have access to, but it fails with the following error:
import azureml.core
print("SDK version:", azureml.core.VERSION)
from azureml.core.workspace import Workspace
ws = Workspace.from_config()
print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep='\n')
SDK version: 0.1.80 Found the config file in:
C:\Users\gubert\Repos\Gimmonix\HotelMappingAI\aml_config\config.json
get_workspace error using subscription_id=xxxxxxxxxxxxxxxxxxxxxxx,
resource_group_name=xxxxxxxxxxxx, workspace_name=gmx-ml-mapping
Traceback (most recent call last): File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_project_commands.py",
line 320, in get_workspace workspace_name) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_base_sdk_common\workspace\operations\workspaces_operations.py",
line 78, in get raise
models.ErrorResponseWrapperException(self._deserialize, response)
azureml._base_sdk_common.workspace.models.error_response_wrapper.ErrorResponseWrapperException:
Operation returned an invalid status code 'Forbidden'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd_launcher.py",
line 38, in main(sys.argv) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_main_.py",
line 265, in main wait=args.wait) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_main_.py",
line 256, in handle_args run_main(addr, name, kind, *extra, **kwargs)
File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_local.py",
line 52, in run_main runner(addr, name, kind == 'module', *extra,
**kwargs) File "c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd\runner.py",
line 32, in run set_trace=False) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd\pydevd.py",
line 1283, in run return self._exec(is_module, entry_point_fn,
module_name, file, globals, locals) File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd\pydevd.py",
line 1290, in _exec pydev_imports.execfile(file, globals, locals) #
execute the script File
"c:\Users\gubert.vscode\extensions\ms-python.python-2018.10.1\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd_pydev_imps_pydev_execfile.py",
line 25, in execfile exec(compile(contents+"\n", file, 'exec'), glob,
loc) File "c:\Users\gubert\Repos\Gimmonix\HotelMappingAI\test.py",
line 8, in ws = Workspace.from_config() File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml\core\workspace.py",
line 153, in from_config auth=auth) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml\core\workspace.py",
line 86, in init auto_rest_workspace = _commands.get_workspace(auth,
subscription_id, resource_group, workspace_name) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_project_commands.py",
line 326, in get_workspace resource_error_handling(response_exception,
WORKSPACE) File
"C:\Users\gubert.azureml\envs\myenv\lib\site-packages\azureml_base_sdk_common\common.py",
line 270, in resource_error_handling raise
ProjectSystemException(response_message)
azureml.exceptions._azureml_exception.ProjectSystemException: {
"error_details": { "error": { "code": "AuthorizationFailed",
"message": "The client 'xxxxxxxxxx#microsoft.com' with object id
'xxxxxxxxxxxxx' does not have authorization to perform action
'Microsoft.MachineLearningServices/workspaces/read' over scope
'/subscriptions/xxxxxxxxxxxxxx/resourceGroups/CarsolizeCloud - Test
Global/providers/Microsoft.MachineLearningServices/workspaces/gmx-ml-mapping'."
} }, "status_code": 403, "url":
"https://management.azure.com/subscriptions/xxxxxxxxxxxxx/resourceGroups/CarsolizeCloud%20-%20Test%20Global/providers/Microsoft.MachineLearningServices/workspaces/gmx-ml-mapping?api-version=2018-03-01-preview"
}
Try using the newest SDK version 1.0.10, this is a fairly old preview version you're using. If you still have a problem, let me know as I work on this SDK.

Getting an error while starting airflow worker

I have installed airflow and trying to start the worker on the mac. But I am getting following error. Unable to identify what must be causing this issue.
[2018-05-02 15:37:11,458: CRITICAL/MainProcess] Unrecoverable error: TypeError("Invalid argument(s) 'visibility_timeout' sent to create_engine(), using configuration MySQLDialect_mysqldb/QueuePool/Engine. Please check that the keyword arguments are appropriate for this combination of components.",)
Traceback (most recent call last):
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/worker/worker.py", line 203, in start
self.blueprint.start(self)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/bootsteps.py", line 370, in start
return self.obj.start()
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/worker/consumer/consumer.py", line 320, in start
blueprint.start(self)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/worker/consumer/tasks.py", line 37, in start
c.connection, on_decode_error=c.on_decode_error,
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/celery/app/amqp.py", line 302, in TaskConsumer
**kw
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/messaging.py", line 386, in __init__
self.revive(self.channel)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/messaging.py", line 408, in revive
self.declare()
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/messaging.py", line 421, in declare
queue.declare()
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/entity.py", line 605, in declare
self._create_queue(nowait=nowait, channel=channel)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/entity.py", line 614, in _create_queue
self.queue_declare(nowait=nowait, passive=False, channel=channel)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/entity.py", line 649, in queue_declare
nowait=nowait,
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/transport/virtual/base.py", line 531, in queue_declare
self._new_queue(queue, **kwargs)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 82, in _new_queue
self._get_or_create(queue)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 70, in _get_or_create
obj = self.session.query(self.queue_cls) \
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 65, in session
_, Session = self._open()
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 56, in _open
engine = self._engine_from_config()
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/kombu/transport/sqlalchemy/__init__.py", line 51, in _engine_from_config
return create_engine(conninfo.hostname, **transport_options)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 424, in create_engine
return strategy.create(*args, **kwargs)
File "/Users/manishz/anaconda2/envs/airflow/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 162, in create
engineclass.__name__))
TypeError: Invalid argument(s) 'visibility_timeout' sent to create_engine(), using configuration MySQLDialect_mysqldb/QueuePool/Engine. Please check that the keyword arguments are appropriate for this combination of components.
Appreciate any help on it.
Thanks in avance
Manish

Newrelic plugin nginx-nr-agent not working

I am using Newrelic's nginx-nr-agent but suddenly it crashed giving out the following error and not starting back.
2016-04-12 07:51:07,021 nginx-nr-agent [ERROR]: EXCEPTION: Traceback (most recent call last):
File "/usr/bin/nginx-nr-agent.py", line 431, in newrelic_push
u = urlopen(r, data=json.dumps(payload))
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1219, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1034, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
line = self.fp.readline()
File "/usr/lib/python2.7/socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/lib/python2.7/ssl.py", line 241, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 160, in read
return self._sslobj.read(len)
File "/usr/lib/pymodules/python2.7/daemon/daemon.py", line 399, in terminate
raise exception
SystemExit: Terminating on signal 15
Any help please?
I got two solution for this from here, one is to remove the pid file /var/run/nginx-nr-agent/nginx-nr-agent.pid and than start/restart it. And second solution is to restart the server.
This plugin is published and supported by Nginx, Inc. If the previous suggestions did not help, contact
newrelic-support#nginx.com.

Resources