There are resources Jenkins was not able to dispose automatically - concerning? - jenkins

After running different jobs I sometimes get this message in Jenkins:
"There are resources Jenkins was not able to dispose automatically."
I can then click the link provided and there is no additional information there. The jobs run fine, the workspace is as expected, the jobs folder looks normal. Is this something I should be concerned with?

You mentioned you believe all the work happens on your master, not an agent. This may negate what I'm about to say but it might help for troubleshooting anyway;
We have a master/agent setup and often get those warnings. We found it was because one of our jobs created files with permission settings that didn't give Jenkins permission to delete them. Sometimes we could track down the exact files; sometimes it was blank, like you said.
We figured out that the blank ones were happening because the agent was taken offline once it was done with its jobs, and then deleted. No agent = no files. Maybe your master deletes its workspace periodically and creates the same effect?
Either way the solution for us was to change the permissions on the affected files, and we stopped getting the messages.

This error came when jenkins tries to delete cleanup folder but cant delete may be due to permission error or other.
To check the files which Jenkins is trying but not able to delete:
sudo find /var/lib/jenkins/workspace/ws-cleanup/ -user root
To delete:
sudo find /var/lib/jenkins/workspace/ws-cleanup/ -user root -delete
To avoid add the delete command whose job files are giving problem.
Regards
DevOpsBro

Related

Jenkins jobs, history, users - all missing after a reconfigure

This question has been asked multiple times around however 'Reload from disk' didn't work for me.
I opened my local Jenkins after a month, this time it asked me to reconfigure everything including the plugins as well as admin user (it had generated a new password). Moreover, my old jobs, build history, scripts etc. everything has gone missing. I have tried 'Reload from disk', but it did not work. I checked for most known places to see if my folders are available but they aren't.
Please can anyone help me get at least my scripts back?

How to interactively pass values between Ansible and Jenkins while the Job is Running

My Jenkins UI takes parameter a list of files/folders along with wildcards from users that they wish to delete.
Jenkins then passes the files to be deleted across all hosts by invoking ansible-playbook.
My requirement is to prompt user on Jenkins for confirmation before deleting a file / folder.
Thus, how rm -rfi /tmp/moht /var/log*/data.dat prompts interactively asking the user confirmation before deleting the files; is what I Wish to prompt on Jenkins for each Host.
Thus, for the above I expect Jenkins to prompt like below:
Are you sure you want to delete
/tmp/moht
/var/log14Mar/data.dat
I'm aware of input function in Jenkins for prompt.
I'm also aware of an ansible command module that can be used to fire rm -rfi command.
I'm also aware of how to timeout or terminate the Jenkins Job upon user input. However, in this case I would love if the user input Yes / No could be sent back to the target host via ansible and action gets performed accordingly.
I understand that this may be too much an ask but other feasible solutions or suggestions are also appreciated.
Can you please suggest how can I achieve the requirement?
I strongly feel that using Jenkins as interactive tool is a bad idea. But if you really like to implement bad ideas with unsuitable tools, you can try to use matrix job [1] based on files you want to remove.
Jenkins will create a list of jobs with a job for each file you'd like to remove. You ask confirmation and then execute an Ansible playbook to remove a file.
[1] https://plugins.jenkins.io/matrix-project/
It's horribly inefficient and you should not do it like this.

Jenkins: Tracing the history of unsaved new test definition (copied from another test definition)?

Recently, in our enterprise production setup, it seems someone has tried to setup a new job / test definition by using another (copying) from identical job. However, (s)he seems to have NOT saved (and probably, am guessing here, closed the browser with the session being lost).
But the new job got saved though it was not set to stable or active; we knew about this because changes uploaded to gerrit, started failing in this newly setup partial job (because, these changes were in certain repos that met certain TDD settings).
Question: Jenkins system does not have trace of who setup the system in 'configure versions' option. Is there anyway to know the details of who setup the job / when was that done ?
No, Jenkins does not store that information by default.
If your Jenkins instance happen to be running behind an Apache or Nginx web server, there might be access logs that can help you. To find out when the job was created you could look at when its config.xml file was created/modified.
However, there are a few plugins that can add this functionality so that you won't have this problem again:
JobConfigHistory Plugin – Tracks changes in your job configurations and gives the ability to restore old versions.
Audit Trail Plugin – Keeps a log of who performed particular Jenkins operations, such as configuring jobs.

Change configuration once, and gets multiple config change history

I work with a Jenkins server in which JobConfigHistory plugin is installed.
This server has been used for a while, and I think many other plugins are installed as well.
On this server, I get multiple config change history recorded when I make a change to job configuration.
I don't want this behavior; I want only single history change for a single configuration change.
I guess some Jenkins server config or some installed plugin is the cause of this problem, but I have no clue what I should do to find it out.
Any idea?
There is a Jenkins issue that has been resolved recently:
[JENKINS-22224] one job configuration change results in three Job Config History entries.
But:
Danny Staple added a comment - 20/Nov/14 5:17 PM
We are seeing a general problem here - some of the plugins appear (parameterizedTrigger, ThrottleConcurrentbuilds, NodeLabel, ExtendedChoice are current suspects) to do this too - we are now having as many as 8 (!!) saves in the config. For some plugins, it seems that when there is no change, they save a no-diff config. Almost as if each is doing their own save in order.
Marc Günther added a comment - 20/Nov/14 5:23 PM
+1
We are not using disk-usage plugin anymore, cause it's so slow, but I still see this behaviour. So it's definitely not restricted to disk-usage plugin alone....
The plugin persists the changes whenever the configurable entity is saved regardless there is any change or not. Note there is a global option for the plugin Do not save duplicate history to save only unique changes.

TFS: checkout from one server, checkin to another

I've got a need to checkout an entire source tree out of one server and check it into another server. I'm attempting to script this into a final builder script, but am running into some snags. I'm able to check everything out, but when I attempt to check it into the new server it tells me there are no pending changes. Obviously I'm missing something if this is even possible.
Anyone done something similar to this or know of a way I might accomplish this?
One more thing, if the src is empty on server 2 would I have to manually add the files before I can update them?
I would guess that the reason that TFS is saying no pending changes is that you haven't checked out the files from Server 2. This could get kind of ugly using a single directory, so I would recommend trying this:
Get (latest or specific version) from server 1 to
C:\Server1Files...
Get and Check out for edit everything from server 2 to
C:\Server2Files...
Copy from C:\Server1iles1\ to C:\Server2Files
Check in from C:\Server2Files
I think TFS is going to complain if you try to use a single directory here, as it would see the same directory mapped to two different workspaces (even though they're on different instances of TFS).

Resources