unable to start jenkins after editing matrix based security - java

I deployed latest jenkins war in tomcatrunning on my W$7 machine.During my first log in i configured something in matrix based security as explained here.After adding a user in the matrix, ia m unable to load the jenkins. The following error stack is shown. For complete stack trace please visit here..
Now, When i go to the login page, i could see the login form. Do we have any default login to proceed ?
Note: as described in that article i don't see create an account tab in the login page. Hence i am unable to proceed.
Stack trace :
hudson.security.AccessDeniedException2: anonymous is missing the Overall/Read permission
at hudson.security.ACL.checkPermission(ACL.java:54)
at hudson.model.Node.checkPermission(Node.java:418)
at jenkins.model.Jenkins.getTarget(Jenkins.java:3680)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:612)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:587)
at org.kohsuke.stapler.Stapler.service(Stapler.java:218)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
Edit:
I have also, redeployed the war.The issue was still there.
So then, i have downloaded the fresh war file from the JenKins site and deployed in the tomcat of xampp. When ever, i navigate to the jenkins app , the Java SE crashes.

It looks like you locked yourself out. Here are the lock picker instructions:
Securing Jenkins
...
Disabling Security
One may accidentally set up security realm / authorization in such a way that you may no longer able to reconfigure Jenkins.
When this happens, you can fix this by the following steps:
Stop Jenkins (the easiest way to do this is to stopthe servlet container.)
Go to $JENKINS_HOME in the file system and find config.xml file.
Open this file in the editor.
Look for the <useSecurity>true</useSecurity> element in this file.
Replace true with false
Remove the elements authorizationStrategy and securityRealm
Start Jenkins
When Jenkins comes back, it will be in an unsecured mode where everyone gets
full access to the system.
If this is still not working, trying renaming or deleting config.xml.

I followed the steps in below source.But still faced the same issue.
https://wiki.jenkins-ci.org/display/JENKINS/Disable+security
Finally, I tried to unistall and install the jenkins in another directory which help me to start working.
Hope it will help some one.

All the above answers are wonderful, but nobody mentions the elephant - which is HOW does one get matrix security to work? I went round and round with this until I happened upon what I think is the answer.
Here's what I did:
Disable security, as above
Go in to the 'configure global security' page
Select matrix security, and immediately enable all for anonymous
Add your users and set their permissions, making sure there is at least one administrator (I assume with all permissions).
Save, and make sure you are now logged in as an administrator.
Go back and turn off all but view permissions on anonymous (or whatever your 'anonymous access rules' are).
Save.
Done.
I believe the trick for getting past the 'Anonymous must have ' error is to be sure you are logged in BEFORE turning off anonymous admin privs.

you can do one thing
stop the jenkins (using tomcat)
go to config.xml present in JENKINS folder.
Look for the <useSecurity>true</useSecurity> element in this file.
Replace true with false.
Remove the elements authorizationStrategy and securityRealm
Start Jenkins
When Jenkins comes back, it's in the unsecured mode where everyone gets full access to the system

Fixed by two simple steps:
Go to Jenkin Home
rename config.xml
Try launch the Jenkin

Related

503 Service Unavailable in Mule

