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

Vagrant push with Atlas strategy not working #4968

Closed
kramos opened this issue Dec 14, 2014 · 29 comments
Closed

Vagrant push with Atlas strategy not working #4968

kramos opened this issue Dec 14, 2014 · 29 comments

Comments

@kramos
Copy link

@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
Copy link
Contributor

@sethvargo sethvargo commented Dec 14, 2014

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

@kramos
Copy link
Author

@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
Copy link
Contributor

@sethvargo sethvargo commented Dec 15, 2014

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

@glongman
Copy link

@glongman glongman commented Dec 15, 2014

on OSX 10.10 here and I have the same problem

@sethvargo
Copy link
Contributor

@sethvargo sethvargo commented Dec 15, 2014

Hi @glongman,

What version of Vagrant? How did you install Vagrant?

@glongman
Copy link

@glongman glongman commented Dec 15, 2014

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

installed today via dmg from vagrantup

@sethvargo
Copy link
Contributor

@sethvargo sethvargo commented Dec 15, 2014

@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
Copy link

@glongman glongman commented Dec 15, 2014

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
Copy link

@glongman glongman commented Dec 15, 2014

exists and has content

@sethvargo
Copy link
Contributor

@sethvargo sethvargo commented Dec 15, 2014

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

@glongman
Copy link

@glongman glongman commented Dec 15, 2014

yes I see a match there.

@sethvargo
Copy link
Contributor

@sethvargo sethvargo commented Dec 15, 2014

@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
Copy link

@glongman glongman commented Dec 15, 2014

captured and sent!

@sethvargo
Copy link
Contributor

@sethvargo sethvargo commented Dec 15, 2014

Awesome, thanks!

@ml
Copy link

@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
Copy link

@david-sackmary david-sackmary commented Jan 6, 2015

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
Copy link

@pires pires commented Jan 9, 2015

Same thing on MacOS 10.10.

@sethvargo
Copy link
Contributor

@sethvargo sethvargo commented Jan 9, 2015

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
Copy link

@pires pires commented Jan 9, 2015

I can confirm this fixes it.

@david-sackmary
Copy link

@david-sackmary david-sackmary commented Jan 10, 2015

I also confirm this fixes it.

@ml
Copy link

@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
Copy link
Contributor

@sethvargo sethvargo commented Jan 10, 2015

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

@hyperfocus1338
Copy link

@hyperfocus1338 hyperfocus1338 commented Jan 17, 2015

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
Copy link
Contributor

@sethvargo sethvargo commented Jan 17, 2015

@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
Copy link

@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
Copy link
Contributor

@gokhansengun gokhansengun commented Nov 21, 2016

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

OS: macOS Sierra 10.12.1 (16B2555)
Vagrant 1.8.7

@johnypony3
Copy link

@johnypony3 johnypony3 commented Dec 7, 2016

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
Copy link
Contributor

@mcandre mcandre commented Dec 12, 2016

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?

@ghost
Copy link

@ghost ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days . This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet