Any ecs-cli command produces the error:
ERRO[0000] Error initializing: key-value delimiter not found: -
For example,
$ ecs-cli ps
How can I fix it?
Old one, but for me deleting the ~/.ecs/config file helped.
Just run ecs-cli config --region ... --access-key ... afterwards and it will configure properly.
Related
I have an exe file which executing some commands in docker container (ubuntu) that should make a build and run application. In some step I need to make a copy of dist file and command looks like this
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v //f/bigaboo/repos/ledger://f/bigaboo/repos/ledger --workdir=//f/bigaboo/repos/ledger bbcli_executor bash -c "cp ./public/index.php.dist ./public/index.php"
When I just run this command in the terminal all works well but if it's under exe control I have this output
./public/index.php.dist: -c: line 1: unexpected EOF while looking for matching `"'
./public/index.php.dist: -c: line 2: syntax error: unexpected end of file
2022/10/31 22:14:42 Failed to create index.php`. Error -> exit status 2
Looks like script don't recognize strings under exe.
I've tried to wrap cp in '',`` and \x22 but I've got the same result but with different symbols also I've tried to change encoding also without success :(
The following line fails when run in a alpine docker container:
toDelete=( $(curl --silent $url/_cat/indices\?format=json | jq -r '.[].index | select(startswith('\".kibana\"'))') )
The following error message appears:
run.sh: line 1: syntax error: unexpected "("
When I run the command in the terminal on my mac, everything works properly. The brackets are added so that the result (variable toDelete) is interpreted as array and can be looped through with a for loop like so:
for index in "${toDelete[#]}"; do
curl -X DELETE $url/$index
done
Any help in how to solve this problem is appreciated!
Marking down the answer.
The issue was with the interpreter.
worked after making the below change.
["/bin/ash", "run.sh"]
the passed one was
["/bin/sh", "run.sh"]
I installed Flume
and tried to run this command
flume-ng agent -n $agent_name -c conf -f /home/gautham/Downloads/apache-flume-1.5.0.1-bin/conf/flume-conf.properties.template
and I get this exception
ERROR node.Application: A fatal error occurred while running. Exception follows.
org.apache.commons.cli.MissingArgumentException: Missing argument for option: n
at org.apache.commons.cli.Parser.processArgs(Parser.java:343)
at org.apache.commons.cli.Parser.processOption(Parser.java:393)
at org.apache.commons.cli.Parser.parse(Parser.java:199)
at org.apache.commons.cli.Parser.parse(Parser.java:85)
at org.apache.flume.node.Application.main(Application.java:252)
Check if you are named your flume file with .conf extension.
And try to use the below command:
$ flume-ng agent \
--conf-file PathOfYourFlumeFile\
--name agentameInFlumeFile\
--conf $FLUME_HOME/conf \
Change $agent_name with the name of agent you have used in your flume file.
You have to mention path of flume file with .conf extension instead of this /home/gautham/Downloads/apache-flume-1.5.0.1-bin/conf/flume-conf.properties.template
Instead of $agent_name use the actual name of the agent in your conf file.
I suspect that you do not have an $agent_name environment variable so it's being replaced with empty string.
I had this similar issue. Later found out that by replacing all the hyphens(-) with hyphens again, it started working. Probably when i copied this command, the hyphens were replaced with minus(-) signs.
I'm trying to test the supposed flaw in OS X Lion, of how unprotected the password is, on my own computer (from this article). But when I enter the code the in terminal that is supposed to extract the password hash:
$ dscl localhost -read /Search/Users/<root user>
I get this:
-bash: syntax error near unexpected token `newline'
is there any way to get around this?
When you see <xxx> in a command-line command, it typically means "substitute something here". For example,
$ ls <file>
doesn't mean to literally type in ls <file> in your Terminal, but to type in ls followed by some filename.
In this case, they want you to substitute the name of your root user for <root user>. For most machines, that is simply root.
In Azure bash shell in case your scenarios is this:
$ az webapp stop \
--resource-group learn-f69ca399-f99b-4950-84a6-bda8206c6ba0 \
--name <apiyoachola>
bash: syntax error near unexpected token `newline'
This should solve it
$ az webapp stop \
--resource-group learn-f69ca399-f99b-4950-84a6-bda8206c6ba0 \
--name apiyoachola
I run the following command from the Windows command line to backup my database:
...\right_path\mysqldump --add-drop-database --databases my_database_name
--defaults-extra-file=d:\1.cnf
where d:\1.cnf contains the following:
[client]
user="my_user"
password="my_password"
Unfortunately, I got the following error message:
mysqldump: unknown variable 'defaults-extra-file=d:\1.cnf'
If I do:
...\right_path\mysqldump --add-drop-database --databases my_database_name
--user="my_user" --password="my_password"
it works as expected.
What am I doing wrong ?
I found the answer: --defaults-extra-file must be the first option. This works as expected:
...\right_path\mysqldump --defaults-extra-file=d:\1.cnf
--add-drop-database --databases my_database_name
For future reference:
The accepted answer is correct and it is required to place --defaults-extra-file option at the first position.
To try it with containers one option is:
$ docker network create dbnet
$ docker run --network dbnet -it --rm \
--name db -e MYSQL_ROOT_PASSWORD=example \
mysql echo "[client]\npassword=example\n">.mydbcreds.cnf
$ docker run --network dbnet -it --rm \
--name db-client -v "$PWD:/app/" mysql \
mysql --defaults-extra-file=/app/.mydbcreds.cnf \
--host db --user root \
-e "SHOW SCHEMAS;"
Not to forget to keep credentials safe and out of VCS:
echo ".mydbcreds.cnf">>.gitignore
The file can contain all connection parameters (host, user, etc.).
Unfortunately, this file can not contain database name, which would be awesome to have a different file per environment.
Now we have all for connection in file and DB name set in the command.
Also meet this problem. Found there's another situation that would cause --defaults-extra-file option not recognized.
When you changed IFS in script, it's possible to hit this problem. The solution is to reset IFS before execute mysql statement.
For reference.
I realize this is Linux-specific, but my searches brought me here.
I'm using bitnami's LAMP stack, and found out that their "mysqldump" is actually a script:
LD_LIBRARY_PATH=/opt/lampstack-5.5.3-0/mysql/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
case "$#" in
*--no-defaults*)
exec $0.bin "$#"
exit
esac
exec $0.bin --defaults-file=/opt/lampstack-5.5.3-0/mysql/my.cnf "$#"
which doesn't appear to allow --defaults-file to be passed in... and work (as per the accepted answer here).
Another possibility for --defaults-extra-file to be ignored can by a .my.cnf file in your home directory.
The ~/.my.cnf file overrules the values you are trying to set in --defaults-extra-file