06-07-2016 08:37 AM
Hi,
I am running the below command -
bpduplicate -Bidfile c:\test\sun.txt -number_copies 1 -dp NetBackup -dstunit LTape -rl 3 -pt NDMP -client filer1 -cn 1
Getting the below error -
db_IMAGEreceive() failed: required value not set (152)
Runnig the same command on other master server and it is successfully running.
Please suggest.
06-07-2016 05:41 PM
06-13-2016 04:06 AM
Hi Marianne,
Yes. It is having the valid images. I confirmed it from bpimmedia command and also using nbu admin console catalog option.
Here is the thing I found, amazing !!!
How this BID file is being created -
A script runs using windows powershell on this master server which creates the BID files to be used by bpduplicate command.
What is amazing -
When this BID file ( basically the text file) is searched by the bpduplicate command at the mentioned location, it is not able to read the text file and showing error code 152.
But if the text file (BID file) is being created by windows command prompt and not by powershell then bpduplicate command is able to read and work upon it successfully.
This is how it worked for me. Also I found this difference not only for backup but also if we are using for /f command ( if text file mentioned in for /f is created by powershell it is not able to work properly but if the same text file is created by cmd it works perfectly.)
06-13-2016 05:27 AM
Please upload example of file created by windows command prompt as well file created by powershell.
There is clearly something wrong with the format created by powershell.
06-13-2016 08:51 AM
I have uploaded both files.
Try aslo
Run cmd as admin.
Run the command - for /f %i in (c:\cmd.txt or the path of the file) do @echo %i
try for powershell.txt also
Result -
For powershell.txt no result will be produced.
For cmd.txt u will get output same as in the text file.
Same thing happened for running bpduplicate using the bid file created from powershell and cmd. For powershell it was not able to read the file and giving error 152. For text file resulted from cmd bpduplicate worked fine.
:) Amazing for me.
06-27-2016 04:04 AM
Hi,
Can anybody tell me how to check the format i.e. how to get the difference in the above files format?
Thanks.
06-27-2016 06:53 AM
The files that you uploaded look identical.
We can only assume that original files were copied in order to upload them?
Please download and install TextPad.
In Textpad, go to View -> Visible spaces.
Do this for both files and compare.
06-27-2016 08:27 AM
The bytes sizes are different
So can you check additional settings set on file in security or other permissions
06-28-2016 02:23 AM
Hi nbutech,
These files are automatically created by cmd and powershell. So if there is any permission or such things coming in picture then how can I search for that, microsoft? no other ways than that?
I checked for file security and permissions, all same.
I am trying for Marianne's method.
12-27-2016 05:04 AM
Hi all !
have the sam problem today. Create bidfile using powershell and running script for bpduplicate as .cmd.
Dont work. Seems I have different kind of txt-files. cmd gives ASCII and powershell somethink depend on my environment ? No differences are seen in notepad between cmd and powershell created bidfile.
Testet solutions:
1. create file using cmd-shell
2. open powershell created txt file mark all copy; new txt-file open in notepad - paste.
ciao
Martin
12-27-2016 10:55 PM
Have you tried to compare the files in TextPad?
12-29-2016 02:15 AM
Hello Marianne !
I have created new files using command bpimagelist -hoursago 144 -client client1 -st full -idonly >C:\cmd-out.txt and >C:\powershell.txt. Output file regarding used shell. Both files are attached
Opening with MS word I see a hided characters. (Screenshot attached.) Seems it is a known behaviour.
https://msdn.microsoft.com/en-us/powershell/reference/5.0/microsoft.powershell.utility/out-file
Textpad I dont have.
ciao
Martin
12-29-2016 02:26 AM
using a nix OS (here Solarix) the sam result.
<508>root@repo4sol:~/nbu_scripts >unzip NBU_scripts.zip
Archive: NBU_scripts.zip
inflating: cmd_out.txt
inflating: cut_n_paste.txt
inflating: open_in_word1.JPG
inflating: open_in_word2.JPG
inflating: powershell.txt
<509>root@repo4sol:~/nbu_scripts >cat cmd_out.txt
Time: 25.12.2016 11:25:54 ID: client1_1482661554 FULL (0)
Time: 24.12.2016 02:22:31 ID: client1_1482542551 FULL (0)
Time: 24.12.2016 00:27:55 ID: client1_1482535675 FULL (0)
Time: 24.12.2016 00:11:12 ID: client1_1482534672 FULL (0)
Time: 23.12.2016 23:23:34 ID: client1_1482531814 FULL (0)
Time: 23.12.2016 23:11:50 ID: client1_1482531110 FULL (0)
Time: 23.12.2016 20:00:37 ID: client1_1482519637 FULL (0)
Time: 23.12.2016 20:00:33 ID: client1_1482519633 FULL (0)
<510>root@repo4sol:~/nbu_scripts >cat powershell.txt
▒▒Time: 25.12.2016 11:25:54 ID: client1_1482661554 FULL (0)
Time: 24.12.2016 02:22:31 ID: client1_1482542551 FULL (0)
Time: 24.12.2016 00:27:55 ID: client1_1482535675 FULL (0)
Time: 24.12.2016 00:11:12 ID: client1_1482534672 FULL (0)
Time: 23.12.2016 23:23:34 ID: client1_1482531814 FULL (0)
Time: 23.12.2016 23:11:50 ID: client1_1482531110 FULL (0)
Time: 23.12.2016 20:00:37 ID: client1_1482519637 FULL (0)
Time: 23.12.2016 20:00:33 ID: client1_1482519633 FULL (0)
<511>root@repo4sol:~/nbu_scripts >ls -al
total 432
drwxr-xr-x 2 root root 8 Dec 29 11:22 .
drwx------ 6 root root 13 Dec 29 11:21 ..
-rw-r--r-- 1 root root 544 Dec 28 18:30 cmd_out.txt
-rw-r--r-- 1 root root 542 Dec 28 18:31 cut_n_paste.txt
-rw-r--r-- 1 root root 89366 Dec 29 11:22 NBU_scripts.zip
-rw-r--r-- 1 root root 61941 Dec 29 10:56 open_in_word1.JPG
-rw-r--r-- 1 root root 59407 Dec 29 11:00 open_in_word2.JPG
-rw-r--r-- 1 root root 1090 Dec 28 18:29 powershell.txt
<512>root@repo4sol:~/nbu_scripts >cp -p powershell.txt edit_powershell.txt
<513>root@repo4sol:~/nbu_scripts >vi edit_powershell.txt
<514>root@repo4sol:~/nbu_scripts >ls -al
total 436
drwxr-xr-x 2 root root 9 Dec 29 11:23 .
drwx------ 6 root root 13 Dec 29 11:21 ..
-rw-r--r-- 1 root root 544 Dec 28 18:30 cmd_out.txt
-rw-r--r-- 1 root root 542 Dec 28 18:31 cut_n_paste.txt
-rw-r--r-- 1 root root 1074 Dec 29 11:23 edit_powershell.txt
-rw-r--r-- 1 root root 89366 Dec 29 11:22 NBU_scripts.zip
-rw-r--r-- 1 root root 61941 Dec 29 10:56 open_in_word1.JPG
-rw-r--r-- 1 root root 59407 Dec 29 11:00 open_in_word2.JPG
-rw-r--r-- 1 root root 1090 Dec 28 18:29 powershell.txt
<515>root@repo4sol:~/nbu_scripts >cat edit_powershell.txt
▒▒Time: 25.12.2016 11:25:54 ID: client1_1482661554 FULL (0)
Time: 24.12.2016 02:22:31 ID: client1_1482542551 FULL (0)
Time: 24.12.2016 00:27:55 ID: client1_1482535675 FULL (0)
Time: 24.12.2016 00:11:12 ID: client1_1482534672 FULL (0)
Time: 23.12.2016 23:23:34 ID: client1_1482531814 FULL (0)
Time: 23.12.2016 23:11:50 ID: client1_1482531110 FULL (0)
Time: 23.12.2016 20:00:37 ID: client1_1482519637 FULL (0)
Time: 23.12.2016 20:00:33 ID: client1_1482519633 FULL (0)
<516>root@repo4sol:~/nbu_scripts >uname -a
SunOS repo4sol 5.11 11.3 i86pc i386 i86pc
<517>root@repo4sol:~/nbu_scripts >
05-04-2018 12:18 AM - edited 05-04-2018 12:22 AM
BPDuplicate.exe expects ASCII. PowerShell output is unicode by default. So all you need do is:
PS> "<some BackupID>" | Out-File -Path bidfile.txt -Encoding ascii