When I want to create a resource of any kind using the asadmin CLI, I run into troubles when I have whitespaces in strings. e.g.:
asadmin create-jms-resource --restype javax.jms.ConnectionFactory --description "a description" jms/testFactory
I get an error message saying create-jms-resource only accepts one operand. The same thing also happens when I try to pass properties to the CLI. I already tried all kind of escape-characters, but nothing worked.
What is the correct way to escape whitespaced so that asadmin console will understand it. (I'm working in linux)
Related
I have a script that uses SCP to pull a file from a remote Linux host on AWS. After running the same code nightly for about 6 months without issue, it started failing today with protocol error: filename does not match request. I reproduced the issue on some simpler filenames below:
$ scp -i $IDENT $HOST_AND_DIR/"foobar" .
# the file is copied successfully
$ scp -i $IDENT $HOST_AND_DIR/"'foobar'" .
protocol error: filename does not match request
# used to work, i swear...
$ scp -i $IDENT $HOST_AND_DIR/"'foobarbaz'" .
scp: /home/user_redacted/foobarbaz: No such file or directory
# less surprising...
The reason for my single quotes was that I was grabbing a file with spaces in the name originally. To deal with the spaces, I had done $HOST_AND_DIR/"'foo bar'" for many months, but starting today, it would only accept $HOST_AND_DIR/"foo\ bar". So, my issue is fixed, but I'm still curious about what's going on.
I Googled the error message, but I don't see any real mentions of it, which surprises me.
Both hosts involved have OpenSSL 1.0.2g in the output of ssh -v localhost, and bash --version says GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Any ideas?
I ended up having a look through the source code and found the commit where this error is thrown:
GitHub Commit
remote->local directory copies satisfy the wildcard specified by the
user.
This checking provides some protection against a malicious server
sending unexpected filenames, but it comes at a risk of rejecting
wanted files due to differences between client and server wildcard
expansion rules.
For this reason, this also adds a new -T flag to disable the check.
They have added a new flag -T that will ignore this new check they've added so it is backwards compatible. However, I suppose we should look and find out why the filenames we're using are flagged as restricted.
In my case, I had [] characters in the filename that needed to be escaped using one of the options listed here. for example:
scp USERNAME#IP_ADDR:"/tmp/foo\[bar\].txt" /tmp
I am facing some strange issue to execute script when started the asterisk using "service asterisk start".
I can run script within dialplan using system() app when I started the asterisk using asterisk -vvvvvvvvc but when I start the asterisk using service (service asterisk start), asterisk can not execute the script, getting error like "Can not execute the command".
I have installed the asterisk as asterisk user. setup is done with freepbx installation.
I tried with various option, like changing the script with chown (chown asterisk:asterisk script), chmod 777 script but does not work.
Which OS version are you using?
If it is RHEL / CentOS 7, then you should use "systemctl start asterisk" instead.
If it is RHEL / CentOS 6, then you run the command correctly. Note that this startup script launches an intermediate script safe_asterisk, and the latter, in turn, launches the asterisk itself.
Check /var/log/messages and /var/log/asterisk/full - does anything interesting appear there at the moment of unsuccessful startup?
Could you also share the list of processes (ps -ef | grep asterisk) after you execute this startup script?
I am running version 0.8.4 as a container in my lab. CLI is also at version 0.8.4
I am trying to use a secret in a command one of my containers is trying to run.
Following the documentation has me needing to sign a repo to allow the job to consume the secret. The drone CLI does not seem to have a
drone sign command for me to run. So I create the secret with a --skip-verify=true flag. This creates the secret but when I run the job it errors out. The output in the UI shows a blank space where the secret should be injected.
Here is an excerpt of my .drone.yml where I am trying to inject secrets -s production -u ${cf_user} -p ${cf_password} --s
I have tried all the following ways to create a secret:
drone secret add <repo_name> --name <key> --value <value> --skip-verify=true
drone secret add <repo_name> --name <key> --value <value>
GUI Creation
I notice when I create an all capital name value the UI represents the value in all lowercase when the CLI shows it in capitals.
I also notice that if I include hyphens in the name and try to use that in my drone.yml the job errors out immediately with a bad substitution error.
Any help understanding what I am doing wrong would be much appreciated!
I got lost in the different documentation available. Should have been looking here rather than secret-guide.
In case I am not alone, I needed to add a secrects block in my pipeline.
I also needed to access them with $SECRET_KEY rather than ${SECRET_KEY}
pipeline:
publish:
image: governmentpaas/cf-cli
secrets: [ cf_user, cf_password ]
Just a little update on this one, I stumbled over it as well because the docs are inconsistent.
In the 0.8.5 version the only thing I had to do is:
add secrets via CLI or UI
add secrets array to utilise it
no need to pass variables to environment.
I have an "org.eclipse.team.internal.ccvs.ssh2..." error leading to a Connection Timeout downloading a CVS repository using extssh.
I have tried installing different versions of Eclipse, still the same Connection Timeout issue exists.
I can download other svn/git projects. Only this CVS repository has issues. I have checked my Java version and tried to pull the code using command line.
Screenshot showing the error:
When I tried to pull code from command prompt:
This looks like a firewall problem. Go to Preferences -> General -> Network connections to set your proxies, etc.
Also, the reason this won't work on the command line is that the extssh protocol is not defined for the command line. You should be able to use ssh or pserver (for anonymous access).
"Error executing command: URL [mvn:org.apache.activemq/activemq-web-console/5.4.0/war] could not be resolved."
is thrown up when i do features:install activemq-web-console
i am using fuse 4.3
removed the old Url for activemq from features:removeUrl and added the new one
mvn:org.apache.activemq/activemq-karaf/5.4.0/xml/features
and re-installed activemq features . if u are unable to install mvn url's then,u must add the fuse repo's to your maven settings xml.
apart from this there is a well known bug
Add the following lines to etc/system.properties
webconsole.type=properties
webconsole.jms.url=tcp://localhost:61616
webconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
webconsole.jmx.user=smx
webconsole.jmx.password=smx
this would make ur console work
For newbie follow these steps:
1. list all features using following command:
karaf#root> features:listurl
2. you can remove url using following command:
features:removeurl
you can find the url to remove in the above removeurl command from the step 1 where you list urls.
add url that you want to using following command:
features:addurl <>
and then follow steps that are mentioned by sanre6 above.