I have tried to run the Aerospike Collectd plugin ([https://github.com/aerospike-community/aerospike-collectd][1]), however, I have run into several problems/issues.
When trying to build with pip or pip3, it fails both times. With pip3, I have been able to install requirements by changing the aerospike client version to 4.0 from the old value 3.10.
Additionally, I had to change aerospike_plugin.py code to correctly import ServerName value from the new library of aerospike client 4.0.
I am having this python issue:
Nov 5 23:34:39 aerospike5 collectd[182769]: Unhandled python exception in read callback: AttributeError: 'NoneType' object has no attribute 'lookup'
Nov 5 23:34:39 aerospike5 collectd[182769]: Traceback (most recent call last):
Nov 5 23:34:39 aerospike5 collectd[182769]: File "/usr/lib/collectd/aerospike_plugin.py", line 867, in read#012 reader(self.client, config, meta, self.emit)
Nov 5 23:34:39 aerospike5 collectd[182769]: File "/usr/lib/collectd/aerospike_plugin.py", line 367, in cluster#012 emit(meta, 'services', len(services), ['cluster'])
Nov 5 23:34:39 aerospike5 collectd[182769]: File "/usr/lib/collectd/aerospike_plugin.py", line 814, in emit#012 for type, value in self.schema.lookup(category, metric, value):
Nov 5 23:34:39 aerospike5 collectd[182769]: AttributeError: 'NoneType' object has no attribute 'lookup'
Nov 5 23:34:39 aerospike5 collectd[182769]: read-function of plugin `python.aerospike_plugin' failed. Will suspend it for 640.000 seconds.
Could you please help me fix the error or if anyone had experience with this piece of software?
Thank you all in advance.
[1]: https://github.com/aerospike-community/aerospike-collectd
Related
I have a docker compose running where a django backend, opensearch & opensearch dashboard are running. I have connected the backend to talk to opensearch and I'm able to query it successfully. I'm trying to create indexes using this command inside the docker container.
./manage.py opensearch --rebuild
Reference: https://django-opensearch-dsl.readthedocs.io/en/latest/getting_started/#create-and-populate-opensearchs-indices
I get the following error when I run the above command
root#ed186e462ca3:/app# ./manage.py opensearch --rebuild
/usr/local/lib/python3.6/site-packages/OpenSSL/crypto.py:8: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography import utils, x509
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 37, in load_command_class
return module.Command()
File "/usr/local/lib/python3.6/site-packages/django_opensearch_dsl/management/commands/opensearch.py", line 32, in __init__
if settings.TESTING: # pragma: no cover
File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 80, in __getattr__
val = getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'TESTING'
Sentry is attempting to send 1 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit
I'm not sure where I'm going wrong. Any help would be greatful.
TIA
For future reference, this was indeed a bug in django-opensearch-dsl which was fix in the 0.3.0 release.
So, as context, I'm writing some controller software in Python for a RTM3004 oscilloscope for laboratory use. I had it working just fine on my laptop (Win10) and the previous laboratory computer (Linux), but upon changing to a new measurement computer, I can no longer connect to the device using Pyvisa. Here is a console log of the error, which happens whenever I attempt to connect to the device via Pyvisa:
Python 3.9.4 (tags/v3.9.4:1f2e308, Apr 6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvisa as visa
>>> rm= visa.ResourceManager()
>>> rm.list_resources()
('ASRL1::INSTR', 'ASRL3::INSTR', 'USB0::2733::470::103028::0::INSTR')
>>> ID='USB0::2733::470::103028::0::INSTR'
>>> instr=rm.open_resource(ID)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\highlevel.py", line 3304, in open_resource
res.open(access_mode, open_timeout)
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\resources\resource.py", line 297, in open
self.session, status = self._resource_manager.open_bare_resource(
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa\highlevel.py", line 3232, in open_bare_resource
return self.visalib.open(self.session, resource_name, access_mode, open_timeout)
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa_py\highlevel.py", line 167, in open
sess = cls(session, resource_name, parsed, open_timeout)
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa_py\sessions.py", line 323, in __init__
self.after_parsing()
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa_py\usb.py", line 81, in after_parsing
self.interface = self._intf_cls(
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvisa_py\protocols\usbtmc.py", line 293, in __init__
self.usb_dev.set_configuration()
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\usb\core.py", line 905, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\usb\core.py", line 113, in wrapper
return f(self, *args, **kwargs)
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\usb\core.py", line 159, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\usb\backend\libusb0.py", line 509, in set_configuration
_check(_lib.usb_set_configuration(dev_handle, config_value))
File "C:\Users\Hbeam\AppData\Local\Programs\Python\Python39\lib\site-packages\usb\backend\libusb0.py", line 447, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
As well as the information I get out of pyvisa-info:
Machine Details:
Platform ID: Windows-10-10.0.18362-SP0
Processor: Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
Python:
Implementation: CPython
Executable: c:\users\hbeam\appdata\local\programs\python\python39\python.exe
Version: 3.9.4
Compiler: MSC v.1928 64 bit (AMD64)
Bits: 64bit
Build: Apr 6 2021 13:40:21 (#tags/v3.9.4:1f2e308)
Unicode: UCS4
PyVISA Version: 1.11.3
Backends:
ivi:
Version: 1.11.3 (bundled with PyVISA)
Binary library: Not found
py:
Version: 0.5.2
ASRL INSTR: Available via PySerial (3.5)
USB INSTR: Available via PyUSB (1.1.1). Backend: libusb0
USB RAW: Available via PyUSB (1.1.1). Backend: libusb0
TCPIP INSTR: Available
TCPIP SOCKET: Available
GPIB INSTR:
Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of funcionality.
No module named 'gpib'
I've been racking my brain over this for two workdays now with no solution in sight, so I thought it best to ask for help, since I'm obviously no programming genius. Thank you in advance.
When following the quickstart UWSGI guide and attempting to start the server, the following error occurs:
ImportError: dlopen(/Users/xxxxxxxx/anaconda3/lib/python3.7/lib-dynload/_struct.cpython-37m-darwin.so, 2): Symbol not found: _PyByteArray_Type
Referenced from: /Users/xxxxxxxx/anaconda3/lib/python3.7/lib-dynload/_struct.cpython-37m-darwin.so
Expected in: flat namespace
Some things I've tried:
Reinstalling UWSGI - pip install --upgrade --force-reinstall --no-binary :all: --no-cache-dir uWSGI==2.0.17
Reinstalling anaconda
Clues:
The application will will run properly using the werkzeug development sever w/ no errors.
Running from struct import pack, unpack in the ~/anaconda3/bin/python interpreter does not cause an error
Both '~/anaconda3/bin/python3' and '/Users/xxxxxxxx/anaconda3/bin/uwsgi' contain the symbol (nm /Users/xxxxxxxx/anaconda3/bin/uwsgi | grep _PyByteArray_Type)
How can I fix this problem? If this is a novel issue, where should I report it? Is it a problem with how Conda compiled Python? UWSGI?
System:
OS: OSX 10.15.2
Conda: 4.7.12
UWSGI: 2.0.18
Architecture: x86_64
Full stack trace:
*** Starting uWSGI 2.0.18 (64bit) on [Wed Dec 18 19:46:58 2019] ***
compiled with version: 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4) on 17 December 2019 08:16:44
os: Darwin-19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64
nodename: base2010-6.local
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /private/tmp/mvp
detected binary path: /Users/xxxxxxxx/anaconda3/bin/uwsgi
your processes number limit is 2784
your memory page size is 4096 bytes
detected max file descriptor number: 256
lock engine: OSX spinlocks
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:3031 fd 3
Python version: 3.7.1 (default, Dec 14 2018, 13:28:58) [Clang 4.0.1 (tags/RELEASE_401/final)]
Python main interpreter initialized at 0x7fcbd6c04a60
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 416560 bytes (406 KB) for 8 cores
*** Operational MODE: preforking+threaded ***
Traceback (most recent call last):
File "myflaskapp.py", line 1, in <module>
from flask import Flask
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/site-packages/flask/__init__.py", line 14, in <module>
from jinja2 import escape
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/site-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/site-packages/jinja2/environment.py", line 15, in <module>
from jinja2 import nodes
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/site-packages/jinja2/nodes.py", line 19, in <module>
from jinja2.utils import Markup
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/site-packages/jinja2/utils.py", line 16, in <module>
from jinja2._compat import text_type, string_types, implements_iterator, \
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 31, in <module>
import pickle
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/pickle.py", line 33, in <module>
from struct import pack, unpack
File "/Users/xxxxxxxx/anaconda3/lib/python3.7/struct.py", line 13, in <module>
from _struct import *
ImportError: dlopen(/Users/xxxxxxxx/anaconda3/lib/python3.7/lib-dynload/_struct.cpython-37m-darwin.so, 2): Symbol not found: _PyByteArray_Type
Referenced from: /Users/xxxxxxxx/anaconda3/lib/python3.7/lib-dynload/_struct.cpython-37m-darwin.so
Expected in: flat namespace
in /Users/xxxxxxxx/anaconda3/lib/python3.7/lib-dynload/_struct.cpython-37m-darwin.so
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 9746)
spawned uWSGI worker 1 (pid: 9747, cores: 2)
spawned uWSGI worker 2 (pid: 9748, cores: 2)
spawned uWSGI worker 3 (pid: 9749, cores: 2)
spawned uWSGI worker 4 (pid: 9750, cores: 2)
*** Stats server enabled on 127.0.0.1:9191 fd: 16 ***
I had same problem and solved it with fully remove Anaconda python and install python through homebrew (brew install python).
I have an existing LMDB zarr archive (~6GB) saved at path. Now I want to consolidate the metadata to improve read performance.
Here is my script:
store = zarr.LMDBStore(path)
root = zarr.open(store)
zarr.consolidate_metadata(store)
store.close()
I get the following error:
Traceback (most recent call last):
File "zarr_consolidate.py", line 12, in <module>
zarr.consolidate_metadata(store)
File "/local/home/marcel/.virtualenvs/noisegan/local/lib/python3.5/site-packages/zarr/convenience.py", line 1128, in consolidate_metadata
return open_consolidated(store, metadata_key=metadata_key)
File "/local/home/marcel/.virtualenvs/noisegan/local/lib/python3.5/site-packages/zarr/convenience.py", line 1182, in open_consolidated
meta_store = ConsolidatedMetadataStore(store, metadata_key=metadata_key)
File "/local/home/marcel/.virtualenvs/noisegan/local/lib/python3.5/site-packages/zarr/storage.py", line 2455, in __init__
d = store[metadata_key].decode() # pragma: no cover
AttributeError: 'memoryview' object has no attribute 'decode'
I am using zarr 2.3.2 and python 3.5.2. I have another machine running python 3.6.2 where this works. Could it have to do with the python version?
Thanks for the report. Should be fixed with gh-452. Please test it out (if you are able).
If you are able to share a bit more information on why read performance suffers in your case, that would be interesting to learn about. :)
I'm trying to create a cluster with version 3.4, but it keeps giving me an error. The strange thing is that if I try to do it with version 2.1.5 for example, everything runs smoothly.
So for instance if I try to create a cluster with ccm create -v 3.4 -n 3 mycluster
This is what I get:
WARN:Downloading 3.4 failed, due to [Errno 2] No such file or directory. Trying to build from git instead.
http://git-wip-us.apache.org/repos/asf/cassandra.git git:cassandra-3.4
Cloning Cassandra...
Traceback (most recent call last):
File "/usr/local/bin/ccm", line 5, in <module>
pkg_resources.run_script('ccm==2.1.4', 'ccm')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1401, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/ccm-2.1.4-py2.7.egg/EGG-INFO/scripts/ccm", line 74, in <module>
File "build/bdist.linux-x86_64/egg/ccmlib/cmds/cluster_cmds.py", line 158, in run
File "build/bdist.linux-x86_64/egg/ccmlib/cluster.py", line 63, in __init__
File "build/bdist.linux-x86_64/egg/ccmlib/cluster.py", line 76, in load_from_repository
File "build/bdist.linux-x86_64/egg/ccmlib/repository.py", line 77, in setup
File "build/bdist.linux-x86_64/egg/ccmlib/repository.py", line 203, in clone_development
ccmlib.common.CCMError: Building C* version git:cassandra-3.4 failed. Attempted to delete /home/pedro/.ccm/repository/gitCOLONcassandra-3.4 but failed. This will need to be manually deleted
However if I do ls -a /home/pedro/.ccm/repository/ -l, I don't see the folder that had to be manually deleted according to the stacktrace:
total 12
drwxrwxr-x 3 pedro pedro 4096 Mar 25 18:01 .
drwxrwxr-x 3 pedro pedro 4096 Mar 25 17:59 ..
drwxrwxr-x 9 pedro pedro 4096 Mar 25 17:36 2.1.5
-rw-rw-r-- 1 pedro pedro 0 Mar 25 17:59 last.log
I tried your cluster creation and it works fine for me. I have git 2.5.4 installed might be worth looking at your version of git. I would also look at your java version and update it if you are behind.
Ok, so it was one of those problems... On my .profile (I'm on Ubuntu), I was initializing the JAVA_HOME, after the PATH, so when the PATH was export the value "JAVA_HOME/bin" didn't existed.
Although it's somewhat embarassing, I'm maintaning this post up, because I couldn't possibly figure this out from the output of the error, so maybe this can help someone out.
I ran into this error as well, however my solution was different:
kill the current cassandra process:
sudo ps auwx | grep cassandra
sudo kill -9 PID
stop the ccm as well:
ccm stop
remove the current cluster:
ccm remove
build a cluster with the same version of Cassandra that you are running
ccm create mycluster -v 3.9 -n 3