Perforce Translation of file error while Synching in Jenkins - jenkins

My Jenkins Version: 2.46.2- LTS.
Jenkins OS: Ubuntu (This is Jenkins Master Server).
Perforce Plugin Version: 1.7.5
Slave Machine: OS Windows-7 (64Bit).
Perforce Visual Client Version: 2016.2
I have configured perforce to sync the code to slave machine from master server. But when i tried to download it shows below errors.
Jenkins Errors:-
Caught exception communicating with perforce.Error encountered while
force synching. Error: Translation of file content failed near Line.
Due to this i m unable to download the files.So any suggestions would be helpful.

This sounds like a Unicode translation error. Setting P4CHARSET to a different value may help, but if the files are corrupted on the back end (i.e. they aren't valid utf8, which is how the server normalizes its copy of all Unicode files) then it won't matter what you set on the client.
Good troubleshooting steps would be to try syncing the same file to another client, and to look in the history for the originally submitting client and try to figure out what character set it was using.

Related

Jenkins on Kubernetes node is complaining its plug-ins need newer version of Jenkins, but don't want to lose data

Jenkins (on a Kubernetes node) is complaining it requires a newer version of Jenkins to run some of my plug-ins.
SEVERE: Failed Loading plugin Matrix Authorization Strategy Plugin
v2.4.2 (matrix-auth) java.io.IOException: Matrix Authorization
Strategy Plugin v2.4.2 failed to load.
- You must update Jenkins from v2.121.2 to v2.138.3 or later to run this plugin.
The same log file also complains farther down that it can't read my config file... I'm hoping this is just because of the version issue above, but I'm including it here in case it is a sign of deeper issues:
SEVERE: Failed Loading global config
java.io.IOException: Unable to read /var/jenkins_home/config.xml
I'd either like to disable the plug-ins that are causing the issue so I can see the Jenkins UI and manage the plug-ins from there, or I'd like to update Jenkins in a way that DOES NOT DELETE MY USER DATA AND JOB CONFIG DATA.
So far, I tried disabling ALL the plug-ins by adding .disabled files to the Jenkins plug-ins folder. That got rid of most of the errors, but it still complained about the plug-in above. So I removed the .disabled file for that, and now it's complaining about Jenkins not being a new enough version again (the error above).
Note: this installation of Jenkins is using a persistent storage volume, mounted with EFS. So that will probably help alleviate some of the restrictions around upgrading Jenkins, if that's what we need to do.
Finally, whatever we do with the plug-ins and Jenkins version, I need to make sure the change is going to persist if Kubernetes re-starts the node in the future. Unfortunately, I am pretty unfamiliar with Kubernetes, and I haven't discovered yet where these changes need to be made. I'm guessing the file that controls the Kubernetes deployment configuration?
This project is using Helm, in case that matters. But again, I hardly know anything about Helm, so I don't know what files you might need to see to make this question solvable. Please comment so I know what to include here to help provide the needed information.
We faced the same problem with our cluster, and we have a basic explanation about that, but not sure about it (The following fix works)
That error come with the fact that you have installed Jenkins via Helm, and their plugins through the Jenkins UI. It works if you decide to never reboot the pod, but if one day, jenkins have to make his initialization again, you will face that error.
Jenkins try to load plugins from the JENKINS_PLUGINS_DIR, which is empty, so the pod die.
To fix the current error, you should specify your plugin in the master.installPLugins parameter.
If you followed a normal install, just go on your cluster and
helm get values jenkins_release_name
So you may have something like that:
master:
enableRawHtmlMarkupFormatter: true
installPlugins:
- kubernetes:1.16.0
- workflow-job:2.32
By default, some values are "embedded" by helm to be sure that jenkins works, see here for more details: Github Helm Charts Jenkins
So, just copy it in a file with the same syntax and add your plugins with their versions. After, you have just to use the helm upgrade command with your file on your release:
helm upgrade [RELEASE] [CHART] -f your_file.yaml
Good luck !

Jenkins error: "ERROR: Unable to install JDK unless a valid username/password is provided."

I have added a new slave to my jenkins server, the connection itself seemed to go successfully via ssh, however when I try to build on that server the Job tries to download Java on the slave(even though java is all-ready installed on that server) and im getting the following Error:
Downloading JDK from http://download.oracle.com/otn/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz
Your Oracle account doesn't appear valid. Please specify a valid username/password
ERROR: Unable to install JDK unless a valid username/password is provided.
Finished: FAILURE
This is the output of java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
what do I need to do here? reinstall java manually?
I was stuck with same error, banged my head for hours but no luck. But finallly the answer was jdk configuration on the master jenkins.
Writing this answer as i couldnt find much on this over internet.
Go to Manage Jenkins -> Global tool configuration
and check the configuration for JDK in JDK installation.
Uncheck the install automatically checkbox as this will be forcing jdk installations on every slave.
If you want this option enabled then you have to give oracle account credentials which to be used by the jenkins to download the jdk.
If you already have java installed on your slaves then you would be better to uncheck the checkbox.
You can set the default credentials for Oracle here:
http://<hostname>/descriptorByName/hudson.tools.JDKInstaller/enterCredential
hostname being your Jenkins URL.
Thanks
Tool Locations
The above two answers didn't work for me. But this did: at the bottom of your node configuration page, set one of your tools to be your JDK:
In fact, I needed to do the same thing with Maven.
Just set the JAVA_HOME in your Jenkins slave so it doesn't try to install another Java.

Jenkins upgrade to 2.32.3 issue?

Recently i have upgraded Jenkins from v1.596.2 to 2.32.3(LTS). But after upgradation i am getting following error but no clear how to rectify it.
=========================================================================
Tomcat Deploy v1.0.16
You must update Jenkins from v2.32.3 to v3.0.0 or later to run this plugin.
Ok so I had the same problem (but with others plugins).
To fix that:
Put Jenkins in "Prepare for Shutdown" mode and shutdown it
On the server HDD go to JENKINS_HOME/plugins and delete (or move elsewhere) the folder and hpi file corresponding to plugin which produce warnings. (The name of file/folder can be a little bit different than the plugin name displayed in Jenkins)
Restart Jenkins. Warning should be deleted

Jenkins: save console output on executing slave server

I already searched a lot for any solution but I couldn't find anything...
I try to save the console output of my current build [last build] on my slave server, which executes the build.
I saw that the log file is stored on master server as well so I hope this is possible for my slave, too.
I already tried to parse the .html document of the master server [http://'myIp'/job/'jobname'/lastBuild/consoleFull] with a python but it didn't work successful in my build process..it just works after the build is complete.
Is there any opportunity to save the console output on my slave server OR on a network drive?
I want to add this step in my build process, too, so it would be nice to save the output as a post-build-action.
OS: both servers (slave and master) are running on Win7 64bit
Thanks for your help!
Michael
Here is a solution to write the console log in your workspace and do a copy on a network drive.
To get a copy of the console log, you can use Console log plugin.
You have to build this plugin from the sources and install it manually from the Manage plugins section :(
Some instruction: https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
I've installed this plugin on my Jenkins server (LTS 1.625.3) and it works well.
Next, you can add this post-build step to get the console log:
Finally, you can use the Publish Over CIFS plugin to copy the log file on a network share (with a post-build task).

Jenkins not able to use SVN credentials or download new plugins/new versions

Can anyone suggest how to fix the two issues?
- Can't upgrade Jenkins and SVN plugin
- Can't connect to svn
I am setting up Jenkins on a Windows 64 bit machine. It's configured to run as a windows service.
We are running this on Windows 7 64 bit OS
Jenkins 1.482
I am able to do an SVN update/checkout from my user account on the machine.
When I attempt to set up a job on jenkins I get the following when trying to add svn credentials
FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/client/trunk failed
More details are:
FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/client/trunk failed
org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/client/trunk failed
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:298)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:283)
at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:271)
at ...
I stopped the service and ran Jenkins from command line and tried the same thing - with the same result.
I am able to connect to the svn server with a tortoise client and via firefox with the same credentials.
In researching the issue I saw a few posts about similar problems and the only one that seems to claim to fix it is rolling back to Jenkins svn plugin version.
I then tried to install the latest jenkins and Plugin for svn. The downloads failed. Aha, I thought - obviously a firewall issue. So I disable the firewall.
Still no good. I can't automatically download or get the new Jenkins or SVN plugin.
Try starting jenkins with this option:
-Dsvnkit.http.sslProtocols="SSLv3"
Or, if Jenkins is starting svn plugin in a separate JVM, try adding the line to wherever the svn plugin run configuration is.
It's a known problem with svnkit, which is used by Jenkins' svn plugin:
http://issues.tmatesoft.com/issue/SVNKIT-176
Also, this answer can be helpful with regards to upgrading your svn plugin.
To change your Windows service commandline:
open a command line window cmd.exe
sc qc "JenkinsSlave" (if that's what your service name is)
select and copy the BINARY_PATH_NAME value
change it, adding -Dsvnkit.http.sslProtocols=""SSLv3"" after the jar path - mind the double quote
sc config "JenkinsSlave" binPath= <paste the changed value copied earlier>
Replace JenkinsSlave with your service name.
Windows 7 x64 has some automatic firewall settings. You may need to open a firewall port to allow the connection.
You should be able to verify or eliminate this as a cause by trying to run your svn client outside Jenkins.
bit late topic, but did you try the following solution?
http://www.daangemist.nl/2014/03/03/jenkins-reports-sslv3-error-on-svn-update
that one worked out for me, in my case I wanted to use -Dsvnkit.http.sslProtocols="TLSv1"
What about running Jenkins service with your account?

Resources