Deploy local charm on lxd give ERROR POST Forbidden


#1

I’ve built a slurm charm locally without problem and now I’m trying to deploy it on my local LXD controller.

erik@rd0059260:~/juju/juju-slurm-buildrepo$ juju deploy ./layer-slurm-controller/build/builds/slurm-controller --debug
13:51:32 INFO  juju.cmd supercommand.go:56 running juju [2.4.7 gc go1.10.4]
13:51:32 DEBUG juju.cmd supercommand.go:57   args: []string{"/snap/juju/6012/bin/juju", "deploy", "./layer-slurm-controller/build/builds/slurm-controller", "--debug"}
13:51:32 INFO  juju.juju api.go:67 connecting to API addresses: [10.191.230.169:17070]
13:51:32 DEBUG juju.api apiclient.go:883 successfully dialed "wss://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/api"
13:51:32 INFO  juju.api apiclient.go:603 connection established to "wss://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/api"
13:51:32 DEBUG juju.cmd.juju.application deploy.go:1071 cannot interpret as local bundle: read ./layer-slurm-controller/build/builds/slurm-controller: is a directory
13:51:32 INFO  juju.cmd.juju.application series_selector.go:72 with the configured model default series "bionic"
13:51:32 DEBUG juju.charm charmdir.go:348 charm is not in revision control directory
13:51:32 DEBUG httpbakery client.go:243 client do POST https://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/charms?revision=0&schema=local&series=bionic {
13:51:32 DEBUG httpbakery client.go:245 } -> error [{/build/juju/parts/juju/go/src/gopkg.in/macaroon-bakery.v2-unstable/httpbakery/client.go:273: } {Post https://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/charms?revision=0&schema=local&series=bionic: Forbidden}]
13:51:32 DEBUG juju.api monitor.go:35 RPC connection died
ERROR POST https://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/charms?revision=0&schema=local&series=bionic: Post https://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/charms?revision=0&schema=local&series=bionic: Forbidden
13:51:32 DEBUG cmd supercommand.go:459 error stack: 
Post https://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/charms?revision=0&schema=local&series=bionic: Forbidden
gopkg.in/macaroon-bakery.v2-unstable/httpbakery/client.go:273: 
github.com/juju/httprequest/client.go:193: POST https://10.191.230.169:17070/model/ba2d4fff-8a08-471b-8fed-2264b958e136/charms?revision=0&schema=local&series=bionic
github.com/juju/juju/api/client.go:576: 
github.com/juju/juju/api/client.go:394: 
github.com/juju/juju/api/client.go:348: 
github.com/juju/juju/cmd/juju/application/deploy.go:1182: 

Deploying charms from charmstore works good.

erik@rd0059260:~/juju/juju-slurm-buildrepo$ juju deploy ubuntu
Located charm "cs:ubuntu-12".
Deploying charm "cs:ubuntu-12".

As you can see below.

erik@rd0059260:~/juju/juju-slurm-buildrepo$ juju status
Model    Controller           Cloud/Region         Version  SLA          Timestamp
default  localhost-localhost  localhost/localhost  2.4.7    unsupported  13:58:16+01:00

App     Version  Status  Scale  Charm   Store       Rev  OS      Notes
ubuntu  18.04    active      1  ubuntu  jujucharms   12  ubuntu  

Unit       Workload  Agent  Machine  Public address  Ports  Message
ubuntu/0*  active    idle   0        10.191.230.103         ready

Machine  State    DNS             Inst id        Series  AZ  Message
0        started  10.191.230.103  juju-58e136-0  bionic      Running

I’m not sure where to look for a resolution for this really. Anyone with experience in what goes in here that can help?

This is the software running:

erik@rd0059260:~/juju/juju-slurm-buildrepo$ snap list
Name               Version               Rev   Tracking  Publisher     Notes
charm              2.4.5+git-1-gd62c072  298   stable    johnsca       classic
core               16-2.36.2             6034  stable    canonical✓    core
core18             18                    512   stable    canonical✓    base
gimp               2.10.8                94    stable    snapcrafters  -
gtk-common-themes  0.1-4-g88bc1b2        818   stable    canonical✓    -
juju               2.4.7                 6012  stable    canonical✓    classic
lxd                3.8                   9795  stable    canonical✓    -
sublime-text       3176                  38    stable    snapcrafters  classic

#2

RESOLVED

This error is due to our corporate PROXY that intercepts the traffic from my client to the local addresses of my lxd.

I resolved this by:

export NO_PROXY=<ip.of.controller.api.endpoint>

Everything kicks in as it should.

Worth mentioning that the bootstrap config.yaml looks like this for my proxy environment.

erik@rd0059260:~$ cat config.yaml 
http-proxy: http://corporate.proxy.com:8080
https-proxy: http://corporate.proxy.com:8080
no-proxy: 127.0.0.1,localhost,10.0.0.0/8

Then bootstraped like this.

juju bootstrap localhost --config=config.yaml


#3

Yay, glad you figured it out because I had nooooo clue looking at the original post lol.


#4

I totally understand that. The proxy challenges within the JUJU domain are significant and the amount of proxy scenarios out there are equally large.

We’ve been fighting proxy since day 0 here.