5

We are in the process of a server move, both to a new host and from a Server 2k8 box to a Server 2012 box. The server in question has a few drives that hold our sites and some utilities. These drives were duplicated exactly during the move. Data, folder structures, and permissions should all be identical.

Recently, when running a Jenkins task on this server, I found the following in the log:

G:\Websites\PathToWebsite>G:\Jenkins\Tools\7z a -tzip Website_PROD_Backup_20140311_.zip

7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18

Error: 7-Zip cannot find the code that works with archives.

7-Zip is installed on the server and I can do the actions it's trying to do from the GUI. I'm a developer and am not used to troubleshooting something like this, and Google for the specific error hasn't led me to any resolution.

The closest match I could find is a site that says the command-line tool needs a few .dll files if it's less than 150K. I found the tool at the referenced path above and it was over 150K. I copied the .dll files from the install directory to that directory anyway. This did not fix the issue.

What should I do to fix this? I really need 7-Zip to work from the command line or significant parts of our build/deploy process will have to be done by hand.

  • Is the build/deploy done via explicit scripts or by using a CI tool like TeamCity or CruiseControl.NET? If it's run under a different user does the GUI work when running as that user? Have you tried reinstalling the 7zip command line version? 7-zip.org/download.html – squillman Mar 11 '14 at 19:33
  • @squillman: Build/Deploy is done via Jenkins using scripts. Nothing in Jenkins has changed except the server it runs on (Web2, the new server, instead of Web). I do not know what user it runs under. Does installing 7-Zip install the command line version, or is that separate? – Jeff Mar 11 '14 at 19:35
  • Ah, right. Glossed over the Jenkins line... 7-zip command line is a separate install. If it still doesn't work after installing the command line version find out what accounts the build tasks are running under. – squillman Mar 11 '14 at 19:37
  • 1
    Heh, glad it was that easy for you :) – squillman Mar 11 '14 at 19:56
  • 1
    @squillman: Sometimes it's the trivial stuff that takes longest to troubleshoot. Thanks a bunch! – Jeff Mar 11 '14 at 20:01
6

Make sure you have the 7-zip command line version installed; it's separate from the GUI. YOu can download it here:

http://www.7-zip.org/download.html

| improve this answer | |
5

Another reason for this error is when you have 7z.exe but do not also have 7z.dll - both are needed for the commandline program to work properly. Copying just these two files from the normal 7-zip GUI install folder is enough for a portable version of the commandline program on our CI.

| improve this answer | |
  • This was my problem. I wanted to start 7z from cygwin and forgot to copy the .dll . Thank you – Moritz Schmidt Jan 8 at 10:07
0

in Batch file set the path to the exe otherwise the batch Program will not know where the exe is located. if exe is at c:\Prog~1 files\bin\7zip.exe

set the path as c:\Prog~1 files\bin\

| improve this answer | |
0

I had the same error message as described above. Solved the problem by deleting the 7z.exe from the Windows\System32 directory (which was placed there by installing 7-zip as administrator?).

| improve this answer | |
0

I had a similar problem running '.\7z.exe' from a powershell script, the issue was that the .\ 'local folder' copy of 7z.exe was an older version than the one currently installed on my computer. To fix the issue I just copied the newer 7z.exe and 7z.dll files out to the local folder the script was using.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.