Page MenuHomePhabricator

Hashicorp broke downloading base images (boxes) using Vagrant < v1.9.6
Closed, ResolvedPublic

Description

See upstream bug: https://github.com/hashicorp/vagrant/issues/9442

==> default: Checking if box 'debian/contrib-jessie64' is up to date...
==> default: There was a problem while downloading the metadata for your box
==> default: to check for updates. This is not an error, since it is usually due
==> default: to temporary network problems. This is just a warning. The problem
==> default: encountered was:
==> default:
==> default: The requested URL returned error: 404 Not Found
==> default:
==> default: If you want to check for box updates, verify your network connection
==> default: is valid and try again.

This is pretty crappy. :/

Event Timeline

bd808 created this task.Feb 22 2018, 6:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 22 2018, 6:50 AM

Change 413303 had a related patch set uploaded (by BryanDavis; owner: Bryan Davis):
[mediawiki/vagrant@master] Update default box URL for older Vagrant installs

https://gerrit.wikimedia.org/r/413303

bd808 renamed this task from Hashicorp broke downloading base images (boxes) using Vagrant < 2.0.2 to Hashicorp broke downloading base images (boxes) using Vagrant < v1.9.6.Feb 22 2018, 7:04 AM
bd808 claimed this task.

Change 413303 merged by jenkins-bot:
[mediawiki/vagrant@master] Update default box URL for older Vagrant installs

https://gerrit.wikimedia.org/r/413303

bd808 triaged this task as High priority.Feb 22 2018, 5:38 PM

For existing users that doin't want to destroy the image to recreate it with the fix.

You can run the following

(For example on stretch do the following, it may be similar on jessie)

sed -i -- 's/atlas.hashicorp/vagrantcloud/g' /srv/vagrant-data/boxes/debian-VAGRANTSLASH-stretch64/metadata_url

Also i think vagrant fixed this in 1.9.6. Maybe we want to backport this release onto jessie-wikimedia?

bd808 closed this task as Resolved.Mar 9 2018, 4:30 PM
Tgr reopened this task as Open.May 16 2018, 3:18 PM
Tgr added a subscriber: Tgr.

Seems like this makes some versions of Vagrant even more broken than before, see the comments in https://gerrit.wikimedia.org/r/c/431751/

bearND added a subscriber: bearND.May 16 2018, 3:54 PM

Here's the output @Tgr asked me for, but I only get the error when his patch is checked out, not on master:

besi@besiair ~/de/wmf/vagrant (master)$ vagrant -v
Vagrant 2.0.4
besi@besiair ~/de/wmf/vagrant (master)$ git review -x 431751
Traceback (most recent call last):
  File "/usr/local/bin/git-review", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 1180, in main
    local_branch = fetch_review(options.changeidentifier, branch, remote)
  File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 886, in fetch_review
    parse_exc=ReviewInformationNotFound)
  File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 416, in query_reviews
    parse_exc=parse_exc)
  File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 434, in query_reviews_over_http
    request = run_http_exc(exception, url)
  File "/Library/Python/2.7/site-packages/git_review/cmd.py", line 175, in run_http_exc
    raise klazz(255, str(err), ('GET', url), env)
git_review.cmd.CannotQueryPatchSet: Cannot query patchset information
The following command failed with exit code 255
    "GET https://gerrit.wikimedia.org/changes/?q=431751&o=CURRENT_REVISION"
-----------------------
Cannot query patchset information
The following command failed with exit code 104
    "GET https://gerrit.wikimedia.org/changes/?q=431751&o=CURRENT_REVISION"
-----------------------
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /changes/ was not found on this server.</p>
</body></html>

-----------------------
-----------------------
besi@besiair ~/de/wmf/vagrant (master)$ git fetch ssh://bsitzmann@gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/51/431751/1 && git checkout FETCH_HEAD
From ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
 * branch              refs/changes/51/431751/1 -> FETCH_HEAD
