Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script hangs/asks for user input if a war file has duplicate file #36

Open
smenke opened this issue Dec 16, 2021 · 4 comments · May be fixed by #37
Open

Script hangs/asks for user input if a war file has duplicate file #36

smenke opened this issue Dec 16, 2021 · 4 comments · May be fixed by #37

Comments

@smenke
Copy link

smenke commented Dec 16, 2021

If a war file contains the same file twice the script will hang when it asks for a response from the user. This becomes an issue especially when running via Ansible or other automation.

This file has this issue: /opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p3368.3632/lib/hbase-solr/lib/solr-4.10.3-cdh5.16.1.war

To see the issue, run these commands:

rm -r -f /tmp/unzip_target
mkdir /tmp/unzip_target
unzip -qq /opt/cloudera/parcels/CDH-5.16.1-1.cdh5.16.1.p3368.3632/lib/hbase-solr/lib/solr-4.10.3-cdh5.16.1.war -d /tmp/unzip_target
replace /tmp/unzip_target/WEB-INF/lib/jackson-core-asl-1.8.10.jar? [y]es, [n]o, [A]ll, [N]one, [r]ename:

A proposed fix for this is to add the overwrite option -o to the unzip command. I can create a PR for this.

@smenke smenke linked a pull request Dec 16, 2021 that will close this issue
@sunilgovind
Copy link
Contributor

A duplicate file caused this prompt. We can override, but it may be too generic as we cant compare the file always. If we skip, it may be a problem again. Hence a manual verification is always good. For automation, and if the files are safe, you could think about adding "-o" to fix the automation.

@smenke
Copy link
Author

smenke commented Dec 17, 2021

Since the file is a duplicate, I would think that specifying either overwrite or skip would solve the issue since you only need one file and they are both the same. If the contents of the files are different I'd think that would cause other issues anyway with the application using the war file. Another option would be to add another environment variable that specifies the desired action (overwrite, skip, prompt).

@TarunParimi
Copy link
Contributor

We dont face this issue in CDH6 and CDP and this particular file doesn't exist. If the issue is only there in CDH5, then it can be ignored since CDH5 need not be patched.

@smenke
Copy link
Author

smenke commented Dec 17, 2021

We are on CDH6 but the CDH5 files still reside and consequently the script hangs while running via automation. Even if we went through an effort to rid our servers of all CDH5 files, it is possible it could occur with other war files now or in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants