Jenkins重写了config.xml

时间:2017-10-13 06:39:14

标签: windows jenkins config

我已经使用.msi安装了jenkins,但在尝试加载时遇到了java.nio.file.AccessDeniedException。

我已按照建议将useSecurity更改为false,并从config.xml中删除authorizationStrategy和securityRealm。

当我在命令行上重新启动Jenkins时,它会将config.xml重写为其原始状态,并且错误仍然存​​在。

任何想法如何解决这个问题?

java.nio.file.AccessDeniedException: C:\Program Files (x86)\Jenkins\secrets\hudson.util.Secret
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source)
at java.nio.file.spi.FileSystemProvider.newOutputStream(Unknown Source)
at java.nio.file.Files.newOutputStream(Unknown Source)
at jenkins.security.DefaultConfidentialStore.store(DefaultConfidentialStore.java:79)
at jenkins.security.ConfidentialKey.store(ConfidentialKey.java:51)
at jenkins.security.CryptoConfidentialKey.getKey(CryptoConfidentialKey.java:44)
Caused: java.lang.Error: Failed to load the key: hudson.util.Secret
at jenkins.security.CryptoConfidentialKey.getKey(CryptoConfidentialKey.java:53)
at jenkins.security.CryptoConfidentialKey.decrypt(CryptoConfidentialKey.java:134)
at hudson.util.HistoricalSecrets.decrypt(HistoricalSecrets.java:49)
at hudson.util.Secret.decrypt(Secret.java:207)
at hudson.util.Secret.fromString(Secret.java:239)
at jenkins.security.ApiTokenProperty.<init>(ApiTokenProperty.java:86)
at jenkins.security.ApiTokenProperty$DescriptorImpl.newInstance(ApiTokenProperty.java:179)
at jenkins.security.ApiTokenProperty$DescriptorImpl.newInstance(ApiTokenProperty.java:164)
at hudson.model.User.load(User.java:205)
at hudson.model.User.<init>(User.java:157)
at hudson.model.User.getOrCreate(User.java:470)
at hudson.model.User.getById(User.java:541)
at hudson.security.HudsonPrivateSecurityRealm.createAccount(HudsonPrivateSecurityRealm.java:403)
at jenkins.install.SetupWizard.init(SetupWizard.java:109)
at jenkins.install.InstallState$3.initializeState(InstallState.java:105)
at jenkins.model.Jenkins.setInstallState(Jenkins.java:1062)
at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:96)
at jenkins.model.Jenkins.<init>(Jenkins.java:952)
at hudson.model.Hudson.<init>(Hudson.java:86)
at hudson.model.Hudson.<init>(Hudson.java:82)
at hudson.WebAppMain$3.run(WebAppMain.java:235)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:249)

1 个答案:

答案 0 :(得分:0)

事实证明,这是我正在为之工作的公司的IT政策阻止我创建.secret文件。

我必须要求安全性异常才能安装和运行Jenkins。所以你是对的Tuan,这是一个许可问题。

谢谢。