Vagrant push with Atlas strategy not working #4968

Closed
kramos opened this Issue Dec 14, 2014 · 28 comments

Projects

None yet
@kramos
kramos commented Dec 14, 2014

Working on Windows 7 Enterprise. Looking to try Atlas but getting:

$ vagrant push
error starting upload: upload: resource not found
$ cat Vagrantfile
Vagrant.configure(2) do |config|
   config.vm.box = "ubuntu/trusty64"

   config.push.define "atlas" do |push|
     push.app = "Markosrendell/atlas_test1"
   end
end
$ ls -a
.  ..  .git  .vagrant  Vagrantfile  Vagrantfile~
$ vagrant -v
Vagrant 1.7.1

I'm probably doing something stupid, but I thought it might be worth raising and getting the solution added to the wiki,

@sethvargo
Collaborator

Hi @kramos I am sorry you're having issues with Vagrant push. Have you authenticated with Atlas via vagrant login?

@mitchellh mitchellh added bug waitingreply core and removed bug labels Dec 14, 2014
@kramos
kramos commented Dec 15, 2014

Hi @sethvargo thanks for the suggestion. Unfortunately this doesn't seem to help:

$ vagrant login -c
You are already logged in.

$ vagrant push
error starting upload: upload: resource not found

I had a grep in source code and since I noticed push.rb in the plugins folder, I tried:

$ vagrant plugin list
vagrant-share (1.1.4, system)

$ vagrant plugin update
Updating installed plugins...
All plugins are up to date.

So no luck there.

Just realised you can "vagrant up" on the vagrant source code #dogfood :)

@sethvargo
Collaborator

@kramos this is probably a Windows bug /cc @mitchellh 😦

@glongman

on OSX 10.10 here and I have the same problem

@sethvargo
Collaborator

Hi @glongman,

What version of Vagrant? How did you install Vagrant?

@glongman
14:25 ~/Projects/atlas_example/getting-started/app (master)$ vagrant --version
Vagrant 1.7.1

installed today via dmg from vagrantup

@sethvargo
Collaborator

@glongman can you show the output of:

env | grep -i atlas

As well as confirm the file ~/.vagrant.d/data/vagrant_login_token exists on disk and has content (please do not post the content here - it's an access token).

@glongman
14:27 ~/Projects/atlas_example/getting-started/app (master)$ env | grep -i atlas
OLDPWD=/Users/glongman/Projects/atlas_example
PWD=/Users/glongman/Projects/atlas_example/getting-started/app

~/.vagrant.d/data/vagrant_login_token

@glongman

exists and has content

@sethvargo
Collaborator

@glongman can you confirm that the contents of that file correspond to a token listed on https://atlas.hashicorp.com/settings/tokens

@glongman

yes I see a match there.

@sethvargo
Collaborator

@glongman okay. To prevent accidentally leaking access tokens, can you please run Vagrant in debug mode and Gist the output to a private gist and email it to me (support@hashicorp.com).

@glongman

captured and sent!

@sethvargo
Collaborator

Awesome, thanks!

@ml
ml commented Dec 24, 2014

Same here, my token from cat ~/.vagrant.d/data/vagrant_login_token matches one from https://atlas.hashicorp.com/settings/tokens but I still can't push - keep getting $ vagrant push error starting upload: upload: resource not found.

I'm sending vagrant --debug push output to support@hashicorp.com.

@david-sackmary

I have the same error (and tokens match and all else above). I'm running a Centos6.5 VM :
centos$ vagrant push
error starting upload: upload: resource not found

@pires
pires commented Jan 9, 2015

Same thing on MacOS 10.10.

@sethvargo
Collaborator

Hi there,

We have isolated and fixed the root cause of this bug on master. To get around this problem (until the next release of Vagrant), add the following to your shellrc file:

export ATLAS_TOKEN=`cat ~/.vagrant.d/data/vagrant_login_token`

Or set that environment variable to a valid access token created via the Atlas Web UI.

@sethvargo sethvargo closed this Jan 9, 2015
@pires
pires commented Jan 9, 2015

I can confirm this fixes it.

@david-sackmary

I also confirm this fixes it.

@ml
ml commented Jan 10, 2015

The fix works for me too, but it'd be nice to mention this in vagrant docs or display an error message from vagrant push saying that ATLAS_TOKEN is not defined.

@sethvargo
Collaborator

@ml we have fixed this on master correctly, so it will be automatic in the next release

@hyperfocus1337

I have added this to my .profile in my user directory on Mac OSX 10.10 and it fixes the issue. Remove it after updating Vagrant to the latest version? Will it cause any trouble?

@sethvargo
Collaborator

@hyperfocus1337 yea - this has been fixed in master and will be released with the next version of Vagrant. However, other Atlas products obey the ATLAS_TOKEN environment variable, so there is no harm having it set (like Packer and Terraform).

@dolanor
dolanor commented Feb 4, 2016

I had this bug just today, and using the ATLAS_TOKEN fixed the upload.

OS: ubuntu 14.04
vagrant: 1.8.1

@gokhansengun

Must be a regression here. Same issue and same workaround solves it.

OS: macOS Sierra 10.12.1 (16B2555)
Vagrant 1.8.7

@johnypony3

for me it was that the organization was not created in atlas.
i.e.: {{org}}/{{artifact}}
{{org}} has to be setup, by default only the username is setup.

@mcandre
mcandre commented Dec 12, 2016 edited

Can vagrant login be updated to integrate better with vagrant push? These seem to have grown apart, especially with the de facto Atlas push strategy.

Out of the box, vagrant login && vagrant push fails due to:

  • No longer informing the push with the traditional ~/.vagrant.d/data/vagrant_login_token credentials file.
  • Implicitly requiring that an ATLAS_TOKEN environment variable be set.

As a workaround, users have suggested configuring shell snippets like:

export ATLAS_TOKEN="$(cat "$HOME/.vagrant.d/data/vagrant_login_token")"

Though vagrant push then complains of a conflict between ~/.vagrant.d/data/vagrant_login_token-defined and $ATLAS_TOKEN-defined credentials. This is particularly frustrating, as I'm not aware of a way of reliably and securely assigning $ATLAS_TOKEN without relying on vagrant login generating ~/.vagrant.d/data/vagrant_login_token.

Could we please fix the toolset so that login and push work better together?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment