Having trouble copying a remote database - mysql

I am new to MySQL Workbench, and I'm having trouble copying a remote database into my local drive.
I don't have trouble connecting to either my local or the remote, but when I try to copy the database from remote, I get the following error message:
Traceback (most recent call last):
File "/Applications/MySQLWorkbench.app/Contents/Resources/plugins/db_copy_progress.py", line 155, in thread_work
self.func()
File "/Applications/MySQLWorkbench.app/Contents/Resources/plugins/db_copy_progress.py", line 641, in _row_count
total = self._transferer.count_table_rows(self._working_set)
File "/Applications/MySQLWorkbench.app/Contents/Resources/plugins/DataMigrator.py", line 285, in count_table_rows
raise Exception("Error getting row count from source tables, wbcopytables exited with code %s" % out.returncode)
Exception: Error getting row count from source tables, wbcopytables exited with code 1
ERROR: Counting table rows to copy: Error getting row count from source tables, wbcopytables exited with code 1
Failed

Related

Unable to create instance from CLI

I've installed the single DevStack and been able to create a compute instance through the WUI, but if I try and perform the same task from the CLI I receive the following error
Traceback (most recent call last): File "/opt/stack/nova/nova/conductor/manager.py", line 703, in build_instances raise exception.MaxRetriesExceeded(reason=msg) nova.exception.MaxRetriesExceeded: Exceeded maximum number of retries. Exhausted all hosts available for retrying build failures for instance 1a5e912b-dac4-4633-834d-3a49800edd74.
Looking at that line in the code it would appear to suggest it's unable to schedule the build; though why would it work through the WUI?
Thanks.

gcloud crashing due to (SSLHandshakeError): [SSL: UNKNOWN_PROTOCOL]

I have installed gcloud sdk by following the link https://cloud.google.com/sdk/docs/downloads-apt-get on Ubuntu 16.04.6 LTS. I have also done the proxy configuration using the following link https://cloud.google.com/sdk/docs/proxy-settings.
Google Cloud SDK 288.0.0
alpha 2020.04.03
beta 2020.04.03
bq 2.0.56
core 2020.04.03
gsutil 4.49
kubectl 2020.04.03
gcloud init is successful and gcloud info --run-diagnostics displays no problems. However gcloud crashes for any other commands I run. I have tried the following commands.
1. gcloud compute images list
2. gcloud services list
3. gcloud logging logs list
Here is the message I get after the crash.
ERROR: gcloud crashed (SSLHandshakeError): [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
If you would like to report this issue, please run the following command:
gcloud feedback
To check gcloud for common problems, please run the following command:
gcloud info --run-diagnostics
Can someone please help.
PS. Here is debug output.
DEBUG: Running [gcloud.compute.images.list] with arguments: [--verbosity: "debug"]
INFO: Refreshing access_token
INFO: Display format: " table(
name,
selfLink.map().scope(projects).segment(0):label=PROJECT,
family,
deprecated.state:label=DEPRECATED,
status
)"
DEBUG: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 983, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 809, in Run
display_info=self.ai.display_info).Display()
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/display.py", line 483, in Display
self._printer.Print(self._resources)
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/resource/resource_printer_base.py", line 275, in Print
for resource in resources:
File "/usr/lib/google-cloud-sdk/lib/surface/compute/images/list.py", line 113, in _FilterDeprecated
for image in images:
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/lister.py", line 1065, in __call__
errors=errors):
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/request_helper.py", line 204, in ListJson
for item in _ListCore(requests, http, batch_url, errors, _HandleJsonList):
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/request_helper.py", line 134, in _ListCore
requests=requests, http=http, batch_url=batch_url)
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/compute/batch_helper.py", line 106, in MakeRequests
batch_request_callback=batch_checker.BatchCheck)
File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/batch.py", line 226, in Execute
batch_http_request.Execute(http)
File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/batch.py", line 492, in Execute
self._Execute(http)
File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/batch.py", line 449, in _Execute
response = http_wrapper.MakeRequest(http, request)
File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/http_wrapper.py", line 356, in MakeRequest
max_retry_wait, total_wait_sec))
File "/usr/bin/../lib/google-cloud-sdk/lib/third_party/apitools/base/py/http_wrapper.py", line 304, in HandleExceptionsAndRebuildHttpConnections
raise retry_args.exc
SSLHandshakeError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
ERROR: gcloud crashed (SSLHandshakeError): [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
I got it working after some debugging. Seems like firewall was the issue in my case. I shifted to python 3.5 . After which I ran the same command gcloud compute images list
I got the error "Caught socket error, retrying request to url https://compute.googleapis.com/batch/compute/v1". Adding this url to firewall exception solved my issue.

mysql.connector+mysql hangs on fetching

I have a database that is accessed from python3 script using mysql.connector. Mysql version is 5.5.58-0ubuntu0.14.04.1, tested on Linux Mint 17 x64 and a few other Linux machines. The script requests a chunk of data (from tens to about five thousand records) and then sends about ten times as many single-row requests. After that, the connection is closed and a new one opens to do the same. Alternatively, several connections are run in parallel. The entire script is available at github
It works fine for ~5 to ~50 times (per process, if launched in multiprocessing pool), then hangs. The python3 process is sleeping, mysql shows a single sleeping connection per process. If the script is killed, the traceback is following:
Traceback (most recent call last):
File "/home/morozov/tools/phylome/process_outers.py", line 116, in <module>
r = wrapper(fasta)
File "/home/morozov/tools/phylome/process_outers.py", line 108, in wrapper
password=args.p, database=args.d)
File "/home/morozov/tools/phylome/process_outers.py", line 43, in process_fasta
result = cursor.fetchall()
File "/usr/local/lib/python3.4/dist-packages/mysql/connector/cursor.py", line 825, in fetchall
(rows, eof) = self._connection.get_rows()
File "/usr/local/lib/python3.4/dist-packages/mysql/connector/connection.py", line 671, in get_rows
rows = self._protocol.read_text_result(self._socket, count)
File "/usr/local/lib/python3.4/dist-packages/mysql/connector/protocol.py", line 309, in read_text_result
packet = sock.recv()
File "/usr/local/lib/python3.4/dist-packages/mysql/connector/network.py", line 245, in recv_plain
read = self.sock.recv_into(packet_view, rest)
KeyboardInterrupt
After restarting the script, the file it hang on is processed alright and it hangs on some other one down the line. What should I fix to keep it running?
Still not the slightest idea what was wrong, but using pymysql instead of mysql.connector fixed it.

Tryton ERP MySQL installation

I'm trying to install Tryton ERP with MySQL as the database. It's not quite clear what you are meant to do.
From the config documentation you simply supply the uri to the database under the [database] section:
[database]
uri = mysql://user:pass#localhost:3306
However running trytond -v -c /home/user/.config/tryton/3.8/tryton.conf does not seem to get it working. When trying to access the 127.0.0.1:8050 where I've got Tryton running, I simply get 127.0.0.1 - - [23/Nov/2015 16:55:10] code 404, message File not found
One would assume, Tryton either installs the database on its own or you need to create yourself somehow but I didn't see any documentation surrounding that.
I've also trying adding a database through the Tryton GUI, it encounters the following error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tryton/gui/window/dbcreate.py", line 65, in server_change
common.refresh_langlist(self.combo_language, host, port)
File "/usr/local/lib/python2.7/dist-packages/tryton/common/common.py", line 253, in refresh_langlist
lang_list = rpc.db_exec(host, port, 'list_lang')
File "/usr/local/lib/python2.7/dist-packages/tryton/rpc.py", line 57, in db_exec
result = getattr(connection.common.db, method)(None, None, *args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 271, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
File "/usr/local/lib/python2.7/dist-packages/tryton/jsonrpc.py", line 134, in close
return json.loads(self.data, object_hook=object_hook)
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 505, in loads
return cls(encoding=encoding, **kw).decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 389, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value: line 1 column 2 (char 1)
I've got the prerequisites installed that were listed here and MySQL-python package installed, should there be anything else?
You should create a database on MySQL with it's own tools. Once the database is created you must initialize it using the following command:
trytond -c <config_file> -d <database name> --all
See for complete reference:
http://doc.tryton.org/3.8/trytond/doc/topics/setup_database.html#topics-setup-database.
Once finished, the server will ask for an admin password. Once entered you can conect using the tryton client with the admin user and the entered password.
In order to access tryton from web client you must install and configure the sao web interface, that can be found on:
https://www.npmjs.com/package/tryton-sao

exception when using ipy64 with pypyodbc

I'm trying to create a database with MSAccess using pypyodbc on Ironpython. I have this working perfectly fine on my old machine, but I must migrate to a new machine. However on the new machine I get an exception trying to run the same script.
Using python I can create a database without errors.
ipy
import pypyodbc
pypyodbc.win_create_mdb('C:\database.mdb')
pypyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\database.mdb;')
However, if I try the same using ipy64 I get an Exception
"Access Driver is not found"
Traceback (most recent call last):
File "", line 1, in
File "C:\IronPython27\pypyodbc.py", line 2564, in win_create_mdb
Exception: Access Driver is not found.
I installed the AccessDatabaseEngine_x64 as I have 64-bit office products installed.
Thanks,
John.