Hudson CI Server configuration gone very wrong - continuous-integration

I am not sure if this is a true SO question really, so will understand if it gets closed or moved.
I am new to hudson, I have had it up and running for a few weeks now and so far have been very pleased. It is running on a Windows 2008 X64 machine as a windows service.
The WS2008 runs on VMware ESXI4.0, as well as another WS2008 and an Ubuntu Server. Last night the two windows servers suddenly stopped responding, MSTSC, file share, web access, it all stopped. The ESXI server still responded as I could browse to the home page and see its install guide. Also the Ubuntu machine continued to work normally, I ssh'd onto it, the Apache server was running and Samba still responded normally.
In the end I had to reboot the physical box to get it all back up again.
Once I did the servers came back up but Hudson has now lost its settings. What is weird is it still asks me to log in, and the username and password still work, so it knows that user is setup.
The user was setup to be an admin user so I could manage the whole site. I had three build jobs setup and had them building each night.
Now when I log in I do not see half the options on the left hand menu and there are no jobs.
I am not really sure where to start with this to try and solve it.
I could really do with some help and guidance.
Thank you
Jon
EDIT
OK, so I can narrow my question down now.
If I remove the user security it shows me all the builds and I can manage the system again.
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<version>1.341</version>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<useSecurity>false</useSecurity>
<authorizationStrategy class="hudson.security.GlobalMatrixAuthorizationStrategy">
<permission>hudson.scm.SCM.Tag:Jon</permission>
<permission>hudson.model.View.Configure:Jon</permission>
<permission>hudson.model.Computer.Configure:Jon</permission>
<permission>hudson.model.Item.Configure:Jon</permission>
<permission>hudson.model.Item.Create:Jon</permission>
<permission>hudson.model.Run.Delete:Jon</permission>
<permission>hudson.model.Computer.Delete:Jon</permission>
<permission>hudson.model.View.Delete:Jon</permission>
<permission>hudson.model.Hudson.Read:anonymous</permission>
<permission>hudson.model.Hudson.Read:Jon</permission>
<permission>hudson.model.Run.Update:Jon</permission>
<permission>hudson.model.Hudson.Administer:Jon</permission>
<permission>hudson.model.Item.Build:Jon</permission>
<permission>hudson.model.Item.Read:Jon</permission>
<permission>hudson.model.Item.Delete:Jon</permission>
<permission>hudson.model.Item.Workspace:Jon</permission>
<permission>hudson.model.View.Create:Jon</permission>
</authorizationStrategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
</securityRealm>
This is the line I changed, was true.
<useSecurity>false</useSecurity>
my user name is "Jon", which I can still log on with, but I can only see the following options:
Build History
My Views
Leader Board
If I try and go directly to "/manage" I get access denied.
Second Edit
Fixed it, I removed all security, went in and re added the User then it seemed to remember everything.. very odd.
Third Edit
Didn't fix it, but found out what the original problem is. It is forgetting my user settings, so even if I re add "Jon" back in with all privileges after a restart it forgets it all again.

All of hudson's configuration information lives in XML files in the hudson home directory. You didn't tell us how you deploy it (winstone? jetty?), but you have to have a home directory somewhere.
It's rather hard to imagine hudson deleting these files.
I would make a new, clean, install of hudson somewhere else and compare it to the state of your broken installation.

