Cannot Install Postgresql 14 on my windows server 2019 - post install errors - postgresql

I have PgAmin 4.6 running with PostgreSQL 12 on my windows 2019 server. I want to install postgreSQL 14. I have tried installing it using the latest EDB .exe file a few times: Each attempt I wind up with a post installation error. I've tried logged in as an administrator. I've adjusted the postgresql folder security privileges to allow 'all application packages', 'all restricted application packages', users in the administrator group and my own user account with full control... and I have even tried adding postgres as a local administrator account and installing from an elevated cmd-prompt. Any way I have sliced it - I continue to get the post-installation error. The installer finishes, but no postgresql 14 service installed, and the only folder in the postgreSQL 14 directory is Data.
What am I missing? What gives? Can I use pgAdmin to create a new postgresql 14 server? How do I initialize a postgreSQL 14 database? Wywould it matter if I already have pdAdmin 4.6 and postgreSQL 12 installed?I'd appreciate a little help. Many thanks!
Log started 01/21/2022 at 18:20:18
Preferred installation mode : qt
Trying to init installer in mode qt
Mode qt successfully initialized
Setting variable whoami from C:\WINDOWS\System32\whoami
Script exit code: 0
Script output:
dn\USER
Script stderr:
Executing C:\WINDOWS\System32\icacls "C:\Users\USER\AppData\Local\Temp/postgresql_installer_631f935164" /inheritance:r
Script exit code: 0
Script output:
processed file: C:\Users\USER\AppData\Local\Temp/postgresql_installer_631f935164
Successfully processed 1 files; Failed processing 0 files
Script stderr:
Executing C:\WINDOWS\System32\icacls "C:\Users\USER\AppData\Local\Temp/postgresql_installer_631f935164" /T /Q /grant "dn\USER:(OI)(CI)F"
Script exit code: 0
Script output:
Successfully processed 1 files; Failed processing 0 files
Script stderr:
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Users\USER\AppData\Local\Temp\postgresql_installer_631f935164\prerun_checks.vbs"
Script exit code: 0
Script output:
The scripting host appears to be functional.
Script stderr:
[18:20:30] Using branding: PostgreSQL 14
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 SB_Version. Setting variable sb_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 pgAdmin_Version. Setting variable pgadmin_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Data Directory. Setting variable server_data_dir to empty value
Executing C:\Users\USER\AppData\Local\Temp/postgresql_installer_631f935164/temp_check_comspec.bat
Script exit code: 0
Script output:
Active code page: 1252
Active code page: 1252
"test ok"
Script stderr:
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Data Directory. Setting variable iDataDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Service ID. Setting variable iServiceName to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Service Account. Setting variable iServiceAccount to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Super User. Setting variable iSuperuser to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 DisableStackBuilder. Setting variable iDisableStackBuilder to empty value
[18:20:31] Existing base directory: C:\Program Files\PostgreSQL\14
[18:20:31] Existing data directory:
[18:20:31] Using branding: PostgreSQL 14
[18:20:31] Using Super User: postgres and Service Account: NT AUTHORITY\NetworkService
[18:20:31] Using Service Name: postgresql-x64-14
Executing C:\Users\USER\AppData\Local\Temp\postgresql_installer_631f935164\getlocales.exe
Script exit code: 0
Script output:
EnglishxxCOMMAxxxxSPxxAustralia=English, Australia
EnglishxxCOMMAxxxxSPxxBelize=English, Belize
EnglishxxCOMMAxxxxSPxxCanada=English, Canada
EnglishxxCOMMAxxxxSPxxCaribbean=English, Caribbean
EnglishxxCOMMAxxxxSPxxHongxxSPxxKongxxSPxxSAR=English, Hong Kong SAR
EnglishxxCOMMAxxxxSPxxIndia=English, India
EnglishxxCOMMAxxxxSPxxIndonesia=English, Indonesia
EnglishxxCOMMAxxxxSPxxIreland=English, Ireland
**_TRUNCATED_**
Script stderr:
[18:21:45] Data Directory exists and is empty. Removing it
Preparing to Install
Preparing to Install
Directory already exists: C:\Program Files\PostgreSQL\14\installer
Unpacking files
Unpacking C:\Program Files\PostgreSQL\14\installer\prerun_checks.vbs
Unpacking C:\Program Files\PostgreSQL\14\installer\vcredist_x86.exe
Directory already exists: C:\Program Files\PostgreSQL\14\installer
Unpacking files
Unpacking C:\Program Files\PostgreSQL\14\installer\vcredist_x64.exe
Directory already exists: C:\Program Files\PostgreSQL\14
Directory already exists: C:\Program Files\PostgreSQL\14\..._***TRUNCATED**
Unpacking files
Unpacking C:\Program Files\PostgreSQL\14\bin\pg_regress_ecpg.exe
Unpacking C:\Program Files\PostgreSQL\14\bin\..._***TRUNCATED UNPACK A BOATLOAD OF FILES FOR INSTALLATION***_
Directory already exists: C:\Program Files\PostgreSQL\14
Directory already exists: C:\Program Files\PostgreSQL\14\bin
Directory already exists: C:\Program Files\PostgreSQL\14\lib
Directory already exists: C:\Program Files\PostgreSQL\14\installer
Directory already exists: C:\Program Files\PostgreSQL\14\installer\server
Directory already exists: C:\Program Files\PostgreSQL\14\scripts
Directory already exists: C:\Program Files\PostgreSQL\14\scripts\images
Unpacking files
Unpacking C:\Program Files\PostgreSQL\14\lib\libecpg_compat.dll
...**TRUNCATED***
Unpacking C:\Program Files\PostgreSQL\14\installer\vcredist_x64.exe
Setting variable whoami from C:\WINDOWS\System32\whoami
Script exit code: 0
Script output:
dn\USER
Script stderr:
Executing C:\WINDOWS\System32\icacls "C:\Users\USER\AppData\Local\Temp/postgresql_installer_3f464cf94c" /inheritance:r
Script exit code: 0
Script output:
processed file: C:\Users\USER\AppData\Local\Temp/postgresql_installer_3f464cf94c
Successfully processed 1 files; Failed processing 0 files
Script stderr:
Executing C:\WINDOWS\System32\icacls "C:\Users\USER\AppData\Local\Temp/postgresql_installer_3f464cf94c" /T /Q /grant "dn\USER:(OI)(CI)F"
Script exit code: 0
Script output:
Successfully processed 1 files; Failed processing 0 files
Script stderr:
[18:24:34] Removing the existing ldconfig setting - set during the previous installation.
[18:24:34] Running the post-installation/upgrade actions:
[18:24:34] Write the base directory to the ini file...
[18:24:34] Write the version number to the ini file...
Initialising the database cluster (this may take a few minutes)...
Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\14/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\USER\AppData\Local\Temp/postgresql_installer_3f464cf94c" "C:\Program Files\PostgreSQL\14" "D:\pgData14" 5433 "DEFAULT" 0
Script exit code: 1
Script output:
WScript.Shell Initialized...
Scripting.FileSystemObject initialized...
Called CreateDirectory(D:\pgData14)...
Called CreateDirectory(D:\)...
Called ClearAcl (D:\pgData14)...
Executing batch file 'radEA2DE.bat'...
D:\pgData14 DN\USER:(I)(OI)(CI)(F)
BUILTIN\Administrators:(I)(F)
CREATOR OWNER:(I)(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
BUILTIN\Users:(I)(CI)(S,WD)
BUILTIN\Users:(I)(CI)(S,AD)
BUILTIN\Users:(I)(OI)(CI)(RX)
Successfully processed 1 files; Failed processing 0 files
Removing inherited ACLs on (D:\pgData14)
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
WScript.Network initialized...
strParentOfDataDirD:\
logged in userDN\USER
Called AclCheck(D:\pgData14)
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Executing icacls to ensure the DN\USER account can read the path D:\pgData14
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Ensuring we can write to the data directory (using icacls) to DN\USER:
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Granting full access to (NT AUTHORITY\NetworkService) on (D:\pgData14)
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Granting full access to CREATOR OWNER on (D:\pgData14)
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Granting full access to SYSTEM on (D:\pgData14)
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
Called IsVistaOrNewer()...
'winmgmts' object initialized...
Version:10.
MajorVersion:10
Granting full access to Administrators on (D:\pgData14)
Executing batch file 'radEA2DE.bat'...
processed file: D:\pgData14
Successfully processed 1 files; Failed processing 0 files
Executing batch file 'radEA2DE.bat'...
initdb: error: The program "postgres" was found by "C:/Program Files/PostgreSQL/14/bin/initdb.exe"
but was not the same version as initdb.
Check your installation.
Called Die(Failed to initialise the database cluster with initdb)...
Failed to initialise the database cluster with initdb
Script stderr:
Program ended with an error exit code
Error running C:\WINDOWS\System32\cscript //NoLogo "C:\Program Files\PostgreSQL\14/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\USER\AppData\Local\Temp/postgresql_installer_3f464cf94c" "C:\Program Files\PostgreSQL\14" "D:\pgData14" 5433 "DEFAULT" 0: Program ended with an error exit code
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.
Setting variable whoami from C:\WINDOWS\System32\whoami
Script exit code: 0
Script output:
dn\USER
Script stderr:
Executing C:\WINDOWS\System32\icacls "C:\Users\USER\AppData\Local\Temp/postgresql_installer_4701618998" /inheritance:r
Script exit code: 0
Script output:
processed file: C:\Users\USER\AppData\Local\Temp/postgresql_installer_4701618998
Successfully processed 1 files; Failed processing 0 files
Script stderr:
Executing C:\WINDOWS\System32\icacls "C:\Users\USER\AppData\Local\Temp/postgresql_installer_4701618998" /T /Q /grant "dn\USER:(OI)(CI)F"
Uninstalling C:\Program Files\PostgreSQL\14\...**__TRUNCATED UNINSTALLED THE BOATLOAD THAT WAS INSTALLED__**
Uninstalling C:/Program Files/PostgreSQL/14/bin...
Skipping C:/Program Files/PostgreSQL/14
Uninstallation completed
Exiting with code 1

There seems to be some conflict between running as an underprivileged user and administrator. You have to run as an underprivileged user to create the database cluster and then an administrator to register the service. To get around this, first run initdb in some other directory, rather than the postgres data directory eg:
\apps\server\postgres\bin\initdb.exe -A md5 -Upostgres -Eutf8 -W -D"data" --no-locale
then you copy the data directory created to the postgres data dir specified in the failed install, and then register the service manually like:
pg_ctl -N postgres -D your_postgres_data_dir
Then you will be able to start/manage the postgres service in windows services as normal.

Related

GitLab K8s Runner fails for get_sources

we are trying to move gitlab-runners from standard CentOS VMs to kebernetes.
But after setup and registration, pipeline fails with unknown error:
Running with gitlab-runner 15.7.0 (259d2fd4)
on Kubernetes-local JXRw3mH1
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image gitlab-test.domain:5005/image:latest ...
Using attach strategy to execute scripts...
Preparing environment
00:04
Waiting for pod gitlab-runner/runner-jxrw3mh1-project-290-concurrent-0dpd88 to be running, status is Pending
Running on runner-jxrw3mh1-project-290-concurrent-0dpd88 via gitlab-runner-d7df6c548-hsgxg...
Getting source from Git repository
00:00
error: could not lock config file /root/.gitconfig: Read-only file system
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
Inside the log of the job pod we found:
helper Running on runner-jxrw3mh1-project-290-concurrent-0dpd88 via gitlab-runner-d7df6c548-hsgxg...
helper
helper {"command_exit_code": 0, "script": "/scripts-290-207166/prepare_script"}
helper error: could not lock config file /root/.gitconfig: Read-only file system
helper
helper {"command_exit_code": 1, "script": "/scripts-290-207166/get_sources"}
helper
helper {"command_exit_code": 0, "script": "/scripts-290-207166/cleanup_file_variables"}
Inside the log of the gitlab-runner pod we found:
Starting in container "helper" the command ["gitlab-runner-build" "<<<" "/scripts-290-207167/get_sources" "2>&1 | tee -a /logs-290-207167/output.log"] with script: #!/usr/bin/env bash
if set -o | grep pipefail > /dev/null; then set -o pipefail; fi; set -o errexit
set +o noclobber
: | eval $'export FF_CMD_DISABLE_DELAYED_ERROR_LEVEL_EXPANSION=$\'false\'\nexport FF_NETWORK_PER_BUILD=$\'false\'\nexport FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY=$\'false\'\nexport FF_USE_DIRECT_DOWNLOAD
exit 0
job=207167 project=290 runner=JXRw3mH1
Remote process exited with the status: CommandExitCode: 1, Script: /scripts-290-207167/get_sources job=207167 project=290 runner=JXRw3mH1
Container "helper" exited with error: command terminated with exit code 1 job=207167 project=290 runner=JXRw3mH1
notes:
the error "error: could not lock config file /root/.gitconfig: Read-only file system" is due to the current user inside container is different by root
the file /logs-290-207167/output.log contains the log of the job pod
Inside job pod shell we also tested some git commands and perform successfully fetch and clone using our personal credentials (the same user that perform the run of the pipeline from gitlab gui).
We think the problem can be related on gitlab-ci-token, but we have finished our investigation... :frowning:

Unable to configure a new agent : Failed to create CoreCLR, HRESULT: 0x80004005

We had some 12 agents (vsts-agent-linux-x64-2.188.4) running on one Az VM (Ubuntu 20.04.2 LTS) as processes (./config.sh && screen ./run.sh). All was well..
I had to run some command related to /tmp folder but it kept showing busy and we suspected that our Agents might be using /tmp. Unfortunately instead of any other clean way of stopping the agents, we killed all processes on this VM manually, including the agents'.
After the /tmp related command ran successfully, I tried running screen ./run.sh from one of the agent directories. And I got an error:
Failed to create CoreCLR, HRESULT: 0x80004005
I also had tried :
.agent2/run.sh and I got the error :
ldd: ./bin/libcoreclr.so: No such file or directory
ldd: ./bin/System.Security.Cryptography.Native.OpenSsl.so: No such file or directory
ldd: ./bin/System.IO.Compression.Native.so: No such file or directory
ldd: ./bin/System.Net.Http.Native.so: No such file or directory
Failed to create CoreCLR, HRESULT: 0x80004005
I even downloaded a new .tar for the agent and ran a fresh ./config . But I get the same error on ./config as well
Is there a solution to this? Please help
export COMPlus_EnableDiagnostics = 0, and then running ./config from the agent directory. worked!
I had this issue when running as the non-privileged user specified in the systemd file but running as root user worked fine.
Finally used:
strace -f -o trace.log /<executable path>/<executable name>
Which led me to:
9183 mknod("/tmp/clr-debug-pipe-9183-8112345738-in", S_IFIFO|0700) = -1 EACCES (Permission denied)
This caused me to compare the /tmp directory between working and non-working boxes.
[<not-working-hostname>]$ ll /
drwxrwxr-x 7 root root 93 Jan 5 21:37 tmp
[<working-hostname>]$ ll /
drwxrwxrwt 7 root root 93 Jan 5 21:59 tmp
(Note the r-x vs rwt)
Fix:
[<hostname>]# chmod 1777 /tmp

ActiveMQ Artemis stopping automatically. localhost is not loading

I have installed ActiveMQ Artemis on my office laptop. I created a broker, and from the broker's bin folder I ran artemis-exe install.
Then after that I ran the start command. It shows it has started but, when I check status it shows stopped. I cannot access localhost:8161. Here is my log file:
2020-09-07 12:30:45,458 DEBUG - Starting WinSW in the CLI mode
2020-09-07 12:30:46,033 INFO - Starting the service with id 'artemis-btBroker-0.0.0.0'
2020-09-07 12:30:46,737 DEBUG - Starting WinSW in the service mode
2020-09-07 12:30:46,837 DEBUG - Completed. Exit code is 0
2020-09-07 12:30:46,881 INFO - Starting %JAVA_HOME%\bin\java.exe -Xbootclasspath/a:C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\lib\jboss-logmanager-2.1.10.Final.jar;C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\lib\wildfly-common-1.5.2.Final.jar -XX:+UseParallelGC -Xms512M -Xmx1024M -classpath C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\lib\artemis-boot.jar -Dartemis.home=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0 -Dartemis.instance=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker -Ddata.dir=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker\data -Dartemis.instance.etc=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker\etc -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/C:/Users/613379463/Downloads/apache-artemis-2.15.0-bin/apache-artemis-2.15.0/bin/btBroker/etc//logging.properties -Djava.security.auth.login.config=C:\Users\613379463\Downloads\apache-artemis-2.15.0-bin\apache-artemis-2.15.0\bin\btBroker\etc\login.config -Dhawtio.realm=activemq -Dhawtio.offline="true" -Dhawtio.role=amq -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=file:/C:/Users/613379463/Downloads/apache-artemis-2.15.0-bin/apache-artemis-2.15.0/bin/btBroker/etc//jolokia-access.xml org.apache.activemq.artemis.boot.Artemis run
2020-09-07 12:30:47,081 DEBUG - Completed. Exit code is 0
The Artemis ActiveMQ service is known to start and immediately stop (without any errors shown on command line) if %JAVA_HOME% is not set, as Apurv Adarsh's comment mentions.
The solution is to set the env var and then run the service as normal, as follows:
(1) Set JAVA_HOME
Verify %JAVA_HOME% system environment variable exists:
echo $Env:JAVA_HOME # from PowerShell
echo %JAVA_HOME% # from cmd
# e.g. 'C:\Program Files\Java\jdk-10.0.2\'
# or blank if not set.
if not, find java.exe (download/install, if necessary):
> where.exe java.exe # from PowerShell
> where java.exe # from cmd
# C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe
# C:\Program Files\Java\jdk-10.0.2\bin\java.exe
Set JAVA_HOME env var, I'll choose the jdk-10.0.2 version. /M will set as system variable, instead of user var. btw, no need to include '/bin/java.exe'
> setx /M JAVA_HOME "C:\Program Files\Java\"
SUCCESS: Specified value was saved.
(Restart the prompt to load the newly set env variable.)
(2) Install & Start Artemis Windows Service
cd into Artemis ActiveMQ root directory. Let my_broker be the name of the broker instance already created.
Ensure service is installed, then start:
> "my_broker/bin/artemis-service" install
...
> "my_broker/bin/artemis-service" start
2021-01-01 12:00:00,000 INFO - Starting the service with id 'artemis-my_broker-0.0.0.0'
(3) Check Running Status:
Verify service status is running:
> "my_broker/bin/artemis-service" status
Started

Windows Machine File Copy won't work without shared folder

I am using VSTS Release Management. The first step is to do a "Windows Machine File Copy". The settings are below. This fails when doing the robocopy with an error message of "Access Denied". The file path shown in the settings below gets translated to \\machine\e$\xxxx\TargetFolder. Why am I getting access denied? I don't get this message if I create a shared folder on the target folder and change the destination folder to: \\machine\TargetFolder. The Admin user is a local admin on the machine.
My question is why do I need to setup a shared folder in order to get this to work. Why can't it use the admin share (i.e. \\machine\e$\xxxx\TargetFolder)
Here is the log. The source and destination servers are both Win 2012R2 servers. UAC is turned off on the destination server. I have tried /B and /ZB as arguments and that didn't work.
2017-02-20T12:21:10.4545267Z Downloading artifact
2017-02-20T12:21:11.4375965Z Cleaning artifacts directory: C:\VSTS_agent\ReleaseManagementVSTS\r1\a
2017-02-20T12:21:11.6306012Z Cleaned artifacts directory: C:\VSTS_agent\ReleaseManagementVSTS\r1\a
2017-02-20T12:21:11.6396014Z Starting artifacts download...
2017-02-20T12:21:11.6426015Z Downloading linked artifact Release Build of type Build...
2017-02-20T12:21:11.6486018Z Ensuring artifact folder C:\VSTS_agent\ReleaseManagementVSTS\r1\a\Release Build exists and is clean.
2017-02-20T12:21:11.6856039Z Preparing to get the list of available artifacts from build
2017-02-20T12:21:12.0926382Z Preparing to download artifact: release
2017-02-20T12:21:12.1066374Z Artifact Type: ServerDrop
2017-02-20T12:21:12.5536635Z Caching items under 'release' in the file container...
2017-02-20T12:21:12.7186787Z Caching complete. (165 ms)
2017-02-20T12:21:17.8480056Z Download complete.
2017-02-20T12:21:17.8500047Z 51 placed file(s): 51 downloaded, 0 empty
2017-02-20T12:21:17.8500047Z 11 MB downloaded at 2188 KB/sec. Download time: 00:00:05.0976254. Parallel download limit: 4.
2017-02-20T12:21:17.8510054Z Downloaded linked artifact Release Build
2017-02-20T12:21:17.8510054Z Finished artifacts download
2017-02-20T12:21:17.8610039Z ##[section]Finishing: Download Artifacts
2017-02-20T12:21:17.8690051Z ##[section]Starting: Copy files from $(System.DefaultWorkingDirectory)/Release Build/release
2017-02-20T12:21:17.9680113Z ==============================================================================
2017-02-20T12:21:17.9680113Z Task : Windows Machine File Copy
2017-02-20T12:21:17.9680113Z Description : Copy files to remote machine(s)
2017-02-20T12:21:17.9690126Z Version : 1.0.39
2017-02-20T12:21:17.9690126Z Author : Microsoft Corporation
2017-02-20T12:21:17.9690126Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=627415)
2017-02-20T12:21:17.9690126Z ==============================================================================
2017-02-20T12:21:18.0380182Z Preparing task execution handler.
2017-02-20T12:21:19.8101219Z Executing the powershell script: C:\VSTS_agent\ReleaseManagementVSTS\_tasks\WindowsMachineFileCopy_xxxx\1.0.39\WindowsMachineFileCopy.ps1
2017-02-20T12:21:24.0233892Z Copy started for - 'machine'
2017-02-20T12:21:28.8116953Z
2017-02-20T12:21:28.8116953Z -------------------------------------------------------------------------------
2017-02-20T12:21:28.8116953Z ROBOCOPY :: Robust File Copy for Windows
2017-02-20T12:21:28.8116953Z -------------------------------------------------------------------------------
2017-02-20T12:21:28.8116953Z
2017-02-20T12:21:28.8146952Z Started : Monday, February 20, 2017 7:21:28 AM
2017-02-20T12:21:28.8156949Z 2017/02/20 07:21:28 ERROR 5 (0x00000005) Getting File System Type of Destination \\machine\E$\xxx\TargetFolder\
2017-02-20T12:21:28.8156949Z Access is denied.
2017-02-20T12:21:28.8156949Z
2017-02-20T12:21:28.8156949Z
2017-02-20T12:21:28.8156949Z Source : C:\VSTS_agent\ReleaseManagementVSTS\r1\a\Release Build\release\
2017-02-20T12:21:28.8167052Z Dest - \\machine\E$\xxx\TargetFolder\
2017-02-20T12:21:28.8167052Z
2017-02-20T12:21:28.8167052Z Files : *.*
2017-02-20T12:21:28.8167052Z
2017-02-20T12:21:28.8167052Z Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
2017-02-20T12:21:28.8167052Z
2017-02-20T12:21:28.8167052Z ------------------------------------------------------------------------------
2017-02-20T12:21:28.8186939Z
2017-02-20T12:21:28.8196951Z 2017/02/20 07:21:28 ERROR 5 (0x00000005) Creating Destination Directory \\machine\E$\xxx\TargetFolder\
2017-02-20T12:21:28.8196951Z Access is denied.
2017-02-20T12:21:28.8196951Z
2017-02-20T12:21:28.8977003Z \\machine was deleted successfully.
2017-02-20T12:21:28.8977003Z
2017-02-20T12:21:28.9177039Z ##[error]System.Management.Automation.RuntimeException: Copying failed for resource : machine
2017-02-20T12:21:28.9177039Z Copying failed. Consult the robocopy logs for more details. ---> System.Management.Automation.RuntimeException: Copying failed for resource : machine
2017-02-20T12:21:28.9177039Z Copying failed. Consult the robocopy logs for more details.
2017-02-20T12:21:28.9177039Z --- End of inner exception stack trace ---
2017-02-20T12:21:28.9177039Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2017-02-20T12:21:28.9187021Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
2017-02-20T12:21:28.9407042Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
2017-02-20T12:21:28.9427038Z ##[section]Finishing: Copy files from $(System.DefaultWorkingDirectory)/Release Build/release
2017-02-20T12:21:28.9507042Z ##[section]Finishing: Release
This issue was resolved by using an Active Directory account. This fixed the issue of not being able to Robocopy with the admin share. This worked on machines that the AD user had access, and for machines where the AD didn't have access but where a local admin windows account was setup with the same name as the AD account.

