在Windows 10 os中的jenkins文件夹中不创建InitialAdminPassword文件

时间:2018-02-04 18:09:33

标签: jenkins

Jenkins安装似乎很顺利但是当我启动localhost:8080时,Jenkins正在要求输入密码。但是,我无法在系统中找到initialAdminPassword文件。我多次检查过;似乎这个文件不存在。因此,问题是什么,如何获得最初的Jenkins登录密码?

    Feb 06, 2018 6:56:46 PM Main deleteWinstoneTempContents
    WARNING: Failed to delete the temporary Winstone file C:\WINDOWS\TEMP\winstone\jenkins.war
    Feb 06, 2018 6:56:47 PM org.eclipse.jetty.util.log.Log initialized
    INFO: Logging initialized @3166ms to org.eclipse.jetty.util.log.JavaUtilLog
    Feb 06, 2018 6:56:48 PM winstone.Logger logInternal
    INFO: Beginning extraction from war file
    Feb 06, 2018 6:57:09 PM org.eclipse.jetty.server.handler.ContextHandler setContextPath
    WARNING: Empty contextPath
    Feb 06, 2018 6:57:09 PM org.eclipse.jetty.server.Server doStart
    INFO: jetty-9.4.z-SNAPSHOT
    Feb 06, 2018 6:57:09 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
    INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
    Feb 06, 2018 6:57:09 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
    INFO: DefaultSessionIdManager workerName=node0
Feb 06, 2018 6:57:09 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
    INFO: No SessionScavenger set, using defaults
    Feb 06, 2018 6:57:09 PM org.eclipse.jetty.server.session.HouseKeeper startScavenging
    INFO: Scavenging every 600000ms
    Feb 06, 2018 6:57:10 PM org.eclipse.jetty.server.handler.ContextHandler doStart
    INFO: Started w.@f27d66{/,file:///C:/Program%20Files%20(x86)/Jenkins/war/,AVAILABLE}{C:\Program Files (x86)\Jenkins\war}
    Feb 06, 2018 6:57:10 PM org.eclipse.jetty.server.AbstractConnector doStop
    INFO: Stopped ServerConnector@1cd604c{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
    Feb 06, 2018 6:57:10 PM org.eclipse.jetty.server.session.HouseKeeper stopScavenging
    INFO: Stopped scavenging
    Feb 06, 2018 6:57:10 PM hudson.WebAppMain contextDestroyed
    INFO: Shutting down a Jenkins instance that was still starting up
    java.lang.Throwable: reason
    at hudson.WebAppMain.contextDestroyed(WebAppMain.java:388)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextDestroyed(ContextHandler.java:898)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:545)
    at org.eclipse.jetty.server.handler.ContextHandler.stopContext(ContextHandler.java:873)
    at org.eclipse.jetty.servlet.ServletContextHandler.stopContext(ServletContextHandler.java:355)
    at org.eclipse.jetty.webapp.WebAppContext.stopWebapp(WebAppContext.java:1507)
    at org.eclipse.jetty.webapp.WebAppContext.stopContext(WebAppContext.java:1471)
    at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:927)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:271)
    at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:569)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:124)
    at org.eclipse.jetty.server.Server.doStop(Server.java:523)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
    at winstone.Launcher.shutdown(Launcher.java:307)
    at winstone.Launcher.<init>(Launcher.java:167)
    at winstone.Launcher.main(Launcher.java:354)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Main._main(Main.java:294)
    at Main.main(Main.java:132)

Feb 06, 2018 6:57:10 PM org.eclipse.jetty.server.handler.ContextHandler doStop
INFO: Stopped w.@f27d66{/,null,UNAVAILABLE}{C:\Program Files (x86)\Jenkins\war}
Exception in thread "Jenkins initialization thread" java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad
    at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused by: java.lang.ClassNotFoundException: hudson.util.HudsonFailedToLoad
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:560)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 1 more
Feb 06, 2018 6:57:10 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
java.io.IOException: Failed to start Jetty
    at winstone.Launcher.<init>(Launcher.java:156)
    at winstone.Launcher.main(Launcher.java:354)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Main._main(Main.java:294)
    at Main.main(Main.java:132)
Caused by: java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Unknown Source)
    at sun.nio.ch.Net.bind(Unknown Source)
    at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
    at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
    at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)
    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.server.Server.doStart(Server.java:431)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at winstone.Launcher.<init>(Launcher.java:154)
    ... 7 more
Feb 06, 2018 6:57:10 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.IOException: Failed to start Jetty
    at winstone.Launcher.<init>(Launcher.java:156)
    at winstone.Launcher.main(Launcher.java:354)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Main._main(Main.java:294)
    at Main.main(Main.java:132)
Caused by: java.net.BindException: Address already in use: bind
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Unknown Source)
    at sun.nio.ch.Net.bind(Unknown Source)
    at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
    at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
    at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)
    at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
    at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.server.Server.doStart(Server.java:431)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at winstone.Launcher.<init>(Launcher.java:154)
    ... 7 more

8 个答案:

答案 0 :(得分:2)

Image below

如果您无法找到机密文件,请重新卸载并重新安装Jenkins。否则,请删除.jenkins中的C:\Users\...\.jenkins\secrets文件夹。

===============

您使用jenkins.warjenkins.exe进行安装吗?如果您使用的是jenkins.exe,请尝试从Jenkins war下载jenkins.war

打开命令提示符,运行java -jar jenkins.war。 单击图像以查看oputput

Command Prompt Image1

Command Prompt Image2

Initial Password path shown in the command prompt

使用网址localhost:8080/

打开浏览器

Browser

答案 1 :(得分:2)

似乎问题是8080端口被占用,所以我使用了8081及其工作状态。

答案 2 :(得分:1)

  1. 提供命令sudo su以超级用户身份登录
  2. 更改为机密文件夹 cd secrets
  3. cat initialAdminPassword

答案 3 :(得分:1)

请参阅此文件“ C:\ Program Files \ Jenkins \ jenkins.err.log” 在输入文件之前,它具有初始密码

答案 4 :(得分:0)

检查其他服务是否正在使用端口8080。对我来说,我不得不停止我目前确实不需要的服务,然后重新运行java -jar jenkins.war。这样,它创建了一个秘密文件夹,在其中我找到了默认密码

答案 5 :(得分:0)

对我来说,没有显示“ secret”文件夹,也没有显示“ config.xml”文件,并且在users文件夹内也没有显示任何可以帮助我的内容,因此我执行了以下步骤:

  
      
  1. i从“ jenkins.xml”将端口号从8080更改为8085    (C:\ Program Files(x86)\ Jenkins)

  2.   
  3. 重新启动计算机

  4.   
  5. 使用浏览器启动后,我尝试进入“ http://localhost:8085/

  6.   

然后所有问题解决了,现在显示的是jenkins的初始页,并且也在jenkins文件夹中创建了secret文件夹。

答案 6 :(得分:0)

我在缺少文件夹的Windows上遇到了类似的问题。 我去C:\ Program Files \ Jenkins并打开jenkins.err.log 它具有我需要继续进行操作的密钥。

答案 7 :(得分:0)

有时它在 C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\secrets 中,正如我个人所经历的那样。 这显示为:

enter image description here