canonical / charmcraft

Collaborate, build and publish charmed operators for Kubernetes, Linux and Windows.
Apache License 2.0
65 stars 69 forks source link

Charm deployment to OSM fails #529

Closed fotisolgr closed 3 years ago

fotisolgr commented 3 years ago

Hello,

I am trying to deploy the powerDNS CNF to OSM and fails by giving me the following error:

error":"cannot upload charm: cannot read charm archive: invalid charm archive: ambiguous root directory","error-code":"bad request.

I am using charmcraft version 1.2.1 and I was able to deploy the same charm in charmcraft version 1.1.1 .

The bundle.yaml I am using is the following one:

description: PowerDNS Bundle
bundle: kubernetes
series: kubernetes
applications:
  powerdns:
    charm: ./charms/powerdns-operator
    scale: 1
  mariadb-k8s:
    charm: cs:~charmed-osm/mariadb-k8s
    scale: 1
    options:
      user: youruser
      password: yourpass
      database: yourdatabase
      root_password: yourootpassword
      mysql_port: "3306"

relations:
- - mariadb-k8s:mysql
  - powerdns:db

And the metadata.yaml is the following one:

description: |
  Kubernetes operator for PowerDNS
summary: |
  PowerDNS is a DNS server program, written in C++ and licensed under the GPL.
  It runs on most Unix derivatives. PowerDNS features a large number of different
  backends ranging from simple BIND style zonefiles to relational databases and
  load balancing/failover algorithms.

series:
  - kubernetes

deployment:
  type: stateless
  service: loadbalancer

requires:
  db:
    interface: mysql
    limit: 1

Any ideas on how to fix that issue would be appreciated.

Thanks in advance, Fotis

facundobatista commented 3 years ago

Hello!

Would you please provide the whole logs of the charmcraft execution? You can see them when executing with --verbose or in the file mentioned in the error at the end.

Thanks!

fotisolgr commented 3 years ago

When I'm running charmcraft build --verbose I get the output located here: charmcraft-powerDNS-logs.txt

The build seems to be successful but when I am trying to deploy the charm I get the aforementioned error.

facundobatista commented 3 years ago

How are you trying to deploy the charm? Which exact command are you running? Thanks!

fotisolgr commented 3 years ago

I am running the following commands to deploy the charm:

osm nfpkg-create ./powerdns_cnf
osm nspkg-create ./powerdns_cnf_ns/
osm ns-create \
  --ns_name powerdns-cnf-ns \
  --nsd_name powerdns_cnf_ns \
  --vim_account "${VIM}" \
  --config '{vld: [ {name: mgmtnet, vim-network-name: external} ] }'

and when I am trying to get the status of the NS by running osm ns-list I get the aforementioned error.

facundobatista commented 3 years ago

Hey @fotisolgr . It looks there's an issue while deployment.

You may try to deploy directly with juju, to understand if it's an issue with the osm tool or a bigger problem. Probably you should ask for help about this in the forum, as this is not specifically charmcraft related (closing this issue for that reason).

Thanks!

fotisolgr commented 3 years ago

The problem was that I was not using the exact generated .charm file. So, when I changed charm: ./charms/powerdns-operator to charm: ./charms/powerdns-operator/powerdns.charm in bundle.yaml the deployment was successfully completed.