Unable to run or build images in podman - containers

I recently tried to install podman on my mac.
podman machine init and podman machine start seem to work.
podman machine list
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* qemu 2 hours ago Currently running 1 2.147GB 10.74GB
podman system connection list
Name Identity URI
podman-machine-default* /Users/k/.ssh/podman-machine-default ssh://core#localhost:65137/run/user/1000/podman/podman.sock
podman-machine-default-root /Users/k/.ssh/podman-machine-default ssh://root#localhost:65137/run/podman/podman.sock
So these seem to be OK too...
However, when I try commands like:
podman run -dt -p 8080:80 nginx I get the error:
podman --log-level=debug run -dt -p 8080:80 nginx
INFO[0000] podman filtering at log level debug
DEBU[0000] Called run.PersistentPreRunE(podman --log-level=debug run -dt -p 8080:80 nginx)
DEBU[0000] SSH Ident Key "/Users/k/.ssh/podman-machine-default" SHA256:<redacted> ssh-ed25519
DEBU[0000] Found SSH_AUTH_SOCK "/private/tmp/com.apple.launchd.ESzXNsREXi/Listeners", ssh-agent signer(s) enabled
DEBU[0000] DoRequest Method: GET URI: http://d/v3.4.4/libpod/_ping
DEBU[0000] Adding port mapping from 8080 to 80 length 1 protocol ""
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf"
DEBU[0000] No credentials for https://index.docker.io/v1/ found
DEBU[0000] Found credentials for docker.io in credential helper containers-auth.json in file /Users/k/.config/containers/auth.json
Traceback (most recent call last):
File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/k/Downloads/google-cloud-sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/k/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/usr/local/Cellar/python#3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/k/Downloads/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
DEBU[0000] Error looking up credentials for staging-k8s.gcr.io in credential helper containers-auth.json: error getting credentials - err: exit status 1, out: ``
Error: 1 error occurred:
* error getting credentials - err: exit status 1, out: ``
I'm at a loss as to why this exception is coming and why is it picking up google SDK. I don't think I have registered on GCR in podman....
Additionally, I logged into docker.io with podman (successful) but it still throws this error.
This is the same error if I try to build a dockerfile as well.
How do I debug this?
podman --version
podman version 3.4.4
MacOS Monterey 12.1 (Intel MacBook)

Related

How to connect superset with mysql database?