I am getting 503 Service Unavailable when call in Mule application... Call is not reaching to HTTP Listener I think and beside of HTTP Listener there is Set Variable... to Set Variable also not reaching call... Till day before yesterday it was working in all work spaces but suddenly it is not reaching to listener when I was trying after putting debug mode. But for other developer is not having any issue and he is able to receive call to Listener and other components. Current configurations everything is good. Can you please suggest what needs to check.
I had the same problem when I added an autodiscovery configuration for my application. Adding this to VM arguments folved my issue.
-Danypoint.platform.gatekeeper=disabled
I faced the same problem.
Everything was working, and suddenly (don't know why) I received the same 503 response.
I tried a lot to figure out what was going on.
Added new listeners and tested existing flows, which all went well.
Only my particular listener with the APIKit was never getting reached anymore.
I also disabled 'the gatekeeper' as suggested in the following article :
API-returns-503-Service-Unavailable-error-to-clients
Run -> Run configurations -> tab Arguments
I exported the project to a deployable archive file, with the checkbox 'only export project sources' selected. Tested this application on different PC's which went well.
Created a new workspace on my PC, imported the file , and the application failed again.
After a few other try & errors, I enabled the 'clear application data' -> 'prompt' selection box, and I disabled the 'APIKit settings' -> 'Show APIKit consol'.
I'm not sure if that consol had something to do with it, but after restarting the application and select YES on Clear application data , it worked well again.
Run configurations
I re-enabled the 'show APIKit consol' again, and it still worked fine.
This should solve your problem as well.
This is basically the same answer as the answer provided by user15476634, but with a visual description, and reasons why this error may occur.
For those who are wondering where to find Clear Application Data, please see below screenshot.
Most usual suspects in these type of issues is corrupted Application data due to following issues:
Trying to open multiple test consoles at a time
Working on huge payload and not enough memory allocated
Accidentally selecting the multiple run configurations and/or debug configurations at once
when you try to re-run the same app while an instance is already
running by disregarding the prompt/warning window (Do you want to stop the running application and start ...?)
For me, I had the same experience, the 503s appeared out of nowhere. Clearing application data did not work for me, setting
-Danypoint.platform.gatekeeper=disabled
did not work for me. I had to remove this xml tag from my global config
<api-gateway:autodiscovery ... />
It happened to me after turning on autodiscovery in order to deploy, so i had to remove these lines (autodiscovery) temporary then test then return these lines back in order to deploy

Windows could not start service, Error 1053: The service did not respond to the start or control request in a timely fashion

I have created a Java program then I need to install it as windows service.
First I run the jar directly from console and it ran as I wish, then I compile the jar to exe and I ran it as Admin ran OK.
But when I run it from windows service I got following error,
Error 1053: The service did not respond to the start or control request in a timely fashion
I also tried to set Account and password on Log On Tab, but not resolved yet.
It's not possible to resolve the actual problem with the information given by you, so I will provide you the steps necessary to debug the problem.
Use logging in your application to see what causes the error: Apache Log4j
You can use the Windows Event Viewer to see what happens when you start your Windows Service. This is very useful if the problem happens before the start of the application itself.
Click on Start / Windows symbol, type Event Viewer and press Enter. In the left hand tree-menu, click Windows Logs and then Application.

Debugging web service with Intellij

I work with a web service (SOAP) that is installed on a remote server (Websphere). Since I do not fully understand its operation, I would like to use debugging to understand the code step by step. I want to use the local instance Intellij (ultimate). My problem is that due to little experience I do not know how to do it. I have questions:
to check the operation of WS I want to send queries to the server using SOAPUI. Is there a possibility for me to look at Intellij (using breakpoints) what values are returned at a given stage?
how to connect it all together?
is there a different, better way to check the code?
First, make sure that debug is enabled on your remote server. This can probably be configured in Websphere. Then, in IntelliJ select the "run configurations" dropdown and "Edit Configurations". Hit the "+" and select remote. Set the correct host and port, and click "OK". Then, start the run configuration in debug mode, add some breakpoints and debug away!

How to configure Eclipse Market place in Spring Tool Suite 3.8.1-64?

In spring Tool suite there is no tab for Eclipse Market Place to search any new plugin for install..so i am trying to configure eclipse market place in my sts IDE
Below is the step:
1) go to help
2) select Install New Software Tab
3) After that i am getting window for location select but what location i have to put for market place configure in sts
i try with different kind of location from google but not any work for sts
so anyone having idea regarding this solution then please suggest?
Considering this as a general programming problem, some possible causes are:
The service could be temporarily broken
You could have a problem with a firewall. These could be local or they could be implemented by your ISPs.
Your proxy HTTP settings (if you need one) could be incorrect. This Answer explains how to adjust the Eclipse-internal proxy settings ... if that is where the problem lies.
It is possible that your access may be blocked by over-active antivirus software.
The service could have blacklisted some net range and your hosts IP address is "collateral damage".
Try connecting to that URL with a web browser to try to see if it is just Eclipse that is affected ... or a broader problem.
Considering this in the context of the Eclipse Marketplace service, first address any local proxy / firewall / AV issues, if they apply. If that doesn't help, the best thing that you can do is to be patient.
It has been observed that the Eclipse Marketplace service does sometimes go down. It doesn't happen often, and when it does happen the problem does get fixed relatively quickly. (Hours, not days ...)
I can't find a "service status" page or feed or similar for the Eclipse services. (If you know of one, please add it as a comment below.)
There may be an "outage" notice on the Eclipse front page. Check for that.
Try to connect to the service URL (refer to the exception message!) using a web browser and/or from other locations. If you succeed, the real problem may be a networking issue at your end.
If you feel the need to complain about Eclipse's services, please don't do it here!! (It is off topic.)

User Permission in Jenkins

Inside Jenkins Jobs & Builds folder, I am creating a text file and writing some content through Java program. As I am part of corporate network, I am inside firewall with many security rules where I have been restricted to write/update the program files directory under C: drive. Although I am administrator in my local machine, however the company policies are still applied which is denying me access to write/delete any files from the Jenkins directory. I see Jenkins is nicely reading/modifying/writing any files/folders without any issues which is believed to the typical behavior of Jenkins's USER.
Question 1: Is there any way I can use this Jenkins's user through my code so I can avail access on to these directories?
Question 2: Are there ways to solve this issue through Java code? (Note: I have tried writing a file with Run as Administration java code as well)
Kindly let me know if I am missing any details,.any help is highly appreciated.
It's about the user who launched the jenkins server, who might have the permissions to access the directories.
You can use the same user for your operations if available.
Question 1: Is there any way I can use this Jenkins's user through my code so I can avail access on to these directories?
Jenkins users - Jenkins server can have its own users and privileges can be set for each users differently. You cannot use these users outside of Jenkins server.
You can use the user who launched the Jenkins server, must be a user at OS level.
Question 2: Are there ways to solve this issue through Java code? (Note: I have tried writing a file with Run as Administration java code as well)
Again, only OS level users can be used and not the Jenkins users(users created inside Jenkins server)
If you want your application to run with same credentials as Jenkins user, then hold Shift+Right Click your application, select "Run as different user", provide Jenkins's user credentials and press OK.
If you are launching your Java application from command line, do the Shift+Right Click on the cmd.exe first, and once again select "Run as different user"
If you want to impersonate a Windows user from within code, then you should really reword your question body and title (and remove Jenkins references as it has nothing to do with this). But even in this case, you need to know the credentials of the user you are trying to impersonate

Categories