Jenkins.war and Jenkins as service

21 views
Skip to first unread message

raviraj shitole

unread,
Mar 20, 2020, 1:36:44 PM3/20/20
to Jenkins Users

Hi All,

 

I am a difficulty with the way Jenkins is being installed.

 

When we install Jenkins as Server, I am facing difficulty in test automation. The browser doesn’t launch and it gives error that some DevSH tool is missing.

 

Now when I start Jenkins Jenkins.war, there is no problem with the test execution.

 

 

Can someone please let me know the difference between Jenkins as service and Jenkins.war? And also how to solve the error with Jenkins as a service.

 

Awaiting your Response.

 

-Regards,

Raviraj

Mark Waite

unread,
Mar 20, 2020, 2:17:23 PM3/20/20
to Jenkins Users
Jenkins running as a service on Windows does not have access to the desktop by default.

Jenkins running from the desktop using `java -jar jenkins.war` from a Windows command prompt will have access to the desktop.

If you want to run Jenkins as a service and access the desktop, you should probably provide agents which are started from a desktop Windows environment so that they have full access to the desktop.



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e120511f-20b9-423f-bc37-d7639f856505%40googlegroups.com.

Raviraj Shitole

unread,
Mar 23, 2020, 1:32:10 PM3/23/20
to jenkins...@googlegroups.com
I am getting an error "WMI access denied error" while trying to install the Slave agent as a service on windows.

what should we do now?

Mark Waite

unread,
Mar 23, 2020, 1:55:46 PM3/23/20
to Jenkins Users

Raviraj Shitole

unread,
Mar 24, 2020, 3:13:10 AM3/24/20
to jenkins...@googlegroups.com
Hi Mark,

Thank you was able to install the agent as a service, but now when i execute the tests chrome browser is not visible on the desktop. The process starts in the background and exits. 
How do i make the browser visible now?

Thanks
Raviraj

Björn Pedersen

unread,
Mar 24, 2020, 4:48:41 AM3/24/20
to Jenkins Users


Am Dienstag, 24. März 2020 08:13:10 UTC+1 schrieb raviraj shitole:
Hi Mark,

Thank you was able to install the agent as a service, but now when i execute the tests chrome browser is not visible on the desktop. The process starts in the background and exits. 
How do i make the browser visible now?

Don't  run the agent as a service. 
 
 service -> no desktop access, so no windows visible
not service -> desktop access 
 
Thanks
Raviraj

On Mon, Mar 23, 2020 at 11:25 PM Mark Waite <mark.e...@gmail.com> wrote:
See  https://github.com/kohsuke/winsw/issues/210 for some suggestions to try

On Mon, Mar 23, 2020 at 11:32 AM Raviraj Shitole <sravi...@gmail.com> wrote:
I am getting an error "WMI access denied error" while trying to install the Slave agent as a service on windows.

what should we do now?

On Fri, Mar 20, 2020 at 11:47 PM Mark Waite <mark.e...@gmail.com> wrote:
Jenkins running as a service on Windows does not have access to the desktop by default.

Jenkins running from the desktop using `java -jar jenkins.war` from a Windows command prompt will have access to the desktop.

If you want to run Jenkins as a service and access the desktop, you should probably provide agents which are started from a desktop Windows environment so that they have full access to the desktop.



On Fri, Mar 20, 2020 at 11:36 AM raviraj shitole <sravi...@gmail.com> wrote:

Hi All,

 

I am a difficulty with the way Jenkins is being installed.

 

When we install Jenkins as Server, I am facing difficulty in test automation. The browser doesn’t launch and it gives error that some DevSH tool is missing.

 

Now when I start Jenkins Jenkins.war, there is no problem with the test execution.

 

 

Can someone please let me know the difference between Jenkins as service and Jenkins.war? And also how to solve the error with Jenkins as a service.

 

Awaiting your Response.

 

-Regards,

Raviraj

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.

Raviraj Shitole

unread,
Mar 24, 2020, 5:26:23 AM3/24/20
to jenkins...@googlegroups.com
Actually its an organization wide setup which is done as a service(Jenkins is installed as a service on Ubuntu)

That's the reason i am trying to connect it that way. Everything is working fine, even the chrome browser is launched in the background. The tests are some how executed but it not visible. Everything happens in the background.

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e8160d9e-f88f-43a7-b57d-9befbb7b5e45%40googlegroups.com.

Björn Pedersen

unread,
Mar 24, 2020, 5:34:18 AM3/24/20
to Jenkins Users


Am Dienstag, 24. März 2020 10:26:23 UTC+1 schrieb raviraj shitole:
Actually its an organization wide setup which is done as a service(Jenkins is installed as a service on Ubuntu)

That's the reason i am trying to connect it that way. Everything is working fine, even the chrome browser is launched in the background. The tests are some how executed but it not visible. Everything happens in the background.


That is the whole idea behind using Jenkins,  automated testing without human intervention.  To develop and debug a test,  just start it manually in your environment.

Raviraj Shitole

unread,
Mar 24, 2020, 5:50:11 AM3/24/20
to jenkins...@googlegroups.com
Yes absolutely. But when jenkins is running as a war and i run the test, it shows the actions on the UI, but with Jenkins as service everything runs in the background.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Joachim Kuhnert

unread,
Mar 24, 2020, 12:17:07 PM3/24/20
to jenkins...@googlegroups.com

As already mentioned by others the “problem” is the service environment. A service has no desktop and therefore cannot show any user interfaces including chrome. So as long as you run the Jenkins job in an service environment (on Jenkins master or agent installed as a service) you will never see the browser window. If you lunching Jenkins.war from command line you don’t run Jenkins as a service but with your current user which (may) has a desktop and therefore can show windows.

Raviraj Shitole

unread,
Mar 24, 2020, 12:35:59 PM3/24/20
to jenkins...@googlegroups.com
Okay... So which installation is most preferable? Jenkins as a service or jenkins.war.

Jérôme Godbout

unread,
Mar 24, 2020, 1:33:50 PM3/24/20
to jenkins...@googlegroups.com

If you run as service under Windows, you might want to change the user that use to run your services (log on) of the service. Use a user with a login desktop capability. The only downfall I see is when I ask the Jenkins to restart it always hang, I have to restart the service manually. Linux doesn’t have those issues.

Reply all
Reply to author
Forward
0 new messages