Openstack db sync error - openstack-nova

I issue the nova manage db sync command and when i issue I'm facing the problem,
TRACE nova File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/url.py", line 56, in __init__
2015-01-11 00:31:29 TRACE nova self.port = int(port)
2015-01-11 00:31:29 TRACE nova ValueError: invalid literal for int() with base 10: ''
Can you suggest the solutions.

The probelm was because I din't give any port number followed by the colon in the nova.conf file for the sql connetion. I removed the colon and is working fine now.

Related

Arch Linux MySQL HTTP Plugin missing?

I'm trying to revive an undocumented python server at work and I'm running into an issue with a missing file. When attempting to connect to the SQL DB with the credentials I've provided, I run into the following error:
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection
self.connect()
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 197, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 233, in get_new_connection
return Database.connect(**conn_params)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/MySQLdb/__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "/home/user/Projects/project/venv/lib/python3.9/site-packages/MySQLdb/connections.py", line 179, in __init__
super(Connection, self).__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2059, 'Plugin http could not be loaded: /usr/lib/mysql/plugin/http.so: cannot open shared object file: No such file or directory')
Sure enough, there is no http.so file at that location, though there is a healthy bunch of others. I cannot find any documentation on why this may be or where I'm supposed to get it.
I'm using Arch Linux, and just installed from the AUR using sudo pacman -S mysql. This is just an alias for mariadb from what I can tell, but I don't think that's an issue.
Is this shared object something I can get somewhere? Not sure really what to do here.
Came across a thread for HeidiSQL, which from what I read is a MySQL admin tool of sorts. Anyways, a user had the same issue over there, and someone responded with this:
Just don't use any protocol prefix in the hostname, unless you know it's required and correct. In most cases there must be just the hostname or an ip address, without a protocol.
https://www.heidisql.com/forum.php?t=27104#p34471
Sure enough, I was using http:// in my hostname. Removing that works just fine, though isn't so much of a solution as a workaround.

libvirt.libvirtError: An error occurred, but the cause is unknow

I am using XEN hypervisor. For managing virtual Machine I am using virt-manager whenever I want to start to Virtual Machine at last when everything is ready and I click the create Button I get the following error
Unable to complete install: 'An error occurred, but the cause is unknown'
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/createvm.py", line 2089, in _do_async_install
guest.installer_instance.start_install(guest, meter=meter)
File "/usr/share/virt-manager/virtinst/install/installer.py", line 542, in start_install
domain = self._create_guest(
File "/usr/share/virt-manager/virtinst/install/installer.py", line 491, in _create_guest
domain = self.conn.createXML(install_xml or final_xml, 0)
File "/usr/lib/python3/dist-packages/libvirt.py", line 4034, in createXML
if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: An error occurred, but the cause is unknow
For the Xen driver, you may have more infos in /var/log/libvirt/libxl/libxl-driver.log
Same issue here.
When I check the /var/log/syslog, there is a log from libvirtd: "unsupported configuration: emulator '/usr/lib/xen-4.11/bin/qemu-system-i386' not found".
It may be caused by this bug. So we can create a symbolic link sudo ln -s /usr/bin/qemu-system-i386 /usr/lib/xen-4.11/bin/qemu-system-i386, and I hope it works for you too.
Check if you have installed
qemu-system-x86-xen
if not - install
apt install qemu-system-x86-xen
that helped me

How do I connect Airflow to SQLite locally?

I'm trying to try out Airflow for the very first time and I'm trying to connect it to a local SQLite database. But I can't seem to get my head around on how to actually do it.
I've read up on Airflow's document, Set my executor to LocalExecutor and set up my sql_alchemy_conn to sqlite:////home/myName/Programs/sqlite3/DatabaseName.db but it doesn't seem to work as it throws an
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 21, in <module>
from airflow import configuration
File "/usr/local/lib/python2.7/dist-packages/airflow/__init__.py", line 35, in <module>
from airflow import configuration as conf
File "/usr/local/lib/python2.7/dist-packages/airflow/configuration.py", line 520, in <module>
conf.read(AIRFLOW_CONFIG)
File "/usr/local/lib/python2.7/dist-packages/airflow/configuration.py", line 283, in read
self._validate()
File "/usr/local/lib/python2.7/dist-packages/airflow/configuration.py", line 169, in _validate
self.get('core', 'executor')))
airflow.exceptions.AirflowConfigException: error: cannot use sqlite with the LocalExecutor
error when I tried to run airflow initdb. I tried to google around and tried vipul sharma's solution found here and set the value of my sql_alchemy_conn to mysql://:#localhost:3306/ but it still doesn't work as it throws an
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1045, "Access denied for user 'myName'#'localhost' (using password: NO)")
error. I know that the answer should be really simple but I really don't understand how to so I hope you can guide me through on what to do/read.
Use SequentialExecutor
"This executor will only run one task instance at a time, can be used for debugging. It is also the only executor that can be used with sqlite since sqlite doesn’t support multiple connections." airflow documentation
You just didn't need to change to LocalExecutor, change it back to SequentialExecutor, change sql_alchemy_conn to point to sqlite:////home/myName/Programs/sqlite3/DatabaseName.db and stop airflow services (webserver, scheduler).
Execute airflow initdb then start up the services again.
Hopefully that works.

MS SQL to MySQL Transition Using Workbench- Error during reverse engineer selected schemeta

I'm trying to migrate a MS SQL database to MySQL using workbench 6.0 CE. During "reverse engineer selected schemeta" step, I get the "UnicodeDecodeError". I'm wondering how to debug this problem? All the tables name are very straight forward and not using any kind of special characters.
The error log is as below:
Starting...
Connect to source DBMS...
- Connecting...
Connecting to Mssql#DRIVER=SQL Server;SERVER=localhost\instance1...
Opening ODBC connection to DRIVER={SQL Server};SERVER=localhost\instance1;DATABASE={};UID=sa;PWD=XXXX;...
Connected
Connect to source DBMS done
Reverse engineer selected schemata....
Reverse engineering dbo from testdb
- Reverse engineering catalog information
- Reverse engineering User Data Types...
- Preparing...
- Gathered stats for dbo
Reverse engineering 379 tables from dbo
Traceback (most recent call last):
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\modules\db_mssql_grt.py", line 384, in reverseEngineer
reverseEngineerTables(connection, schema)
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\modules\db_mssql_grt.py", line 545, in reverseEngineerTables
table_names = [(row[0], row[1]) for row in execute_query(connection, query % schema.name) ]
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\modules\db_mssql_grt.py", line 130, in <lambda>
con.add_output_converter(-150, lambda value: value if value is None else value.decode('utf-16'))
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\Python\Lib\encodings\utf_16.py", line 16, in decode
return codecs.utf_16_decode(input, errors, True)
**UnicodeDecodeError: 'utf16' codec can't decode byte 0x73 in position 54: truncated data**
Traceback (most recent call last):
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\workbench\wizard_progress_page_widget.py", line 192, in thread_work
self.func()
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\modules\migration_schema_selection.py", line 160, in task_reveng
self.main.plan.migrationSource.reverseEngineer()
File "C:\Program Files (x86)\MySQL\MySQL Workbench CE 6.0.8\modules\migration.py", line 353, in reverseEngineer
self.state.sourceCatalog = self._rev_eng_module.reverseEngineer(self.connection, self.selectedCatalogName, self.selectedSchemataNames, self.state.applicationData)
SystemError: UnicodeDecodeError("'utf16' codec can't decode byte 0x73 in position 54: truncated data"): error calling Python module function DbMssqlRE.reverseEngineer
ERROR: Reverse engineer selected schemata: UnicodeDecodeError("'utf16' codec can't decode byte 0x73 in position 54: truncated data"): error calling Python module function DbMssqlRE.reverseEngineer
Failed
Thanks for your help.
-Deepak
I know is an old issue, but my MySQL Workbench crashed trying to migrate from a SQL Server database for the same reason. I have corrected this problem changing the default encoding to the appropriate one in "C:\Program Files\MySQL\MySQL Workbench 8.0 CE\modules\db_mssql_grt.py" file. I had these two lines (141-142 in my scripts):
con.add_output_converter(-150, lambda value: value if value is None else value.decode('utf-16'))
con.add_output_converter(0, lambda value: value if value is None else value.decode('utf-16'))
In my case, SQL Server is using cp1252, so I change utf-16 to cp1252.

Stanford Tagger in nltk not working due to JVM parameters

I am having a wired error while running following example code snippet
st = StanfordTagger('bidirectional-distsim-wsj-0-18.tagger')
st.tag('What is the airspeed of an unladen swallow ?'.split())
The first line worked properly but second line is giving following error.
Could not create the Java virtual machine.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/nltk-2.0.1rc1- py2.6.egg/nltk/tag/stanford.py", line 51, in tag
return self.batch_tag([tokens])[0]
File "/usr/local/lib/python2.6/dist-packages/nltk-2.0.1rc1-py2.6.egg/nltk/tag/stanford.py", line 77, in batch_tag
stdout=PIPE, stderr=PIPE)
File "/usr/local/lib/python2.6/dist-packages/nltk-2.0.1rc1-py2.6.egg/nltk/internals.py", line 166, in java
raise OSError('Java command failed!')
OSError: Java command failed!
I have tried adding .usr/lib/jvm into path but still not working
It wasn't working for me either. So I tried the following and its working perfectly.
st = POSTagger('path-to/stanford-postagger-full-2012-07-09/models/wsj-0-18-left3words.tagger','path-to/stanford-postagger-full-2012-07-09/stanford-postagger.jar')
and use nltk's tokenize method instead of Python's split()
taggedSentence= st.tag(nltk.word_tokenize(sentence))
I see that question is very outdated, but this days I got same error for unknown reason. It gives me a lot of headache. But I found solution.
First, I installed Oracle Java (here is instructions: How To Manually Install Oracle Java on a Debian or Ubuntu VPS)
Now, my python script told me more information on error. It outputs something like:
Forking JVM: error=12, Cannot allocate memory or error=12, Not enough space
Here you can read more about such problem: Forking the JVM
And to avoid that annoying error I need to edit /etc/sysctl.conf and add the following:
vm.overcommit_memory = 1
Then restart system for the change to take effect.