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

Packer 0.6.0 is broken when Rackspace (OpenStack) images are created #1142

Closed
nomadium opened this issue May 8, 2014 · 12 comments
Closed

Packer 0.6.0 is broken when Rackspace (OpenStack) images are created #1142

nomadium opened this issue May 8, 2014 · 12 comments

Comments

@nomadium
Copy link

nomadium commented May 8, 2014

Hi folks,

I was trying packer since I needed to create a custom image with Rackspace but I found out 0.6.0 is broken for me although 0.5.2 works OK.

This is the command I was using with 0.6.0:

packer build -var 'rackspace_username=foo' -var 'rackspace_password=bar' rackspace.json

This fails with these error messages:

openstack output will be in this color.

==> openstack: Creating temporary keypair for this instance...
==> openstack: Error launching source server: Expected HTTP response code [202] when accessing URL(https://cdn1.clouddrive.com/v1/MossoCloudFS_73439c97-0f85-41cf-9aa1-dfc24282ab65/servers); got 404 instead with the following body:
==> openstack: <html><h1>Not Found</h1><p>The resource could not be found.</p></html>
==> openstack: Deleting temporary keypair...
==> openstack: Error cleaning up keypair. Please delete the key manually: packer 536a248e-b753-bfce-e84d-fb2cb95dcd68
Build 'openstack' errored: Error launching source server: Expected HTTP response code [202] when accessing URL(https://cdn1.clouddrive.com/v1/MossoCloudFS_73439c97-0f85-41cf-9aa1-dfc24282ab65/servers); got 404 instead with the following body:
<html><h1>Not Found</h1><p>The resource could not be found.</p></html>

==> Some builds didn't complete successfully and had errors:
--> openstack: Error launching source server: Expected HTTP response code [202] when accessing URL(https://cdn1.clouddrive.com/v1/MossoCloudFS_73439c97-0f85-41cf-9aa1-dfc24282ab65/servers); got 404 instead with the following body:
<html><h1>Not Found</h1><p>The resource could not be found.</p></html>

==> Builds finished but no artifacts were created.

But it works OK and creates a working image with 0.5.2.

This is the template file that I'm using:

{
  "variables": {
    "rackspace_username": "",
    "rackspace_password": ""
  },
  "builders": [
    {
      "type": "openstack",
      "username": "{{user `rackspace_username`}}",
      "password": "{{user `rackspace_password`}}",
      "provider": "rackspace-us",
      "region": "DFW",
      "ssh_username": "root",
      "image_name": "Test image {{timestamp}}",
      "source_image": "5cc098a5-7286-4b96-b3a2-49f4c4f82537",
      "flavor": "2"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "sleep 30",
        "sudo apt-get update",
        "sudo apt-get upgrade -y"
      ]
    }
  ]
}
@darron
Copy link

darron commented May 9, 2014

Apparently it's actually a gophercloud issue. I reverted back to Packer 0.5.2 and it works great.

See this link #1134

@nomadium
Copy link
Author

Thanks for the info. I see #1134 closed since this is a bug on gophercloud but is not clear to me how to workaround this besides reverting back to 0.5.2.

Is there any ETA for a fix?

@sam-falvo
Copy link

@darron By process of elimination, it can't be a Gophercloud issue if it works great with Packer 0.5.2 and not with 0.6.0. I didn't change Gophercloud between these releases.

@mitchellh, if you can point me to the relevant code in Packer that is causing this problem, I'd like to see if there's something I can do to help alleviate the problem cited in this bug, or maybe offer an alternative approach that fixes the issue. I have one other bug reported against Gophercloud which references this bug, but I'm simply not able to reproduce the issue.

Thanks for any help you can give towards resolving this issue.

@sam-falvo
Copy link

Can anyone please confirm that the URL Gophercloud is being passed is or is not a CDN resource URL? It sure looks like it is by its structure.

@marcoemrich
Copy link

I can confirm this bug. I tried to build on a private OpenStack. Here is my config.
Just replaced some private data with xxx.
{
"builders": [
{
"type": "openstack",
"username": "admin",
"password": "xxx"
"provider": "xxx",
"region": "DFW",
"image_name": "Ubuntu 13.10 Cloud (amd64)",
"source_image": "xxx",
"flavor": "m1.medium_single_cpu"
}
]
}

And this is the crash.log: (maybe it helps)

2014/06/06 14:59:18 Packer Version: 0.6.0 12e28f2
2014/06/06 14:59:18 Packer Target OS/Arch: linux amd64
2014/06/06 14:59:18 Built with Go Version: go1.2
2014/06/06 14:59:18 Detected home directory from env var: /home/memrich
2014/06/06 14:59:18 Attempting to open config file: /home/memrich/.packerconfig
2014/06/06 14:59:18 File doesn't exist, but doesn't need to. Ignoring.
2014/06/06 14:59:18 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-instance:packer-builder-amazon-instance googlecompute:packer-builder-googlecompute virtualbox-ovf:packer-builder-virtualbox-ovf parallels-pvm:packer-builder-parallels-pvm digitalocean:packer-builder-digitalocean docker:packer-builder-docker virtualbox-iso:packer-builder-virtualbox-iso vmware-vmx:packer-builder-vmware-vmx null:packer-builder-null qemu:packer-builder-qemu amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot openstack:packer-builder-openstack vmware-iso:packer-builder-vmware-iso parallels-iso:packer-builder-parallels-iso] Commands:map[build:packer-command-build fix:packer-command-fix inspect:packer-command-inspect validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant vsphere:packer-post-processor-vsphere docker-push:packer-post-processor-docker-push docker-import:packer-post-processor-docker-import] Provisioners:map[ansible-local:packer-provisioner-ansible-local chef-client:packer-provisioner-chef-client chef-solo:packer-provisioner-chef-solo file:packer-provisioner-file puppet-masterless:packer-provisioner-puppet-masterless puppet-server:packer-provisioner-puppet-server shell:packer-provisioner-shell salt-masterless:packer-provisioner-salt-masterless]}
2014/06/06 14:59:18 Setting cache directory: /home/memrich/Projects/packer/packer_cache
2014/06/06 14:59:18 Environment.Cli: []string{"build", "sixsteps-openstack.json"}
2014/06/06 14:59:18 command + args: []string{"build", "sixsteps-openstack.json"}
2014/06/06 14:59:18 Loading command: build
2014/06/06 14:59:18 Creating plugin client for path: /home/memrich/bin/packer-command-build
2014/06/06 14:59:18 Starting plugin: /home/memrich/bin/packer-command-build []string{"/home/memrich/bin/packer-command-build"}
2014/06/06 14:59:18 Waiting for RPC address for: /home/memrich/bin/packer-command-build
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Plugin build against Packer '12e28f257f66299e3bb13a053bf06ccd236e7efd'
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Plugin minimum port: 10000
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Plugin maximum port: 25000
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Plugin address: unix /tmp/packer-plugin197785849
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Waiting for connection...
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Serving a plugin connection...
2014/06/06 14:59:18 Executing command: build
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Reading template: sixsteps-openstack.json
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Creating build: openstack
2014/06/06 14:59:18 Loading builder: openstack
2014/06/06 14:59:18 Creating plugin client for path: /home/memrich/bin/packer-builder-openstack
2014/06/06 14:59:18 Starting plugin: /home/memrich/bin/packer-builder-openstack []string{"/home/memrich/bin/packer-builder-openstack"}
2014/06/06 14:59:18 Waiting for RPC address for: /home/memrich/bin/packer-builder-openstack
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Plugin build against Packer '12e28f257f66299e3bb13a053bf06ccd236e7efd'
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Plugin minimum port: 10000
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Plugin maximum port: 25000
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Plugin address: unix /tmp/packer-plugin061360374
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Waiting for connection...
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Serving a plugin connection...
2014/06/06 14:59:18 ui: �[1;32mopenstack output will be in this color.�[0m
2014/06/06 14:59:18 ui:
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Build debug mode: false
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Force build: false
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Preparing build: openstack
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: 2014/06/06 14:59:18 Config: {PackerConfig:{PackerBuildName:openstack PackerBuilderType:openstack PackerDebug:false PackerForce:false PackerUserVars:map[]} AccessConfig:{Username:admin Password: ApiKey: Project: Provider:https://openstack.efa-dev.com RawRegion:DFW ProxyUrl: TenantId:} ImageConfig:{ImageName:Ubuntu 13.10 Cloud (amd64)} RunConfig:{SourceImage:7b39c645-ee6d-4708-8e3d-cb5bc966dd88 Flavor:m1.medium_single_cpu RawSSHTimeout:5m SSHUsername:root SSHPort:22 OpenstackProvider: UseFloatingIp:false FloatingIpPool: FloatingIp: SecurityGroups:[] sshTimeout:300000000000} tpl:0xc2100d6da0}
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Waiting on builds to complete...
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Starting build run: openstack
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Running builder: openstack
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: panic: runtime error: invalid memory address or nil pointer dereference
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: [signal 0xb code=0x1 addr=0x0 pc=0x44ff44]
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 24 [running]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: runtime.panic(0x78e9e0, 0xc6f2e8)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/runtime/panic.c:266 +0xb6
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/rackspace/gophercloud.(_Context).papersPlease(0xc210072c40, 0xc2100d59f0, 0x24, 0xc2100008f0, 0x5, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/rackspace/gophercloud/authenticate.go:157 +0x264
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/rackspace/gophercloud.(_Context).Authenticate(0xc210072c40, 0xc2100d59f0, 0x24, 0xc2100008f0, 0x5, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/rackspace/gophercloud/authenticate.go:181 +0xde
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/rackspace/gophercloud.Authenticate(0xc2100d59f0, 0x24, 0xc2100008f0, 0x5, 0xc2100d6e20, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/rackspace/gophercloud/global_context.go:49 +0x6b
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/builder/openstack.(_AccessConfig).Auth(0xc210098030, 0x410074, 0xc20fff02f0, 0x1000000, 0x100)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/builder/openstack/access_config.go:67 +0xb73
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/builder/openstack.(_Builder).Run(0xc210098000, 0x7f65f0ebf228, 0xc210072420, 0x7f65f0ebf270, 0xc2100de140, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/builder/openstack/builder.go:59 +0x4a
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.(_BuilderServer).Run(0xc210072f40, 0x1, 0xc2100c31e8, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/builder.go:93 +0x28b
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: reflect.Value.call(0x753f00, 0x7b2b50, 0x130, 0x809640, 0x4, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/reflect/value.go:474 +0xe0b
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: reflect.Value.Call(0x753f00, 0x7b2b50, 0x130, 0x7f65f0bb8ee8, 0x3, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/reflect/value.go:345 +0x9d
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/rpc.(_service).call(0xc210057a80, 0xc210057a40, 0xc2100c3008, 0xc210061b80, 0xc2100d62e0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/server.go:381 +0x159
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by net/rpc.(_Server).ServeCodec
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/server.go:452 +0x3bb
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 1 [semacquire]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: sync.runtime_Syncsemacquire(0xc2100701c0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/runtime/sema.goc:257 +0xca
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: sync.(_Cond).Wait(0xc2100701b0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/sync/cond.go:62 +0x89
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: io.(_pipe).read(0xc210070180, 0xc2100d4000, 0x1000, 0x1000, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/io/pipe.go:52 +0x245
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: io.(_PipeReader).Read(0xc210000480, 0xc2100d4000, 0x1000, 0x1000, 0x21, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/io/pipe.go:134 +0x5f
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.(_Stream).Read(0xc21004f5a0, 0xc2100d4000, 0x1000, 0x1000, 0x60e98f, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:549 +0x53
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: bufio.(_Reader).fill(0xc21004f120)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/bufio/bufio.go:91 +0x110
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: bufio.(_Reader).ReadByte(0xc21004f120, 0x7fffa136fb82, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/bufio/bufio.go:183 +0x7f
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_ioDecReader).readn1(0xc2100d5000, 0x16)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/decode.go:90 +0x37
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_msgpackDecDriver).initReadNext(0xc210072040)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/msgpack.go:540 +0x3e
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_Decoder).decode(0xc21004f2a0, 0x6c6e20, 0xc210072060)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/decode.go:635 +0x3b
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_Decoder).Decode(0xc21004f2a0, 0x6c6e20, 0xc210072060, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/decode.go:630 +0x69
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_rpcCodec).read(0xc210057740, 0x6c6e20, 0xc210072060, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/rpc.go:88 +0xcc
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_goRpcCodec).ReadRequestHeader(0xc210057740, 0xc210072060, 0xc74d20, 0x40aa00)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/rpc.go:127 +0x42
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/rpc.(_Server).readRequestHeader(0xc210057a40, 0x7f65f0ebece0, 0xc210057740, 0x0, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/server.go:551 +0x9b
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/rpc.(_Server).readRequest(0xc210057a40, 0x7f65f0ebece0, 0xc210057740, 0xc210061b80, 0xc2100d62e0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/server.go:518 +0xa0
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/rpc.(_Server).ServeCodec(0xc210057a40, 0x7f65f0ebece0, 0xc210057740)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/server.go:437 +0x66
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.(_Server).Serve(0xc210072f00)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/server.go:151 +0x1cf
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: main.main()
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/plugin/builder-openstack/main.go:14 +0xb1
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 3 [syscall]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: os/signal.loop()
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by os/signal.init·1
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/os/signal/signal_unix.go:27 +0x31
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 5 [chan receive]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/plugin.func·023()
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/plugin/server.go:95 +0x59
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by github.com/mitchellh/packer/packer/plugin.Server
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/plugin/server.go:99 +0xaf3
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 6 [select]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.(_MuxConn).cleaner(0xc2100777e0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:222 +0x3d8
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by github.com/mitchellh/packer/packer/rpc.NewMuxConn
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:71 +0xdd
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 7 [runnable]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: syscall.Syscall(0x0, 0x5, 0xc2101bd000, 0x4, 0x4, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/syscall/asm_linux_amd64.s:38 +0x64
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: syscall.read(0x5, 0xc2101bd000, 0x4, 0x8, 0x72, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/syscall/zsyscall_linux_amd64.go:838 +0x72
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: syscall.Read(0x5, 0xc2101bd000, 0x4, 0x8, 0x7670a0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/syscall/syscall_unix.go:135 +0x5c
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.(_netFD).Read(0xc210077690, 0xc2101bd000, 0x4, 0x8, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/fd_unix.go:200 +0x1eb
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.(_conn).Read(0xc210000468, 0xc2101bd000, 0x4, 0x8, 0x8, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/net.go:122 +0xc5
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: io.ReadAtLeast(0x7f65f0ebe8e8, 0xc210000468, 0xc2101bd000, 0x4, 0x8, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/io/io.go:288 +0xf6
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: io.ReadFull(0x7f65f0ebe8e8, 0xc210000468, 0xc2101bd000, 0x4, 0x8, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/io/io.go:306 +0x71
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: encoding/binary.Read(0x7f65f0ebe8e8, 0xc210000468, 0x7f65f0ebe910, 0xc210000468, 0x6cc520, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/encoding/binary/binary.go:146 +0x103
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.(_MuxConn).loop(0xc2100777e0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:274 +0x321
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by github.com/mitchellh/packer/packer/rpc.NewMuxConn
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:72 +0xf4
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 8 [chan receive]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.func·005()
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:508 +0x64
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by github.com/mitchellh/packer/packer/rpc.newStream
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:525 +0x169
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 28 [IO wait]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.runtime_pollWait(0x7f65f0ebe6f0, 0x72, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/runtime/netpoll.goc:116 +0x6a
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.(_pollDesc).Wait(0xc21004e5a0, 0x72, 0x7f65f0ebcf88, 0xb)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.(_pollDesc).WaitRead(0xc21004e5a0, 0xb, 0x7f65f0ebcf88)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.(_netFD).Read(0xc21004e540, 0xc21010d000, 0x400, 0x400, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/fd_unix.go:204 +0x2a0
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net.(_conn).Read(0xc210000b38, 0xc21010d000, 0x400, 0x400, 0xc74940, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/net.go:122 +0xc5
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: crypto/tls.(_block).readFromUntil(0xc2100dc7b0, 0x7f65f0ebf790, 0xc210000b38, 0x5, 0xc210000b38, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/crypto/tls/conn.go:459 +0xb6
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: crypto/tls.(_Conn).readRecord(0xc21005b780, 0x17, 0x0, 0x8)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/crypto/tls/conn.go:539 +0x107
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: crypto/tls.(_Conn).Read(0xc21005b780, 0xc210235000, 0x1000, 0x1000, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/crypto/tls/conn.go:897 +0x135
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: bufio.(_Reader).fill(0xc21022ea20)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/bufio/bufio.go:91 +0x110
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: bufio.(_Reader).Peek(0xc21022ea20, 0x1, 0x0, 0x0, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/bufio/bufio.go:119 +0xcb
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/http.(_persistConn).readLoop(0xc210109080)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/http/transport.go:687 +0xb7
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by net/http.(_Transport).dialConn
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/http/transport.go:528 +0x607
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 29 [select]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/http.(_persistConn).writeLoop(0xc210109080)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/http/transport.go:791 +0x271
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by net/http.(_Transport).dialConn
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/http/transport.go:529 +0x61e
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 25 [chan receive]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.func·005()
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:508 +0x64
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by github.com/mitchellh/packer/packer/rpc.newStream
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:525 +0x169
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: goroutine 26 [semacquire]:
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: sync.runtime_Syncsemacquire(0xc2100c7100)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/runtime/sema.goc:257 +0xca
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: sync.(_Cond).Wait(0xc2100c70f0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/sync/cond.go:62 +0x89
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: io.(_pipe).read(0xc2100c70c0, 0xc210100000, 0x1000, 0x1000, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/io/pipe.go:52 +0x245
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: io.(_PipeReader).Read(0xc2100c31f8, 0xc210100000, 0x1000, 0x1000, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/io/pipe.go:134 +0x5f
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/mitchellh/packer/packer/rpc.(_Stream).Read(0xc2100fd000, 0xc210100000, 0x1000, 0x1000, 0x0, ...)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/mitchellh/packer/packer/rpc/muxconn.go:549 +0x53
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: bufio.(_Reader).fill(0xc2100fd060)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/bufio/bufio.go:91 +0x110
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: bufio.(_Reader).ReadByte(0xc2100fd060, 0x0, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/bufio/bufio.go:183 +0x7f
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_ioDecReader).readn1(0xc2100d5990, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/decode.go:90 +0x37
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_msgpackDecDriver).initReadNext(0xc210072360)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/msgpack.go:540 +0x3e
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_Decoder).decode(0xc2100fd0c0, 0x6c6e60, 0xc210066ae0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/decode.go:635 +0x3b
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_Decoder).Decode(0xc2100fd0c0, 0x6c6e60, 0xc210066ae0, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/decode.go:630 +0x69
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_rpcCodec).read(0xc2100e1100, 0x6c6e60, 0xc210066ae0, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/rpc.go:88 +0xcc
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: github.com/ugorji/go/codec.(_goRpcCodec).ReadResponseHeader(0xc2100e1100, 0xc210066ae0, 0x0, 0x0)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/code/go/src/github.com/ugorji/go/codec/rpc.go:123 +0x42
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: net/rpc.(*Client).input(0xc2100fd120)
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/client.go:107 +0xbf
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: created by net/rpc.NewClientWithCodec
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: /Users/mitchellh/go/src/pkg/net/rpc/client.go:199 +0x91
2014/06/06 14:59:18 [ERR] Error reading stream direction: read unix /tmp/packer-plugin061360374: connection reset by peer
2014/06/06 14:59:18 [INFO] Mux connection loop exiting
2014/06/06 14:59:18 /home/memrich/bin/packer-builder-openstack: plugin process exited
2014/06/06 14:59:18 ui error: �[1;31mBuild 'openstack' errored: unexpected EOF�[0m
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: 2014/06/06 14:59:18 Builds completed. Waiting on interrupt barrier...
2014/06/06 14:59:18 machine readable: error-count []string{"1"}
2014/06/06 14:59:18 ui error:
==> Some builds didn't complete successfully and had errors:
2014/06/06 14:59:18 machine readable: openstack,error []string{"unexpected EOF"}
2014/06/06 14:59:18 ui error: --> openstack: unexpected EOF
2014/06/06 14:59:18 ui:
==> Builds finished but no artifacts were created.
2014/06/06 14:59:18 waiting for all plugin processes to complete...
2014/06/06 14:59:18 [ERR] Error reading stream direction: EOF
2014/06/06 14:59:18 [INFO] Mux connection loop exiting
2014/06/06 14:59:18 /home/memrich/bin/packer-command-build: plugin process exited

@sam-falvo
Copy link

This still isn't a bug with Gophercloud though. Witness the following from the logs:

Provider:https://openstack.efa-dev.com RawRegion:DFW

The DFW region is a Rackspace region, and unless efa-dev.com licenses through Rackspace, it's not likely to have the same region names as Rackspace.

@marcoemrich
Copy link

Oh, I think I didn't understand region. What do I need to put there for a custom open stack setup?

@sam-falvo
Copy link

That will depend on how your installation of Nova is configured. The region is intended to identify a geographic region or specific data center. You may also use an empty string if region is not set, as Gophercloud will ignore the region if "", selecting the first matching entry based on other fields.

@benpriestman
Copy link

I've seen the same issue in 0.6.0.

Using the provider config from http://www.packer.io/docs/builders/openstack.html, modifying for the UK and passing in my own creds:

{
"type": "openstack",
"username": "{{user rs_user}}",
"password": "{{user rs_pass}}",
"provider": "rackspace-uk",
"region": "LON",
"ssh_username": "root",
"image_name": "Test image",
"source_image": "23b564c9-c3e6-49f9-bc68-86c7a9ab5018",
"flavor": "2"
}

Returns:

Debug mode enabled. Builds will not be parallelized.
openstack output will be in this color.

==> openstack: Creating temporary keypair for this instance...
openstack: Saving key for debug purposes: os_openstack.pem
==> openstack: Pausing after run of step 'StepKeyPair'. Press enter to continue.

==> openstack: Error launching source server: Expected HTTP response code [202] when accessing URL(https://lon.bigdata.api.rackspacecloud.com/v1.0/10014073/servers); got 404 instead with the following body:

Just starting with Packer, so might be on the wrong track, but https://lon.bigdata.api.rackspacecloud.com/v1.0 doesn't look right.

Reverting to 0.5.2 for now.

@avelis
Copy link

avelis commented Jul 15, 2014

Upon web searching , https://cdn1.clouddrive.com/v1/MossoCloudFS I discovered Rackspace link: https://community.rackspace.com/developers/f/7/t/522 which enlightened me with the following JSON.

{
    "access": {
        "serviceCatalog": [
            {
                "endpoints": [
                    {
                        "publicURL": "https://cdn2.clouddrive.com/v1/MossoCloudFS_<redacted>", 
                        "region": "ORD", 
                        "tenantId": "MossoCloudFS_<redacted>"
                    }, 
                    {
                        "publicURL": "https://cdn1.clouddrive.com/v1/MossoCloudFS_<redacted>", 
                        "region": "DFW", 
                        "tenantId": "MossoCloudFS_<redacted>"
                    }
                ], 
                "name": "cloudFilesCDN", 
                "type": "rax:object-cdn"
            }, 
            {
                "endpoints": [
                    {
                        "publicURL": "https://servers.api.rackspacecloud.com/v1.0/123456", 
                        "tenantId": "123456", 
                        "versionId": "1.0", 
                        "versionInfo": "https://servers.api.rackspacecloud.com/v1.0", 
                        "versionList": "https://servers.api.rackspacecloud.com/"
                    }
                ], 
                "name": "cloudServers", 
                "type": "compute"
            }, 
...
}

It would appear then that Packer is requesting for a service endpoint using gophercloud's service catalog api. However, without specifying more information packer seems to be picking the CDN url (mentioned above) simply because it is the first that appears in the list (this is a guess).

My suggestion is to find in source where packer is requesting a service endpoint to create an image and find out how it is specifying the the service endpoint type to gophercloud.

Linking related gophercloud github issue: rackspace/gophercloud#162

@avelis
Copy link

avelis commented Jul 16, 2014

Upon taking queue's from @sam-falvo comment (rackspace/gophercloud#162 (comment)), I decided to look more into packer's source and found the following changeset: ee95fbb
Which eventually revealed to me that there are three settings that must be defined for this to work.

  1. type: openstack
  2. provider: rackspace-us or rackspace-uk
    and finally
  3. openstack_provider: rackspace

This is a sample of my packer.json file I used to make packer send the correct API criteria to gophercloud:

{
    "builders": [{
        "type": "openstack",
        "username": "<my_username>",
        "api_key": "<my_api_key>",
        "provider": "rackspace-us",
        "openstack_provider": "rackspace",
        "region": "<region_code>",
        "ssh_username": "root",
        "image_name": "<my_image_name>",
        "source_image": "<rackspace_server_image_id>",
        "flavor": "<rackspace_flavor_id>"
    }]
}

Note: Tested against packer v0.6.0 & gophercloud v0.1.0
Related gophercloud issue: rackspace/gophercloud#162

So, whats the resolution here? Well, both services work as expected when inputed with the correct configuration settings. However, Packer's documentation can probably use and update or two to better describe this specific requirement.

kanerogers pushed a commit to kanerogers/packer that referenced this issue Jul 18, 2014
As per hashicorp#1142, it's critical to add openstack_provider: rackspace in order to get anything to work reliably with Rackspace and Packer in 6.0.

Question: should the openstack_provider field now be marked as required?
@mitchellh
Copy link
Contributor

Fixing in response to #1347

mbrukman pushed a commit to mbrukman/packer that referenced this issue Jul 21, 2014
As per hashicorp#1142, it's critical to add openstack_provider: rackspace in order to get anything to work reliably with Rackspace and Packer in 6.0.

Question: should the openstack_provider field now be marked as required?
@hashicorp hashicorp locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants