AZCopy Get list of failed transfer files - azcopy

When running azcopy it shows that "Transfer failed: 5" the output $Result does not tell which files failed.
$Result = & $azcopyLocation /Source:$TempDestination /Dest:$deploymentPath /destkey:$destinationKey /NC:30 /S /Y
Is there a way to find out which files failed to copy?

Add "/V:" and enter a directory and txt file name, like:
/V:C:\AzCopy\Logs\Log.txt
It creates a log file which says which fails were uploaded and which were not and any errors that might occur.

Related

TFS build write message to summary

I want add a message (link) in the build summary (can be a new section also, doesn't really matter):
Based on this: https://blogs.objectsharp.com/post/2017/04/25/Writing-to-the-Build-Report-in-TFS-2015.aspx,
I've added this line in my Powershell script:
Write-Host "##vso[task.addattachment type=Distributedtask.Core.Summary;name=DotCover Results;]"
However I get an error message:
Unable to process command '##vso[task.addattachment
type=Distributedtask.Core.Summary;name=DotCover Results;]'
successfully. Please reference documentation
(http://go.microsoft.com/fwlink/?LinkId=817296) Cannot upload task
attachment file, attachment file location is not specified or
attachment file not exist on disk
How would one add a text/link/href in the summary of the build? (powershell or other method?)
EDIT:
Please see edit below. I run this script from PowerShell during the build step:
$path = $sourcesFolder + "file:///C:/Temp/dotCover-xunit.html"
Write-Host "##vso[task.addattachment type=Distributedtask.Core.Summary;name=DotCover Results;]$path"
EDIT 2: (tried a simple text)
function AddSummaryMessage{
$filePath = "somestring"
Write-Host "##vso[task.uplaodsummary]$filePath"
}
also tried with "hellomessage" as string in there:
Error message:
2019-04-27T01:49:01.1513980Z ##[error]Unable to process command
'##vso[task.addattachment
type=Distributedtask.Core.Summary;name=DotCover Results;]hellomessage'
successfully. Please reference documentation
(http://go.microsoft.com/fwlink/?LinkId=817296)
2019-04-27T01:49:01.1516289Z ##[error]Cannot upload task attachment
file, attachment file location is not specified or attachment file not
exist on disk
EDIT 3:
function AddSummaryMessage{
$file = Get-ChildItem $outputFolder -name "dotcover.html";
if ($file){
LogMessage("Found dotcover report file: " + ($outputFolder + $file))
$path = ($outputFolder + $file)
Write-Host "##vso[task.uplaodsummary]$path"
}
}
OUTPUT:
9:27:01 AM add summary message
9:27:01 AM Found dotcover report file: C:\Builds\tfsbuilddev02\Agent1\110\s\dotCover\dotcover.html
The "hellomessage" can't work because you must give a file path and not just a string.
In the attempt with the PowerShell script you have a problem in the file path.
I don't know what the value of the sourcesFolder and I can't understand what is the + file ....
I tried to concatenate the file path in this way:
$filePath = $(Build.SourcesDirectory)\test.html
# Verify the path is correct:
Write-Host $filePath
# Output: D:\a\1\s\test.html
And I upload the file to the Summary page in this way:
Write-Host "##vso[task.uplaodsummary]$filePath"
The upload succeeded and the test.html exist in the build summary page.
So in your case you must to check the file path and fix it, after it the upload will work (you can try also put hard coded path and check if it works).
P.S - The task.uploadsuammry is a short hand to task.addattachment type=Distributedtask.Core.Summary.

the make.sh for fastdht not work.When running it shows "nm: /usr/lib/libc_r.so:no such file"

I want to install fastdht. So I download source code from github
https://github.com/happyfish100/fastdht
I follow the INSTALL file, run make.sh first.
./make.sh
However, it shows the following error messages.
[root#localhost fastdht]# sh make.sh
make.sh: line 142: warning: here-document at line 2 delimited by end-of-file
(wanted `EOF')
make.sh: line 2: ./a.out: No such file or directory
nm: '/usr/lib/libc_r.so': No such file
nm: '/lib64/libc_r.so': No such file
nm: '/usr/lib64/libc_r.so': No such file
[root#localhost fastdht]#
What's the matter?
Maybe there are some format errors in make.sh.
I create a new file a.sh and type the contents of make.sh in it. When I run a.sh it works!

Installing a Tcl application as a Windows Service error

I'm trying to install a Tcl program as a service on my Windows machine using the TclDevKit's TclServiceManager. I'm following the guide here step by step and yet I am experiencing a lot of issues.
If I try to use my raw .tcl file to create the service, I get the following error:
Error 1053: The service did not respond to the start or control request in a timely fashion.
I've followed a solution for this issue here to give the program more time to start up before the Service Control Manager terminates it; to no avail.
Then I decided to try and wrap the program using TclApp and see if that worked. Like the guide says, I used the base-tclsvc-win32-ix86.exe prefix file located in my TclDevKit bin directory. Installing the service that way, and then trying to run it resulted in the following error:
Windows could not start the <service name> service on Local Computer.
Error 1067: The process terminated unexpectedly.
There wasn't much information at all that I could find googling this error. The only Stackoverflow post on it is this one. So I tried installing the service manually through the command prompt using <TheProgram>.exe <Service Name> -install and tried running it - still gave me the same error.
Then I tried to see if I could get any useful information by running <TheProgram>.exe <Service Name> -debug and interestingly enough I got the following output:
Debugging <Service Name>.
InitTypes: failed to find the DictUpdateInfo AuxData type
abnormal program termination
Googling InitTypes: failed to find the DictUpdateInfo AuxData type leads me nowhere, however it seems to be something Tcl related.
Finally, if it means anything, the source code for the program I was trying to install as a service is some simple web server code:
proc Serve {chan addr port} {
fconfigure $chan -translation auto -buffering line
set line [gets $chan]
set path [file join . [string trimleft [lindex $line 1] /]]
if {$path == "."} {set path ./index.html}
if {[catch {
set f1 [open $path]
} err]} {
puts $chan "HTTP/1.0 404 Not Found"
} else {
puts $chan "HTTP/1.0 200 OK"
puts $chan "Content-Type: text/html"
puts $chan ""
puts $chan [read $f1]
close $f1
}
close $chan
}
if {![info exists reload]} {
set sk [socket -server Serve 3000]
puts "Server listening on port 3000"
vwait forever
} else {
unset reload
}
To check and see if the source code was the problem, I tried another, simpler example that simply created a file in a particular directory:
set filePath "C:/some/path/here";
set fileName "Test.txt";
set file [open [file join $filePath $fileName] w];
puts $file "Hello, World";
close $file;
Both programs work if you simply source them from tclsh86.exe, but give the above errors if you try and run them as services unwrapped and wrapped respectively.
Any ideas?

Error while generating trace file in Vampirtrace

I want to do profiling for my parallel processing code that I have wrote using OpenMPI library. I am trying to use vampirtrace for this purpose. I compiled my code using command
vtcxx -vt:cxx mpic++ ../src/parallel_encode_nonBlocking.cpp -o parallel_encode_nonBlocking_trace.exe
and I am trying to run my code using following command to generate trace file,
mpirun -np 4 parallel_encode_nonBlocking_trace.exe ducks.m2v ducks11.h264
here last 2 names are names of input and output files that are required by code. But after running code I am getting following errors,
/usr/bin/nm: '/home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad': No such file
/usr/bin/nm: 'MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe': No such file
VampirTrace: FATAL: Failed to execute /usr/bin/nm -B --demangle --line-numbers /home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe
Please set the environment variable VT_GNU_NM to the 'nm' command including command line switches which lists symbol/addresses of an object file in BSD-style or set VT_GNU_NMFILE to a pre-created symbol list file.
/usr/bin/nm: '/home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad': No such file
/usr/bin/nm: 'MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe': No such file
/usr/bin/nm: '/home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad': No such file
/usr/bin/nm: 'MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe': No such file
VampirTrace: FATAL: Failed to execute /usr/bin/nm -B --demangle --line-numbers /home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe
Please set the environment variable VT_GNU_NM to the 'nm' command including command line switches which lists symbol/addresses of an object file in BSD-style or set VT_GNU_NMFILE to a pre-created symbol list file.
/usr/bin/nm: VampirTrace: FATAL: Failed to execute /usr/bin/nm -B --demangle --line-numbers /home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe
Please set the environment variable VT_GNU_NM to the 'nm' command including command line switches which lists symbol/addresses of an object file in BSD-style or set VT_GNU_NMFILE to a pre-created symbol list file.
'/home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad': No such file
/usr/bin/nm: 'MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe': No such file
VampirTrace: FATAL: Failed to execute /usr/bin/nm -B --demangle --line-numbers /home/rishikesh/Videos/Documents/Rishikesh_MTP_data/Harshad MTP/MTP/encoder_experiments/ffmpeg_transcode/bin/parallel_encode_nonBlocking_trace.exe
Please set the environment variable VT_GNU_NM to the 'nm' command including command line switches which lists symbol/addresses of an object file in BSD-style or set VT_GNU_NMFILE to a pre-created symbol list file.
--------------------------------------------------------------------------
mpirun noticed that the job aborted, but has no info as to the process
that caused that situation.
--------------------------------------------------------------------------
There seems to be a bug in VampirTrace with spaces in the absolute path name to your application binary. To work around that you can either remove the space from the "Harshad MTP" directory, or manually execute
nm parallel_encode_nonBlocking_trace.exe > nm.file
export VT_GNU_NMFILE="$PWD/nm.file"
The error message is quite clear about that if you actually carefully read it.

Batch file to check website status from a text file and restart service based on string

I need some batch guru to assist me in getting this resolved. I have a couple of files via which we are monitoring the response from the websites using wget. When the site is down we get the following response code in test1.txt:
Connecting to 10.x.x.x:443... failed: Bad file descriptor.
whilst when the site is running the response code in test2.txt is
Connecting to 10.x.x.x:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
I do not see any common pattern in both the above outputs based on which I can form a logic. Need some assistance in determining if from the outputs above
if the website is running, do nothing
if the website is down, start service.
Note, we need to do this only on the basis of the output from these files.
Tried the provided solution but it didn't work:
TestScript>wget-1.14.exe --spider --no-check-certificate https://somesite | find "Bad file descriptor" 1>nul
Spider mode enabled. Check if remote file exists.
--2015-10-08 18:15:21-- https://somesite
Connecting to 10.x.x.x:443... failed: Bad file descriptor.
TestScript>if errorlevel 1 (echo site is up ) else (echo site is down )
site is up
Pipe the output of wget to find to look for Bad file descriptor and then use errorlevel:
wget --spider http://someurl 2>&1 | find "Bad file descriptor" >nul
if errorlevel 1 (
echo site is up
) else (
echo site is down
)
2>&1 redirects the messages into the standard output so that it can be piped
--spider makes wget only check the url without saving the result
Alternatively use the file you already have:
if exist test1.txt find "Bad file descriptor" test1.txt >nul
if not errorlevel 1 (echo start the service)

Resources