Error on command: docker run direvius/yandex-tank - docker

I just started with yandex-tank, and has failed at first step.
I am trying to execute command
docker run direvius/yandex-tank
And got an error:
Traceback (most recent call last):
File "/usr/local/bin/yandex-tank", line 11, in <module>
load_entry_point('yandextank==1.12.1', 'console_scripts', 'yandex-tank')()
File "/usr/local/lib/python2.7/dist-packages/yandextank/core/cli.py", line 130, in main
log_handlers=handlers
File "/usr/local/lib/python2.7/dist-packages/yandextank/core/consoleworker.py", line 327, in __init__
self.config_list = self._combine_configs(configs, cli_options, cfg_patches, cli_args, no_local)
File "/usr/local/lib/python2.7/dist-packages/yandextank/core/consoleworker.py", line 354, in _combine_configs
parse_and_check_patches(cfg_patches) + \
File "/usr/local/lib/python2.7/dist-packages/yandextank/core/consoleworker.py", line 77, in load_cfg
with open(cfg_filename) as f:
IOError: [Errno 2] No such file or directory: 'load.yaml'
My enviroment is Windows. And I am don't understand how can I add load.yaml without running container? And I can't run container without load.yaml

yandex-tank uses load.yaml in the directory as the default config file. However, the image of the container doesn't have such file https://github.com/yandex/yandex-tank/blob/develop/docker/Dockerfile.
Given that its entrypoint launches yandex-tank right away, I guess you will need to create a new image, using as base FROM direvius/yandex-tank, and COPY your configuration to this image, either as the default value load.yaml, or with a different name / path (in this case, you must use -c option when running the image).
You cannot run direvius/yandex-tank and then docker cp load.yaml <container_path>, because since the very moment you run the container, it crashes with the error you got.

Related

Trouble Installing Frappe on Docker