I once lost data when I edited the Job xmls (every job has it's own config.xml) and broke the xml structure. That will prevent Hudson from loading the jobs. You might find some information, of what is going wrong in the log files (HUDSON_HOME\*.log).

Related

Jenkins Page Not Loading. Apache2 Ubuntu Page Starts Up Instead

I'm new to DevOps and build/automation tools. I installed Apache Maven and Jenkins, but the Jenkins dashboard is not popping up. In other words, I should be seeing this:
But I'm instead seeing this:
I found a similar question here, but I was unable to understand what to do: How to access Jenkins dashboard locally when it is installed on staging server?
From what I understand, I need to make Jenkins open up on a different port, but I'm not sure how to do this. I checked in services and I can confirm that Jenkins is in fact running.
Ok, so I figured it out, but I still don't understand what that Apache page is. For anyone wondering how to fix the issue with the dashboard not popping up:
STEP 1: I was exploring the installation directory and found a file called jenkins.xml with the line --httpPort=8080.
STEP 2: It wouldn't let me edit and save the file so I dragged it to my desktop where it let me make changes. I changed 8080 to 8082, saved, and then placed the file back in the installation directory.
STEP 3: I didn't notice any changes until I restarted the Jenkins service and it's showing the dashboard now.
I still would like to know what that "Apache 2 Ubuntu Default Page" is about.

Sitecore Setup installation fails with error Failed to open XML file, system error:-2147024786

When running Sitecore Setup the following error pops up:
Failed to open XML file, system error:-2147024786
I've tried going through the eventviewer but to no avail.
Not unimportant is that I used the installer but forgot to change my rootdirectory. As a consequence I had to uninstall (using the same installer Sitecore).
Now however it "feels" as though there are some references or remnants left behind somewhere.
Who has a clue or can give me an idea of what is going on?
You are correct, this issue is because the previous Sitecore instance, with the same name, has not been removed completely. You will need to manually complete the following tasks to remove the remnants and be able to run the installer, it has worked for me in past;
Stop the App Pool for the uninstalled site in IIS
Stop the Web Application for the uninstalled site in IIS
Perform an iisreset in command line
Delete the App Pool and Web app in IIS
You should now be able to completely delete the folder containing the Website and Data folder completely
If you are still having trouble deleting it check the folder's Security Permissions, the Users and their Permissions and Read Only checkbox. Ensure you have control to delete
Delete the relating entry in the hosts file
If you also installed Databases access them via MSSQL Management Studio, take all relating databases Offline then delete them.
This will effectively remove all remanants of the previous site. If what ever reason the issue still persists, Sitecore's own Sitecore Instance Manager has a delete option which will completely uproot the site for you. Try installing with SIM then.

ClickOnce Error "different computed hash than specified in manifest" when transferring published files

I am in an interesting situation where I maintain the code for a program that is used and distributed primarily by our sister company. We are ready to distribute the program to all of the 3rd party users and since it is technically our sister companies program, we want to host it on their website. (in the interest of anonimity, I'll use 'program' everywhere instead of the actual application name, and 'www.SisterCompany.com' instead of their actual URL.)
So I get everything ready to go, setup the Publish setting to check for updates at program start, the minimum required version, and I set the Insallation Folder URL and Update Location to "http://www.SisterCompany.com/apps/program/", with the actual Publishing Folder Location as "C:\LocalProjects\Program\Publish\". Everything else is pretty standard.
After publish, I confirm that everything installs and works correctly when running directly from the publish location on my C: drive. So I put everything on our FTP server, and the guy at our sister company pulls it down and places everything in the '/apps/program/' directory on their webserver.
This is where it goes bad. When I try to install it from their site, I get the - File, Program.exe.config, has a different computed hash than specified in manifest. Error. I tested it a bit, and I even get that error trying to install from any network location on our network other than my local C: drive.
After doing the initial publish in visual studio, I have changed no files (which is the answer/reason I've found by doing some searching about this error).
What could be causing this? Is it because I set the Installation Folder URL to a location that it isn't initially published too?
Let me know if any additional info is needed.
Thanks.
After bashing my head against this all weekend, I have finally found the answer. After unsigning the project and removing the hash on the offending file (an xml file), I got the program to install, but it was giving me 'Windows Side by Side' Errors. I drilled down into the App Cache were the file was, and instead of a config .xml file, it was one of the HTML files from the website the clickonce installer was hosted on. Turns out that the web server didn't seem to like serving up an .XML (or .mdb it turns out) file.
This MSDN article ended up giving me the final solution:
I had to make sure that the 'Use ".deploy" file extension' was selected so that the web server wouldn't mangle files with extensions it didn't like.
I couldn't figure out why that one file's hash would be different. Turns out it wasn't even the same file at all.
It is possible that one of the FTP transfers is happening in text mode, rather than binary?
For me the problem was that .config transformations were done after generating manifest.
To anyone else who's still having trouble, five years later:
The first problem was configuring the MIME type, which on nginx (/etc/nginx/mime.types) should look like this:
application/x-ms-manifest application
See Click Once Server and Client Configuration.
The weirder problem to me was that I was using git to handle the push to the server, i.e.
git remote add live ssh://user#mybox/path/to/publish
git commit -am "committing...";git push live master
Works great for most things, but it was probably being registered as a "change," which prevented the app from installing locally. Once I started using scp instead:
scp -r * user#mybox/path/to/dir/
It worked without a hitch.
It is unfortunate that there is not a lot of helpful information out there about this.

Logging into TFS on a Mac

I got Team Explorer Everywhere so we can use TFS on the Mac Mini we got to test Iphone apps. Since we're using XCode for phonegap, we need to use the commandline program and it is giving me a lot of grief.
What I've done so far (Listing out for anyone who stumbles on this so they can use it):
-Downloaded the trial (free)
-Set the path using PATH=$PATH\:/FOLDERLOCATION
-Accepted EULA and got trial product key... for command line program (tf eula/tf productkey -trial)
-Set up workspace:
tf workspace -new WORKSPACENAME -server:http://SERVERNAME:PORT/FILEPATH -comment:"WORKSPACENAME" && prompted for username -> domain -> password
-Trying to setup the folder path (Fixed):
tf workfold -map SERVERFOLDERPATH LOCALFOLDERPATH -collection:http://SERVERNAME:PORT/FILEPATH -workspace:WORKSPACENAME && prompted for username -> domain -> password
-Make sure I can check out/check in (On hold):...
The error I'm getting right now is "An argument error occurred: First free argument must be a server path." This is what I've been following ever since I got the path set, but I think the versions are different because mine doesn't seem to be set up the same. Any help at all would be appreciated, and I'll keep up with the post as I figure parts out because there doesn't seem to be much online that I can find on TFS on macs.
Update: As normal, I'm an idiot. Have to put the options at the end of the command and have to have the serverfolder path as the first thing after -map. Now I just need to figure out how to use the damn thing. I'll post any other questions I have and try to get all the correct commands up for the selfish reason of having them somewhere in case I forget them later.
Update 2: The mapping hasn't worked out as well as I'd hoped, it seems a combination of my unfamiliarity with Unix/Mac file systems and some settings being missing is keeping me from using 'tf get' to load all of the test data I was trying to get. I'm planning on trying again after I get the location of where my boss wants the data saved and after I can look into something that would save the workspace so it won't say that it can't find the map path every time...
It looks like you're setting up your workspace and some working folder mappings just fine, after the edit. If you're having problems doing a tf get after this, then there are some common problems that might be occurring. TFS workspaces can be a little bit opaque and having a better understanding of them can sometimes help you understand where the problem is:
Team Foundation Server requires a workspace to be configured before you can get files out of source control, edit them or check them back in. A workspace basically simply contains working folder mappings that map your local path(s) to server path(s).
Workspaces are stored on the server and are uniquely identified by your computer's hostname, your username and the workspace's name. A cache of this information for the local host is saved on the client. This implies:
If you remove a workspace on the server, your workstation will be unable to connect.
If you remove the cache, your local computer will not be able to identify the workspace based on working folder mappings until the cache is rebuilt (which happens every time you connect to the server.)
If you change your username or local workstation's name, you cannot access those workspaces.
(Note that very early versions of the Teamprise command line client had certain issues on Mac OS that made identifying the local workstation name difficult. This is fixed, however, in Team Explorer Everywhere.)
Because you can have multiple workspaces for a single server on a single workstation, you can't always simply provide server paths to tf commands, since server paths are ambiguous. ($/ exists in every workspace, for example.) So the command line client resolves paths based on the current working directory and/or the arguments provided. Meaning that you can run tf get foo.txt if you're in a working folder, or you can run tf get /tmp/foo.txt if /tmp is mapped.
One more point - the configuration data for Team Explorer Everywhere is shared between the TFS plug-in for Eclipse and the command line client. So if you're more comfortable using a GUI to set up your workspace(s), you can do that and then use the CLC as you see fit. You don't need to be a Java programmer to use Eclipse - simply download Eclipse and install the TFS plug-in for Eclipse into it, and select Window > Open Perspective > Team Foundation Server Exploring. After that, you'll have the full GUI Team Explorer experience and this perspective will be restored when you open Eclipse, so you won't even need to worry about the Java IDE bits if you don't want to.

jenkins started with all jobs lost, trying to use 'copy existing job' feature

the CI server was disconnected for a while for some strange reason from the network and when it came back up, jenkins displayed with no jobs. however in the directory where the jobs live, /var/lib/jenkins/jobs/, the two jobs that should appear are there, but don't show any evidence of existence in the web client.
i tried using the 'copy existing job' and then pointed it to /var/lib/jenkins/jobs/existing_test but it tells me: no such job /var/lib/jenkins/jobs/existing_test
any suggestions as to how to get this to work ?
I know that question can be outdated, but a possible a solution is to run jenkins under appropriate user (the one it run previously). This helped me.
ended up just building the jobs brand new, wasn't able to find a fix
At first I would try and look in the jenkins logs, as your data is in /var/lib/jenkins I would guess your log files are in /var/log/jenkins. Maybe you can find out whats wrong from there.
Also you could try the "load configuration from disk" link in the "manage jenkins" view. That should try to reload the configuration files from your directories, and maybe bring your jobs back. Anyways, you should be able to see something in your logs. If the logs are empty check file permissions, I used to have problems with that after updating sometimes.

Resources