Getting "Bad substitution" error in AWS Code build - sh

I am writing a buildspec file where I am keeping the groupid and replacing the . with /.
- GROUP_ID=com.sample.poc
- GROUP_ID_SLASH="${GROUP_ID//.//}"
but I am getting bad substitution in line number 2. What can I try next?

Related

Azure dev ops pipeline failed: contains the character '*'. Remove the '*' and try again

I am publishing artifact and some supporting files for release phase.
Error I am getting:
Fail to upload '/home/vsts/work/1/a/app.yaml' due to 'TF10123: The
path '**/app.yaml' contains the character '*'. Remove the '*' and try
again.'.
There is no * in app.yaml file, please tell me what to do to fix this.
Let me know if any more information is required.
Check your file if it contains any whitespace characters (invisible ones, so use a HEX format display....), remove those characters and commit it again.

Disable critic for an entire file - Parse::RecDescent precompiled parser & PerlCritic/Tidyall

I'm trying to remove an error from my sanity-checking [when I push code to my git repo, there's a hook that checks the code with perltidy & critic... using tidyall as the handler.]
The specific issue I have is with a pre-compiled Grammar Parser.... and this is not something I want to dive in & fix (sorry - that's outside my comfort zone)
If I add a simple ## no critic to the start of the file, then
perlcritic path/to/class/file.pm
comes back
path/to/class/file.pm source OK
however
tidyall --check-only -r .
comes back with
perlcritic /tmp/Code-TidyAll-Frb0/path/to/class/file.pm failed
exited with 2 - output was:
Unrestricted '## no critic' annotation at line 6, column 1. (Miscellanea::ProhibitUnrestrictedNoCritic, severity 3)
I know I can fix this in the tidyall.ini file:
[PerlCritic lib]
select = **/*.{pm}
ignore = **/class/file.pm
.... however I feel there should be a cleaner solution.
(or, why doesn't tidyall critique the same as critic?)
why doesn't tidyall critique the same as critic?
A simple perlcritic on the command line defaults to severity 5, unless you've configured something different in your ~/.perlcriticrc. The rule ProhibitUnrestrictedNoCritic defaults to severity 3, so your tidyall is running Perl::Critic with at least severity 3. As per its documentation, you can change that via something like this in the tidyall.ini:
[PerlCritic]
argv = -severity 4
And then tidyall's checks should be the same as a perlcritic -4 from the command line. (Unless you've configured custom severity levels in your .perlcriticrc.)
Update: As per your comment, you want to check everything at the "brutal" level. In that case, you can create a perlcriticrc file containing the line [-Miscellanea::ProhibitUnrestrictedNoCritic] which will disable that policy, and then point perlcritic at that file by adding the command-line argument --profile /path/to/custom/perlcriticrc.

How to resolve a "Metadata error: chr must be valid" error on Linux?

I am relatively new to the world of coding, so I am having trouble resolving an issue when running TranslocWrapper.pl tutorial_metadata.txt preprocess/ results/ --threads 2. I am trying to run the HTGTS Pipeline according to this GitHub project. This is the full error:
. Library Genome Chr Start End Strand
1 RAG1A_SRep2 hg19 chr11 36594878 36595030 -
Metadata error: chr must be valid at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 285.
main::check_validity_of_metadata('HASH(0x2903ac8)') called at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 248
main::read_in_meta_file() called at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 90
I have already double-checked the successful installation of the Software Dependencies, so everything should be all good, but I am having trouble interpreting the "Metadata error: chr must be valid at ..." line. If it helps, these are the specific lines that are being called in the error:
TranslocWrapper.pl line 285:
croak "Metadata error: chr must be valid" unless grep { $_ eq $expt->{chr} } #chrlist;
TranslocWrapper.pl line 248:
check_validity_of_metadata($expt);
TranslocWrapper.pl line 90:
read_in_meta_file;
Thanks in advance for the help!
So the error is saying that one of the sequence characters in the metadata file is not present in the sequence's assembly file.
Given that this is the provided example you should assume that the data is correct and your invocation is faulty.
Have you done the TranslocPreprocess.pl preprocessing steps?
If you have try looking at the first line of the metadata file, identify the assembly entry. Ensure that the assembly file exists and that it contains the required sequence.
One common problem with this kind of code is the case of the filenames. The examples are designed to be run in Linux where filename case matters. Windows likes to pretend that case doesn't matter, this can cause problems. If you are running this code from Microsoft Windows or extracted any of the archives from within Windows this is a likely cause of the error.

"The filename, directory name or volume level syntax is incorrect while running kafka for the first time

I am trying to install kafka in my system; but I am getting the below exception.
Exception : "The filename, directory name or volume level syntax is incorrect ".
I am doing the following steps:
1. Downloaded kafka_2.11-0.9.0.0 and extracted in a folder.
2. I have modified the server.properties for log.dirs
log.dirs= D:\Kafka\kafka_2.11-0.9.0.0\kafka-logs
3. then from CMD i am triggering the below.
.\bin\windows\kafka-server-start.bat .\config\server.properties.
Any help would be appreciated.

capistrano upload! thinks ~ referenced local directory is on remote server

So every example I've looked up indicates this is how one is supposed to do it but I think I may have found a bug unless there's another way to do this.
I'm using upload! to upload assets to a remote list of servers. The task looks like this:
desc "Upload grunt compiled css/js."
task :upload_assets do
on roles(:all) do
%w{/htdocs/css /htdocs/js}.each do |asset|
upload! "#{fetch(:local_path) + asset}", "#{release_path.to_s + '/' + asset}", recursive: true
end
end
end
If local_path is defined as an absolute path such as:
set :local_path:, '/home/dcmbrown/projects/ABC'
This works fine. However if I do the following:
set :local_path:, '~/projects/ABC'
I end up getting the error:
The deploy has failed with an error: Exception while executing on ec2-54-23-88-125.us-west-2.compute.amazon.com: No such file or directory - ~/projects/ABC/htdocs/css
It's not a ' vs " issue as I've tried both (and I didn't think capistrano paid attention to that anyway).
Is this a bug? Is there a work around? Am I just doing it wrong?
I ended up discovering the best way to do this is to actually use path expansion! (headsmack)
irb> File.expand_path('~dcmbrown/projects/ABC')
=> "/home/dcmbrown/projects/ABC"
Of course what I'd like is to do automatic path expansion but you can't have everything. I think I was mostly dumbstruck that it didn't automatically; so much so I spent a couple of hours trying to figure out why it didn't work and ended up wasting time asking here. :(
I don't think the error is coming from the remote server, it just looks like it since it's running that upload command in the context of a deploy.
I just created a single cap task to just do an upload using the "~" character and it also fails with
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy#XXX: No such file or directory # rb_file_s_stat - ~/Projects/testapp/public/404.html
It appears to be a Ruby issue not Capistrano as this also fails in a Ruby console
~/Projects/testapp $ irb
2.2.2 :003 > File.stat('~/Projects/testapp/public/404.html')
Errno::ENOENT: No such file or directory # rb_file_s_stat - ~/Projects/testapp/public/404.html
from (irb):3:in `stat'
from (irb):3
from /Users/supairish/.rvm/rubies/ruby-2.2.2/bin/irb:11:in `<main>'