I was trying to connect superset with mysql database with this SQLAlchemy URI:mysql://localhost:3306/mysql/database/table1 but not able to connect.
I was getting this error:
ERROR: {"error": "Connection failed!
The error message returned was:
No module named 'MySQLdb'", "stacktrace": "Traceback (most recent call last):
File \"/Users/akay/venv/lib/python3.7/site-packages/superset/views/core.py\", line 1703, in testconn
engine = database.get_sqla_engine(user_name=username)
File \"/Users/akay/venv/lib/python3.7/site-packages/superset/utils/core.py\", line 131, in __call__
value = self.func(*args, **kwargs)
File \"/Users/akay/venv/lib/python3.7/site-packages/superset/models/core.py\", line 923, in get_sqla_engine
return create_engine(url, **params)
File \"/Users/akay/venv/lib/python3.7/site-packages/sqlalchemy/engine/__init__.py\", line 479, in create_engine
return strategy.create(*args, **kwargs)
File \"/Users/akay/venv/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py\", line 87, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File \"/Users/arkay/venv/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.py\", line 118, in dbapi
return __import__(\"MySQLdb\")
ModuleNotFoundError: No module named 'MySQLdb'
"}
Is there any way to connect to a MySQL database?
MySQLdb is not compatible with Python 3, You need to use pymysql.
Install pymysql:
$ pip install pymysql
Connect to mysql data source with below URI string.
mysql+pymysql://user:pass#host/databasename
Configure your database user with hostname=localhost
You need to install mysql-connector-python module:
$ pip install mysql-connector-python
Had similiar issue. I'm sure this will save time for some of you out there:
Use 127.0.0.1 instead of localhost.
Here is the perfect template for MySQL string:
SQLALCHEMY_DATABASE_URI = 'mysql://username:password#127.0.0.1:3306/schema-name'
Install MySQL:
pip3 install mysqlclient
Upgrade SQLAlchemy:
pip install sqlalchemy==1.3.24
Load DB:
superset db upgrade
Create Admin user:
superset fab create-admin
If you are using Docker try using host.docker.internal as host name. It worked for me

Unable to restore couchbase bucket using cbrestore

I am using Couchbase Server version 4.5.0 and trying to restore a saved backup version onto my local CB server. I am using macOS Sierra
Xcode Development tools are up to date
Python v2.7.10
I First created a backup by using this command
sudo ./cbbackup HOST:PORT ~/Documents/ -u ‘username’ -p ‘password‘ -b BUCKET_NAME
After this I tried restoring this backup onto local Couchbase server using this command
sudo ./cbrestore /path/to/backup/2017-01-24T121528Z/2017-01-24T121528Z-full/ http://localhost:8091 -u ‘USERNAME’ -p ‘PASSWORD’ --bucket-source=SOURCE_BUCKET_NAME --bucket-destination=DESTINATION_BUCKET_NAME
but I am getting following error.
Exception in thread s0:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_mc.py", line 91, in run
rv, batch, need_backoff = self.scatter_gather(mconns, batch)
File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 72, in scatter_gather
rv, conn = self.find_conn(mconns, vbucket_id, msgs)
File "/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/lib/python/pump_cb.py", line 316, in find_conn
host_port = serverList[vBucketMap[vbucket_id][0]]
IndexError: list index out of range
If you took you're backup on a non-osx version of Couchbase and are restoring to an osx version then you need to use "-x rehash=1" with cbrestore. The reason is that the osx version of Couchbase is for development only and has less vbuckets then the standard (non-osx) Couchbase versions. The rehash flag tells cbrestore to deal with the different number of vbuckets.

Failed to clone an exist mysql server using mysqlserverclone utilities

I installed mysql server 5.7.12 utilities 1.5.6 using mysql installer for windows. I configed mysql-server through installer wizard. Then, I try to clone this server using mysqlcloneserver utilities:
mysqlserverclone --server=root:mysql#localhost:3306 --new-data="C:/Users/quyet/Documents/DBMS/fabric/store" --mysqld="--server-id=2 --log-bin --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency" --new-port=13000 --delete-data
The command ouput this error after run the command:
WARNING: Using a password on the command line interface can be insecure.
# WARNING: Root password for new instance has not been set.
# Cloning the MySQL server running on localhost.
The console has detected that the utility 'mysqlserverclone' ended with an error code.
You can get more information about the error by running the console command 'show last error'.
I run command:
show last error
and get this output:
Execution of utility: 'mysqlserverclone --server=root:mysql#localhost:3306 --new-data=C:/Users/quyet/Documents/DBMS/fabric/store --mysqld=--server-id=2 --log-bin --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency --new-port=13000 --delete-data' ended with return code '1' and with the following error message:
Traceback (most recent call last):
File "G:\ade\build\sb_0-16486154-1442332453.92\Python-2.7.6-windows-x86-32bit\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
File "scripts\mysqlserverclone.py", line 211, in <module>
File ".\mysql\utilities\command\serverclone.py", line 180, in clone_server
File ".\mysql\utilities\common\tools.py", line 254, in get_mysqld_version
IOError: [Errno 13] Permission denied: 'version_check'
I has searched on google but found any similar problems.
Any help will be much appreciated !
A bit outdated, but it might help.
Run Mysql Utils console as administrator

No module named celery when installing ckanext-archiver

I'm using CKAN as my open data portal and am trying to install the Archiver Extension by following the instructions at https://github.com/ckan/ckanext-archiver. However I am faced with this error which I could not solve after enabling the archiver in my ckan config file.
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
result = self.command()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
relative_to=base, global_conf=vars)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/serve.py", line 321, in loadapp
**kw)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/usr/lib/ckan/default/src/ckan/ckan/config/middleware.py", line 57, in make_app
load_environment(conf, app_conf)
File "/usr/lib/ckan/default/src/ckan/ckan/config/environment.py", line 232, in load_environment
p.load_all(config)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 134, in load_all
load(*plugins)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 149, in load
service = _get_service(plugin)
File "/usr/lib/ckan/default/src/ckan/ckan/plugins/core.py", line 255, in _get_service
return plugin.load()(name=plugin_name)
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources.py", line 2147, in load
['__name__'])
File "/usr/lib/ckan/default/src/ckanext-archiver/ckanext/archiver/plugin.py", line 10, in <module>
from ckan.lib.celery_app import celery
File "/usr/lib/ckan/default/src/ckan/ckan/lib/celery_app.py", line 12, in <module>
from celery import Celery
ImportError: No module named celery
I have installed the extension from an activated virtualenv and the required libraries.
sudo pip install -e git+http://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
Obtaining ckanext-archiver from git+http://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
Updating ./src/ckanext-archiver clone
Running setup.py egg_info for package ckanext-archiver
Installing collected packages: ckanext-archiver
Running setup.py develop for ckanext-archiver
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
Creating /usr/local/lib/python2.7/dist-packages/ckanext-archiver.egg-link (link to .)
ckanext-archiver 0.1 is already the active version in easy-install.pth
Installed /home/kean/src/ckanext-archiver
Successfully installed ckanext-archiver
sudo pip install requirements.txtDownloading/unpacking requirements.txt
Real name of requirement requirements.txt is requirements.txt
Could not find any downloads that satisfy the requirement requirements.txt
No distributions at all found for requirements.txt
Storing complete log in /home/kean/.pip/pip.log
Appreciate if anyone knows how to fix this. Thanks.
Do not call sudo pip install when you are using virtualenv, just pip install.
I had some issues executing:
pip install -e git://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
which resulted with
no matches found: git://github.com/okfn/ckanext-archiver.git#egg=ckanext-archiver
but below commands worked just fine:
cd /tmp/
git clone git://github.com/okfn/ckanext-archiver.git
pip install -e ./ckanext-archiver
pip install -r ckanext-archiver/pip-requirements.txt