MDT 2012 image Failure - Unable to find Imagex.exe

I am running Windows Server 2012 R2 with MDT 2012, I installed the Windows 8 ADK before installing MDT 2012. I have created my Deployment Share and set everything up, but when I try to run the build it fails. I have included the error log bellow;
FindFile: The file imagex.exe could not be found in any standard locations. LTIApply 01/06/2015 09:54:30 0 (0x0000)
FAILURE ( 5441 ): 1: FindFile: imagex.exe LTIApply 01/06/2015 09:54:30 0 (0x0000)
Command completed, return code = -2147467259 LiteTouch 01/06/2015 09:54:30 0 (0x0000)
Litetouch deployment failed, Return Code = -2147467259 0x80004005 LiteTouch 01/06/2015 09:54:30 0 (0x0000)
For more information, consult the task sequencer log ...\SMSTS.LOG. LiteTouch 01/06/2015 09:54:30 0 (0x0000)
I see that it is unable to find the 'imagex.exe' file, where should this be located, and can I copy the file to the directory?
Any ideas?
Kind Regards,
Copy imagex.exe and wimgapi.dll (this may be optional, but I would still copy it) from the installation of ADK to the Tools\x86 and Tools\x64 directories in your deployment share.
For example (using 8.1 ADK instead of 8 ADK, folder names may be slightly different) the default installation on Server 2012 R2 would be "C:\Program Files (x86)\Windows Kit\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\DISM" for the 64-bit imagex.exe and wimgapi.dll files. And "C:\Program Files (x86)\Windows Kit\8.1\Assessment and Deployment Kit\Deployment Tools\x86\DISM" for the 32-bit imagex.exe and wimgapi.dll files.
These files would be copied to the appropriate folders in C:\DeploymentShare\Tools\x64 and C:\DeploymentShare\Tools\x86.
This should resolve your problem. For whatever reason, MDT sometimes does not place all the needed files into the Tools folder when you create a deployment share.