Fbcmd

We have FB Professional Edition running in a  VM (Win7-64 VirtualBox) and have configure the build scripts which work as desired. We have a Jenkins-CI Job that connects to the VM via SSH and triggers the Build. The first script performs a PULL from our DVCS (Mercurial (Hg)). The command used is:


  "C:\Dev\Tools\FinalBuilder 7\FBCMD.exe" /B /VBRANCH=%1 /VJENKINSBUILDNO=%2 /P"C:\Dev\Code\Project\BuildTools\FBScripts\HgPullUpdate.fbp7"


and we get the following error:

  ERROR! Package load error: C:\Dev\Tools\FinalBuilder 7\FBDelphiW32.bpl
  Error getting My Documents folder : Unknown error -2147024894 : The system cannot find the file specified
  
would you hgave any idea why this is occurring?

Thanks

TFord

If the windows user that you are using via ssh has never logged into that machine before then the users profile will not exist on that machine. If that is not the case, then if the SSH server has an option to load the user’s profile then you may need to use it.

Thanks for the quick response.

From reading the forums, I thought that that was the issue but as you can see from the included logs, we are logged in under the ‘dev’ account. ‘dev’ is the account that we used when we developed our build scripts, which again we have verified work as designed.

Also, FBCMD is running. You can see that, although “FBDelphiW32.bpl” throws an ERROR) “HgPullUpdate.fbp7” job completes successfully. I believe this is because “HgPullUpdate.fbp7” is not using any code in “FBDelphiW32.bpl”. It’s not until the next build script in the chain (which require “FBDelphiW32.bpl” ) is called that we run into the error.

[code]
C:\Program Files (x86)\Jenkins\jobs\CI Default Build\workspace>plink jenkins@ci-default -i JenkinsPrivateKey.ppk C:\SSHRoot\Build.bat default 32

C:\Windows\system32>Echo Off

PsLoggedon v1.34 - See who’s logged on
Copyright © 2000-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

Users logged on locally:
     10/9/2012 1:32:53 PM       CI-DEFAULT\dev
=============================================
  Starting Project [default] Build
=============================================

Pulling tip from default branch
ERROR! Package load error: C:\Dev\Tools\FinalBuilder 7\FBDelphiW32.bpl
Error getting My Documents folder : Unknown error -2147024894 : The system cannot find the file specified
Variable [BRANCH] set to [default]
Variable [JENKINSBUILDNO] set to [32]

Project File: C:\Dev\Code\Project\BuildTools\FBScripts\HgPullUpdate.fbp7

Build Started: 10/9/2012 2:19:24 PM

  [Start ActionList: Main]

    [Mercurial]

    [Mercurial Pull]
      pulling from http://sacsc01:8080/hg/rprox
searching for changes
adding changesets
adding manifests
adding file changes
added 5 changesets with 3 changes to 3 files
(run ‘hg update’ to get a working copy)
      Success

    [Mercurial Update]
      3 files updated, 0 files merged, 0 files removed, 0 files unresolved
      Success

    [Build Version Information]

    [Run DOS Command / Batch File [ hg id > C:\temp\changeset.txt ]]

        Starting Directory: C:\Dev\Code\Project
        Parameters: /c hg id > C:\temp\changeset.txt

    [Read Text File [ changeset.txt ]]
      Reading file…
      Escaping variables…
      Successfully read file c:\temp\changeset.txt

    [Save Variables to INI [BuildControl.ini, Variables: Branch,ChangeSet,JenkinsBuildNo]]
      Saving variables to INI file: C:\Dev\Code\Project\BuildTools\FBScripts\BuildControl.ini
      Variable “Branch” value saved
      Variable “ChangeSet” value saved
      Variable “JenkinsBuildNo” value saved
      Variables successfully saved

    [End ActionList: Main]

Build Completed OK
Elapsed time: 0hrs 0min 2sec 531msec

Compiling Code
ERROR! Package load error: C:\Dev\Tools\FinalBuilder 7\FBDelphiW32.bpl
Error getting My Documents folder : Unknown error -2147024894 : The system cannot find the file specified
ERROR! Required package for this project not loaded
Missing package for Action class : TDelphiCompilerAction
ERROR! Required package for this project not loaded
Missing package for Action class : TDelphiCompilerAction
ERROR! Required package for this project not loaded
Missing package for Action class : TDelphiCompilerAction
ERROR! Required package for this project not loaded
Missing package for Action class : TDelphiCompilerAction

Exit with return code: 13 (REQUIREDPACKAGENOTLOADED)

=============================================
  Project [default] Build Failed!!
=============================================
 [/code]

I had a look through the code, the delphi package is the only one that is looking for the user’s documents folder, and it’s doing that to deal with the BDSUSERDIR and BDSPROJECTSDIR variables.

I think the real issue is why is the SHGetFolderPath windows api failing to find CSIDL_PERSONAL - this suggests that windows hasn’t loaded the user profile when fbcmd is invoked via ssh. Which SSH server are you using?

We are using FreeSSH.

Thanks

Are you able to try another ssh server, something like http://www.bitvise.com/ssh-server - FreeSSHd is pretty basic, not to mention abandoned (no updated since 2009). It’s not free, but it has a 30 day trial so you should be able to test it easily enough.

Well I think we fixed the issue. 

We are still using FreeSSH (for now). FreeSSH is running as a service on the "CI-DEFAULT" machine. We changed the FreeSSH 
service to "Log On" as the "dev" user account, giving it the "dev" credentials. The "dev" user account where we developed the build scripts and which runs FBCMB correctly. Now all is working as expected.

Thank you very much for all the help and responsiveness.