mysql-workbench on Slackware 13.37 KDE error

After many hours of installing various libraries on my Slackware 13.37 i managed to start mysql-workbench (but I was wrong).
When launched from command line i get this warning:
bash-4.2# mysql-workbench
** Message: Gnome keyring daemon seems to not be available. Stored passwords will be lost once quit
Traceback (most recent call last):
File "/usr/local/lib/mysql-workbench/modules/wb_admin_ssh.py", line 43, in <module>
import paramiko
ImportError: No module named paramiko
Warning! Can't use connect with timeout in paramiko None
Traceback (most recent call last):
File "/usr/local/lib/mysql-workbench/modules/wb_admin_grt.py", line 27, in <module>
import wb_admin_main
File "/usr/local/lib/mysql-workbench/modules/wb_admin_main.py", line 29, in <module>
import wb_admin_monitor
File "/usr/local/lib/mysql-workbench/modules/wb_admin_monitor.py", line 21, in <module>
import wba_monitor_be
File "/usr/local/lib/mysql-workbench/modules/wba_monitor_be.py", line 26, in <module>
import wb_admin_ssh
File "/usr/local/lib/mysql-workbench/modules/wb_admin_ssh.py", line 119, in <module>
log_warning(_this_file, 'Cannot use connect with timeout in paramiko version %s\n' % paramiko.__version__)
AttributeError: 'NoneType' object has no attribute '__version__'
** Message: Failed loading module '/usr/local/lib/mysql-workbench/modules/wb_admin_grt.py' (python)
Ready.
the main program window appear and when i try to make a new connection i get this error :
Traceback (most recent call last):
File "/usr/local/share/mysql-workbench/sshtunnel.py", line 14, in <module>
import paramiko
ImportError: No module named paramiko
** (mysql-workbench-bin:2919): WARNING **: Tunnel manager could not be executed
and a popup appears:
Failed to Connect to MySQL at 127.0.0.1:3306 with user root Cannot
start SSH tunnel manager
mysql and ssh is installed and configured correctly:
bash-4.2# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.24 MySQL Community Server (GPL)
bash-4.2# ssh -v
OpenSSH_6.0p1, OpenSSL 0.9.8x 10 May 2012
can someone help me please !!!
It tells you that the python-paramiko module is missing. It is a python module for SSH connections; apparently that is used by one of the MySQL Workbench features. Get the slackware package here and install it executing
sudo installpkg paramiko-1.7.6-noarch-1gds.txz
Good luck!
Good answer above. On 64 bit systems, you have to install specific 32 bit libraries for workbench to work. E.g I had to install 32 bit python alongside the 64 bit python.
Also common errors include distribution specific errors. "/etc/mysql/my.cnf" not found, I created a soft link from /etc/my.cnf. Also had to create a folder at /root/.mysql/workbench/log for workbench to launch