As I have stated in the title, I'm having trouble installng Frappe/ERPNext on my Docker. I followed instructions from their official Github repo here.
After opening frappe_docker folder in VSCode, when trying to execute the bench init command I got an error. Below are the full code:
frappe#84badc593d50:/workspace/development$ bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench
Traceback (most recent call last):
File "/home/frappe/.bench/bench/commands/make.py", line 68, in init
init(
File "/home/frappe/.bench/bench/utils/render.py", line 105, in wrapper_fn
return fn(*args, **kwargs)
File "/home/frappe/.bench/bench/utils/system.py", line 63, in init
bench.setup.dirs()
File "/home/frappe/.bench/bench/utils/render.py", line 126, in wrapper_fn
return fn(*args, **kwargs)
File "/home/frappe/.bench/bench/bench.py", line 337, in dirs
os.makedirs(self.bench.name, exist_ok=True)
File "/home/frappe/.pyenv/versions/3.10.5/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'frappe-bench'
I have had user added to docker group as per instruction and have followed it step by step but I got the error above. I've tried run chmod -R frappe:frappe * at the frappe folder but the error still persist.
My machine is running Pop!_OS 20.04 and Docker Desktop 4.16.1
My bad guys, I found the answer.
All I need to do was run chown frappe:frappe /workspace/development/ and all is well. I can run bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench without a problem after that.

Ros2 not finding executables running in Docker

I'm trying to run a python script with ros2 in my docker container, and everything up to running the Script works, I can even run Gazebo via a launch file, and it works.
The Error ROS gives me is the following:
root#86d8bf3a6eb9:/# ros2 run field_robot robot_spawner.py
Traceback (most recent call last):
File "/opt/ros/foxy/bin/ros2", line 11, in <module>
load_entry_point('ros2cli==0.9.11', 'console_scripts', 'ros2')()
File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/cli.py", line 67, in main
rc = extension.main(parser=parser, args=args)
File "/opt/ros/foxy/lib/python3.8/site-packages/ros2run/command/run.py", line 70, in main
return run_executable(path=path, argv=args.argv, prefix=prefix)
File "/opt/ros/foxy/lib/python3.8/site-packages/ros2run/api/__init__.py", line 61, in run_executable
process = subprocess.Popen(cmd)
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/field_robot/dev_ws/install/field_robot/lib/field_robot/robot_spawner.py'
And yes, I checked, the File actually exists:
root#86d8bf3a6eb9:/# ls -l /field_robot/dev_ws/install/field_robot/lib/field_robot/robot_spawner.py
-rwxr-xr-x 1 root root 1964 Apr 12 14:37 /field_robot/dev_ws/install/field_robot/lib/field_robot/robot_spawner.py
Also, I'm running the Host system on Windows, so it could be that something with windows is fucked up, so if you have an Idea what could be the Problem there, that also might be it
Based on the comments it appears you're running into this issue because of the file type. If they're being edited in Windows first it is likely they are DOS files and not UNIX files. I know this causes issues with ROS1 so I assume it's the case in ROS2 as well. To fix this, you have a couple of options.
Usually the easiest would be to use dos2unix. This isn't installed by default but you can get it via apt install dos2unix assuming your image is Ubuntu. The files can be converted by running dos2unix <filename> inside your container.

How to invoke conan in docker container by jenkins? error Failed to execute script conan

Using Docker as a build environment, My jenkinsfile starting specified docker container and invoking CMake which trigger build process using conan and so on. Unfortunately pipeline failed with the following output:
-- Conan: checking conan executable
-- Conan: Found program /usr/bin/conan
-- Conan: Version found [148] Failed to execute script conan
Traceback (most recent call last):
File "conan/conans/conan.py", line 11, in <module>
File "conan/conans/conan.py", line 7, in run
File "conan/conans/client/command.py", line 2151, in main
File "conan/conans/client/conan_api.py", line 222, in factory
File "conan/conans/client/conan_api.py", line 234, in __init__
File "conan/conans/client/migrations.py", line 26, in __init__
File "conan/conans/client/cache/cache.py", line 78, in __init__
File "conan/conans/client/cache/cache.py", line 150, in config
File "conan/conans/util/files.py", line 190, in save
FileNotFoundError: [Errno 2] No such file or directory: '/.conan/conan.conf'
-- Conan executing: /usr/bin/conan install . -s build_type=Release -s compiler=clang -s compiler.version=10 -s compiler.libcxx=libstdc++11 -g=cmake --build=missing
[176] Failed to execute script conan
Traceback (most recent call last):
I do not know what the problem is. If I start container and build it manually it works.
If I create it manually then I am getting following error:
Conan: Version found ERROR: Can't write version file in /.conan/version.txt
I added the following environment variable to my jenkinsfile. Then it simply works!. I was trying to define env variables in docker container that was my fail
environment {
CONAN_USER_HOME = "${env.WORKSPACE}/"
CONAN_NON_INTERACTIVE = 1
}

Airflow CLI command does not find the SQL_ALCHEMY_CONN variable in Docker

I am new to running airflow in docker. To run a airflow cli command, it used to be simply possible to run airflow trigger_dag etc. However, that clearly doesn't work anymore right away.
I found out I can get 'in' the container by docker exec -ti <container_name> bash. However, if I then try to run an airflow cli command, I get the following:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 16, in <module>
from airflow import configuration
File "/usr/local/lib/python3.5/dist-packages/airflow/__init__.py", line 31, in <module>
from airflow import settings
File "/usr/local/lib/python3.5/dist-packages/airflow/settings.py", line 150, in <module>
configure_orm()
File "/usr/local/lib/python3.5/dist-packages/airflow/settings.py", line 136, in configure_orm
engine = create_engine(SQL_ALCHEMY_CONN, **engine_args)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/__init__.py", line 424, in create_engine
return strategy.create(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/strategies.py", line 50, in create
u = url.make_url(name_or_url)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/url.py", line 211, in make_url
return _parse_rfc1738_args(name_or_url)
File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/url.py", line 270, in _parse_rfc1738_args
"Could not parse rfc1738 URL from string '%s'" % name)
sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string ''
It looks like it doesn't take the SQL_ALCHEMY_CONN. However, if I run printenv it does show up.
Can anyone help me?
I ran into this issue. My setup is Docker using Ubuntu 16.04. I used Python3.
When i print ENV, i realized AIRFLOW__CORE__SQL_ALCHEMY_CONN was set to blank. Once i fixed that the issue was resolved.
You said SQL_ALCHEMY_CONN, Environment variable should be referred to as AIRFLOW__CORE__SQL_ALCHEMY_CONN
Make sure it is setup correctly. The order of precedence in airflow is a) Environment variables 2) Configuration in airflow.cfg file link

BigChainDB in Docker immediately crashes with Connection Refused?

I'm on Win10 x64 following the instructions at https://docs.bigchaindb.com/projects/server/en/latest/appendices/run-with-docker.html
Because I'm running in windows (and don't have $HOME), here's the actual commands I'm running:
docker run --rm -v "C:/bigchaindb_docker:/data" -ti bigchaindb/bigchaindb -y configure rethinkdb
docker run -v "C:/bigchaindb_docker:/data" -d --name bigchaindb -p "58080:8080" -p "59984:9984" bigchaindb/bigchaindb start
The first command seems to execute just fine. I see a .bigchaindb file in my C:/bigchaindb_docker folder. The second command will start a container but around 6 seconds later the container exits with code 1. I ran docker start <container> && docker attach <container> and was able to get this dump:
INFO:bigchaindb.commands.bigchain:BigchainDB Version 0.10.0.dev
INFO:bigchaindb.config_utils:Configuration loaded from `/data/.bigchaindb`
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 271, in __init__
self._socket = socket.create_connection((self.host, self.port), timeout)
File "/usr/lib/python3.5/socket.py", line 711, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/bigchaindb", line 11, in <module>
load_entry_point('BigchainDB', 'console_scripts', 'bigchaindb')()
File "/usr/src/app/bigchaindb/commands/bigchain.py", line 401, in main
utils.start(create_parser(), sys.argv[1:], globals())
File "/usr/src/app/bigchaindb/commands/utils.py", line 96, in start
return func(args)
File "/usr/src/app/bigchaindb/commands/bigchain.py", line 201, in run_start
_run_init()
File "/usr/src/app/bigchaindb/commands/bigchain.py", line 142, in _run_init
schema.init_database(connection=b.connection)
File "/usr/src/app/bigchaindb/backend/schema.py", line 99, in init_database
create_database(connection, dbname)
File "/usr/lib/python3.5/functools.py", line 743, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "/usr/src/app/bigchaindb/backend/rethinkdb/schema.py", line 17, in create_database
if connection.run(r.db_list().contains(dbname)):
File "/usr/src/app/bigchaindb/backend/rethinkdb/connection.py", line 49, in run
self._connect()
File "/usr/src/app/bigchaindb/backend/rethinkdb/connection.py", line 73, in _connect
self.conn = r.connect(host=self.host, port=self.port, db=self.dbname)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 661, in connect
return conn.reconnect(timeout=timeout)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 572, in reconnect
return self._instance.connect(timeout)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 430, in connect
self._socket = SocketWrapper(self, timeout)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 337, in __init__
(self.host, self.port, str(ex)))
rethinkdb.errors.ReqlDriverError: Could not connect to localhost:28015. Error: [Errno 111] Connection refused
I am looking into using BigChainDB and I don't know much about it. I'd guess that it's trying to connect to rethinkdb and it's not running. I don't know where to begin to fix that, I've never used rethinkdb either. Has anybody run into this problem before?
From the first line of the logs you provided it looks like you are running the master branch:
INFO:bigchaindb.commands.bigchain:BigchainDB Version 0.10.0.dev
It used to be that the latest tag of a BigchainDB (docker) image would point to the latest master branch. This was changed recently such that it now points to the latest release, matching what is on the Python Package Index (PyPI).
So if you pull the image again it should update to the latest release which at the time of writing is 0.9.5. That is:
docker pull bigchaindb/bigchaindb
or equivalently:
docker pull bigchaindb/bigchaindb:latest
or explicitly pulling the tag 0.9.5:
docker pull bigchaindb/bigchaindb:0.9.5
If you use version 0.9.5, and try the two commands you posted it should work.
If you wish to use the latest master branch, then you will need to run RethinkDB since it is no longer embedded in the Docker image. Detailed instructions can be found in the master version of the BigchainDB documentation under the Run the backend database section.

Resources