Note: checking out 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 476cb8a8 Make it easier to run tests from Vagrant
besi@besiair ~/de/wmf/vagrant ()$ vagrant -v
Vagrant 2.0.4
besi@besiair ~/de/wmf/vagrant ()$ vagrant halt
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /Users/besi/de/wmf/vagrant/Vagrantfile
Line number: 53
Message: RuntimeError: can't modify frozen String

$ git log
* 2018-05-08 476cb8a8 (HEAD) Make it easier to run tests from Vagrant  [Gergő Tisza]
* 2018-03-03 9813808d updates for LXC on later versions of Fedora  [Ariel T. Glenn]
* 2018-02-13 307c91f4 fundraising role fixes:  [jgleeson]
*   2018-02-27 b0c82b49 Merge "Unbreak wikidata role"  [jenkins-bot]
|\  
| * 2018-02-26 f8d4d52d Unbreak wikidata role  [Gergő Tisza]
* | 2018-02-20 c08cd49d Create Vagrant roles for few extensions  [zoranzoki21]
* |   2018-02-26 cce26bb2 Merge "Vagrant role for JADE"  [jenkins-bot]
|\ \  
| |/  
|/|   
| * 2018-02-01 6cc06dac Vagrant role for JADE  [Adam Wight]
* | 2018-02-21 b9535ec8 Update default box URL for older Vagrant installs  [Bryan Davis]
Tgr added a comment.May 16 2018, 5:07 PM
besi@besiair ~/de/wmf/vagrant (master)$ git review -x 431751
The following command failed with exit code 255
    "GET https://gerrit.wikimedia.org/changes/?q=431751&o=CURRENT_REVISION"

That usually means a version mismatch between git-review and the gerrit server (as Gerrit changed the URL structure of their REST API recently).

besi@besiair ~/de/wmf/vagrant (master)$ git fetch ssh://bsitzmann@gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/51/431751/1 && git checkout FETCH_HEAD

If you want to simulate -x, try && git cherry-pick FETCH_HEAD instead.

bearND added a comment.EditedMay 16 2018, 5:45 PM

The cherry pick works but is essentially a no-op since the patch is already in the history of my git clone.
So, the result of the vagrant command is the same.

besi@besiair ~/de/wmf/vagrant ()$ git fetch ssh://bsitzmann@gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/51/431751/1 && git  cherry-pick FETCH_HEAD
From ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
 * branch              refs/changes/51/431751/1 -> FETCH_HEAD
HEAD detached at FETCH_HEAD
You are currently cherry-picking commit 476cb8a8.

nothing to commit, working tree clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'
besi@besiair ~/de/wmf/vagrant ()$ vagrant halt
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /Users/besi/de/wmf/vagrant/Vagrantfile
Line number: 53
Message: RuntimeError: can't modify frozen String

Line 53 of the Vagrantfile is:

Vagrant::DEFAULT_SERVER_URL.replace('https://vagrantcloud.com')
Tgr added a comment.May 16 2018, 6:00 PM

Yeah, apparently Vagrant freezes that URL since 2.0.2 (the cherry-pick thing was just an aside on the dangers of using checkout for testing vagrant patches). Since Vagrant 2 has fixed the server URL anyway, we probably need to do a version check before trying to change it.

bd808 added a subscriber: Reedy.May 16 2018, 8:44 PM

Yeah, apparently Vagrant freezes that URL since 2.0.2 (the cherry-pick thing was just an aside on the dangers of using checkout for testing vagrant patches). Since Vagrant 2 has fixed the server URL anyway, we probably need to do a version check before trying to change it.

I thought we fixed for the frozen string in rMWVAc60ce9a4256e: Make Vagrantfile work on >= 2.0.3 for T189867: Vagrant 2.0.3 errors. Is it broken in a new way now? The error message from T187978#4210654 looks to be the same one that @Reedy patched for.

Reedy added a comment.May 16 2018, 9:45 PM

Looks like we're fine after a rebase?

Yes, now the vagrant commands work again for me. :) Thank you!

Tgr closed this task as Resolved.May 17 2018, 7:53 AM