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

Oscar fails on Windows due to "bug" in PE installer #17

Open
tnolet opened this issue Oct 13, 2013 · 9 comments
Open

Oscar fails on Windows due to "bug" in PE installer #17

tnolet opened this issue Oct 13, 2013 · 9 comments

Comments

@tnolet
Copy link

tnolet commented Oct 13, 2013

Hi,

Not so much a bug in Oscar, but this will put off a lot of users from using Oscar. When using Vagrant on Windows, Oscar works fine, until the PE installer reads the answer files. Because the file is mounted from Windows to a Linux box, the line endings are screwed up and the installer fails, stating that the answer is null. I'm gonna report it to the PE buglist also.

A simple fix would be to force the answer file to a Unix format in the utilities file in the PE installer. Just add this to the load_answers() function:

load_answers() {
   t_load_answers__file="${1?}"


    if [ -f "${t_load_answers__file?}" ]; then

    # Force the answer file to have Unix line-endings.
    tr -d '\15\32' < "${t_load_answers__file?}" > answerfile_placeholder
    mv answerfile_placeholder "${t_load_answers__file?}"
    ...
@mlehner616
Copy link

Thank you for posting this, Just ran into this today just before I tweeted to Adrien about it.

@mlehner616
Copy link

I think a better solution would be for Oscar to generate an answers file with unix line endings.

@adrienthebo
Copy link
Member

@tnolet @mlehner616 my best guess is that this occurs when the puppet-enterprise*.tar.gz is unpacked and if the line ending type was forced for the duration of the VM unpacking this would be resolved. Does this sound correct?

@adrienthebo
Copy link
Member

Actually I may have misunderstood the problem. Does the actual installer have the correct line endings but the answers file does not? If that's the case could you go into the location of the vagrant-pe_build gem installation and check if the answer templates in vagrant-pe_build/templates/answers have unix line endings or Windows line endings?

@tnolet
Copy link
Author

tnolet commented Jan 30, 2014

The problem is in the transfer of the answer file from a PE zip on Windows to the running Vagrant instances. The fault is not necessarily in Oscar. I also registered an issue with Puppetlabs and I think they already picked it up. If I’m correct, they now force Unix line endings before parsing the answers file. This fix is more generic and would work also for Oscar

From: Adrien Thebo [mailto:[email protected]]
Sent: donderdag 30 januari 2014 18:38
To: adrienthebo/oscar
Cc: Tim Nolet
Subject: Re: [oscar] Oscar fails on Windows due to "bug" in PE installer (#17)

Actually I may have misunderstood the problem. Does the actual installer have the correct line endings but the answers file does not? If that's the case could you go into the location of the vagrant-pe_build gem installation and check if the answer templates in vagrant-pe_build/templates/answers have unix line endings or Windows line endings?


Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-33711916.

@cbarbour
Copy link

Just ran into this today.

The issue in this case probably needs to be resolved in Oscar. The PE installer is a bash script that simply sources the answers file; the answers file needs to be a valid bash script in order to be invoked this way. BASH it's self doesn't particularly like Windows style line endings (\r is treated as part of the variables data rather than as a whitespace seperator.)

The PE installer could probably work around the issue, or attempt to fix the line endings itself, but in this case it's probably better to ensure that the answers file has UNIX line endings to begin with.

@tnolet
Copy link
Author

tnolet commented Mar 17, 2014

This should already be fixed, according to this ticket @puppetlabs: https://projects.puppetlabs.com/issues/22855#change-99987

@cbarbour
Copy link

Its still an issue with PE 3.2.

@timidri
Copy link

timidri commented Apr 1, 2015

I am having this exact problem with PE 3.2.3, not sure why this is closed?

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

No branches or pull requests

5 participants