Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

XmlProjectStateManager fails to save state if service not run as administrator #311

Description

@appel1

At least it looks like it is hardcoded to always write ProjectState.xml to the program files directory.

persistanceFileName = Path.Combine(this.executionEnvironment.GetDefaultProgramDataFolder(ApplicationType.Server), "ProjectsState.xml");

----------
System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\CruiseControl.NET\server\ProjectsState.xml' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at ThoughtWorks.CruiseControl.Core.Util.SystemIoFileSystem.OpenOutputStream(String fileName)
   at ThoughtWorks.CruiseControl.Core.State.XmlProjectStateManager.SaveProjectStates()
   at ThoughtWorks.CruiseControl.Core.IntegrationQueueManager.Stop(String project)
   at ThoughtWorks.CruiseControl.Core.CruiseServer.<Stop>b__1(ProjectRequest arg, Response resp)
   at ThoughtWorks.CruiseControl.Core.CruiseServer.RunProjectRequest(ProjectRequest request, Nullable`1 permission, Nullable`1 eventType, ProjectRequestAction action)
----------```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions