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

Install failing #9

Open
popzip opened this issue Aug 6, 2014 · 14 comments
Open

Install failing #9

popzip opened this issue Aug 6, 2014 · 14 comments

Comments

@popzip
Copy link

popzip commented Aug 6, 2014

It was previously working great for me - I have 5 versions of MarkLogic that I manage on my machine. Not sure if I did something different today but am not able to successfully install a new version:

I downloaded a new install file (.dmg)
mlvm install 8.0-20140806 ~/Downloads/MarkLogic-8.0-20140806-x86_64.dmg

Response:
Mounting dmg
Extracting contents
tar: Error opening archive: Failed to open '/Users/kalderet/GHstuff/mlvm/.mounts/140736206619611/*.pkg/Contents/Archive.pax.gz'
chmod: /Users/kalderet/GHstuff/mlvm/versions/8.0-20140806/StartupItems/MarkLogic/MarkLogic: No such file or directory
cleaning up

@withjam
Copy link
Owner

withjam commented Aug 6, 2014

The install step makes certain assumptions about the contents of the dmg.
It also assumes the mounting succeeded. It's possible the mounting didn't
work or the contents of the dmg have changed. I'll try to reproduce as well
but you may want to inspect the dmg contents to see if there is a pkg file
under Contents.
On Aug 6, 2014 5:59 PM, "Kasey Alderete" [email protected] wrote:

It was previously working great for me - I have 5 versions of MarkLogic
that I manage on my machine. Not sure if I did something different today
but am not able to successfully install a new version:

I downloaded a new install file (.dmg)
mlvm install 8.0-20140806 ~/Downloads/MarkLogic-8.0-20140806-x86_64.dmg

Response:
Mounting dmg
Extracting contents
tar: Error opening archive: Failed to open
'/Users/kalderet/GHstuff/mlvm/.mounts/140736206619611/*.pkg/Contents/Archive.pax.gz'
chmod:
/Users/kalderet/GHstuff/mlvm/versions/8.0-20140806/StartupItems/MarkLogic/MarkLogic:
No such file or directory
cleaning up


Reply to this email directly or view it on GitHub
#9.

@popzip
Copy link
Author

popzip commented Aug 6, 2014

Thanks. It looks like there is pkg file there same as before.

As a workaround can I install it manually and use the prepare command or is that only when you're first using mlvm?

@innovimax
Copy link

I run into this issue while playing around using "sudo" or not. It may simply be that the .mounts repository doesn't have the right permissions

@fernoftheandes
Copy link

I have sudo rights and I am having the same problem as @popzip...
@innovimax, could you share the changes you made to mlvm.sh to have this work? Thanks!

@innovimax
Copy link

I didn't change anything in mlvm.sh I redid my installation by avoiding extra "sudo" in command that were not meant to
Hop this helps

@withjam
Copy link
Owner

withjam commented Sep 18, 2014

I committed an update to mlvm.sh that removes the -quiet flag from the mount command. This should let you know if there was a problem mounting the dmg. I had an issue installing 7.0-4 that said the resource was busy (because I had mounted it manually to check the contents). Hopefully that can help you diagnose if it's a mount issue during installation.

@jmakeig
Copy link
Contributor

jmakeig commented Oct 16, 2014

I'm still having this issue with sudo or not. (Is install supposed to require sudo?)

I was able to decompose the steps successfully manually:

mkdir ./mount
hdiutil attach ~/Downloads/MarkLogic-8.0-20141016-x86_64.dmg -nobrowse -mountpoint ./mount

and

tar xfz ./mount/*.pkg/Contents/Archive.pax.gz -C ~/tmp/mlvm

I'm not sure what's different about the mlvm script, though. Perhaps a timing issue? Might hdiutil attach be (partly) asynchronous?

@jmakeig
Copy link
Contributor

jmakeig commented Oct 16, 2014

With -verbose on the attach command:

Mounting dmg
Initializing…
CBSDBackingStore::newProbe stat() failed.  No such file or directory.
DIBackingStoreInstantiatorProbe: interface  0, score        1, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface  1, score    -1000, CBundleBackingStore
DIBackingStoreInstantiatorProbe: interface  2, score    -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface  3, score    -1000, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: interface  4, score    -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface  5, score    -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: interface  6, score    -1000, CVectoredBackingStore
CBSDBackingStore::newProbe stat() failed.  No such file or directory.
DIBackingStoreInstantiatorProbe: interface  0, score        1, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface  1, score    -1000, CBundleBackingStore
DIBackingStoreInstantiatorProbe: interface  2, score    -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface  3, score    -1000, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: interface  4, score    -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface  5, score    -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: interface  6, score    -1000, CVectoredBackingStore
Attaching…
Error 2 (No such file or directory).
Finishing…
DIHLDiskImageAttach() returned 2
hdiutil: attach failed - No such file or directory

@jmakeig
Copy link
Contributor

jmakeig commented Oct 16, 2014

It is a timing issue. hdiutil uses an async helper process called diskimages-helper. The solution suggested here uses a loop with a timeout to make sure the thing is mounted before proceeding.

TIMEOUT=30
i=0
while [ "$(echo $MOUNTPOINT/*)" == "$MOUNTPOINT/*" ]; do
    if [ $i -gt $TIMEOUT ]; then
        echo "No files found, exiting"
        exit 1
    fi
    sleep 1
    i=$(expr $i + 1)
done

What a pain in the rear.

@jmakeig
Copy link
Contributor

jmakeig commented Oct 16, 2014

Something else is going on. Even with that change it's still failing with a directory not found when attaching to the mount point. I see the mount point directory and can attach the same .dmg to the same path manually from the command line. It doesn't seem to work from the script, though.

@jmakeig
Copy link
Contributor

jmakeig commented Oct 16, 2014

Building up the following script piece by piece everything works. In the end, it looks just like the mlvm version (modulo some variable names and hard-coded paths). I don't know what's going on that's special to mlvm.

#!/usr/bin/env bash

DMG="$1"
MOUNT=$(date +%s)$RANDOM
MOUNT=~/tmp/.mounts/"$MOUNT"
mkdir -p "$MOUNT"

ls -laGh "$MOUNT"

echo "Mounting $DMG to $MOUNT"

hdiutil attach "$DMG" -mountpoint "$MOUNT" -nobrowse -quiet

# <http://dxr.mozilla.org/mozilla-central/source/build/package/mac_osx/unpack-diskimage>
TIMEOUT=15
i=0
while [ "$(echo $MOUNT/*)" == "$MOUNT/*" ]; do
    if [ $i -gt $TIMEOUT ]; then
        echo "No files found, exiting"
        exit 1
    fi
    ls -la "$MOUNT"
    sleep 1
    i=$(expr $i + 1)
done

mkdir -p ~/tmp/ML
tar xfz "$MOUNT"/*.pkg/Contents/Archive.pax.gz -C ~/tmp/ML

@withjam withjam closed this as completed in 5e80ec1 Nov 6, 2014
@jmakeig
Copy link
Contributor

jmakeig commented Nov 6, 2014

I think the issue is the use of cd to find the versions directory changes the current working directory and thus how the relative path of the .dmg is resolved. Changing this will require deeper surgery because there’s lots that depends on the current working dir. See.

@popzip
Copy link
Author

popzip commented Sep 7, 2016

FYI I ended up here again and basically had a corrupt dmg. I think I interrupted extraction by accidentally clicking on the dmg after downloading then clicking stop or skip or cancel extraction. Re-downloaded and it worked smoothly.

@jmakeig
Copy link
Contributor

jmakeig commented Sep 7, 2016

Requirement for “resume download”?

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