Apt-cacher-ng cacher qube creating errors

Thanks for the response @dal.

I couldn’t trace this, it’s probably in the shell script. Even if i find it, I don’t know how would I “fix” it.

OK. Let’s try the next one. i have debian-11-minimal installed. Yet

local:
---------- ID: debian-11-minimal
Function: pkg.installed
Name: qubes-template-debian-11-minimal
Result: False (???)
Comment: Error occurred installing package(s). Additional info follows:

          errors:
Summary
              - Running scope as unit: run-rd2994f7ab33d429585ff20cdee6bfc94.scope
                Redirecting to 'qvm-template install -y --best --allowerasing --disablerepo=* --enablerepo=qubes-templates-itl debian-11-minimal'
                usage: qvm-template [--verbose] [--quiet] [--help] [--repo-files REPO_FILES]
                                    [--keyring KEYRING] [--updatevm UPDATEVM]
                                    [--enablerepo REPOID] [--disablerepo REPOID]
                                    [--repoid REPOS] [--releasever RELEASEVER] [--refresh]
                                    [--cachedir CACHEDIR] [--keep-cache] [--yes]
                                    {install,reinstall,downgrade,upgrade,download,list,info,search,remove,purge,clean,repolist}

qvm-template: error: unrecognized arguments: -y --best --allowerasing (???)
Started: 15:26:02.012097
Duration: 16833.202 ms
Changes:

Any idea?

enmus via Qubes OS Forum qubes_os@forum.qubes-os.org writes:

OK. Let’s try the next one. i have debian-11-minimal installed. Yet
[…]
Any idea?

What is the command you used ? What are exactly the .sls file targeted ?

As stated above. I’m using

$ sudo qubesctl state.apply cacher.create

and .sls from

shaker/cacher at main · unman/shaker · GitHub,

as well as template-debian-10(or)11-minimal.sls in /srv/salt from

I tried all possible combinations as well, having/not having debian-10(or)11-minimal installed but the command just don’t want to download debian-10(or)11-minimal.

Not only that template will not be skipped or downloaded, also nothing can be cloned by clone.sls

So, the error #3 is

Summary
      ID: qvm-clone-id
Function: qvm.clone
    Name: template-cacher
  Result: False
 `Comment: One or more requisite failed: template-debian-11-minimal.template-debian-11-minima`l
 Started: 13:14:46.871614
Duration: 0.009 ms
 Changes:   

I tried all possible combinations as well, having/not having
debian-10(or)11-minimal installed but the command just don’t want to
download debian-10(or)11-minimal.

If the template is installed with the correct name, Salt must recognize
it with qvm.present and not try to install it since it is already.

`Comment: One or more requisite failed:

template-debian-11-minimal.template-debian-11-minima`l

What happen if you try :

$ sudo qubesctl state.apply template-debian-11-minimal.template-debian-11-minimal

By the way the original include from the cacher repository is :

include:

  • template-debian-10-minimal

So in this use case the salt recipe is a top level of the directory, if
you ask template-debian-11-minimal.template-debian-11-minimal, that is
template-debian-11-minimal.sls in the directory template-debian-11-minimal.

It should, but it doesn’t for some reason and I’m trying to figure it out. Thanks for the ideas, though.

I tried, but it complains there’s no such thing in env base, of course?

Yes, as I stated above I tried with both debian-10 and debian-11 minimals. but nothing helps.

Can @unman help maybe?

enmus via Qubes OS Forum qubes_os@forum.qubes-os.org writes:

I tried, but it complains there’s no such thing in env base, of course?

Not good. Your previous log asked for
template-debian-11-minimal.template-debian-11-minimal; so why you
cannot launch it ?

Yes, as I stated above I tried with both debian-10 and debian-11 minimals. but nothing helps.

I am not sure if its relevant but I am trying to make you reduce the
issue to its essentials.

Your salt files must include a ‘template-debian-11-minimal’ recipe. It’s
a state file like others, so you must be able to launch it directly.

I understand and appreciate it. Thanks.

Because there isn’t such file? Shouldn’t that be template-debian-11-minimal.sls instead?

They do?

As I said, even when using provided files without any modification, template-debian-10-minimal.template-debian-10-minimal error is produced,

Are there any typos in those original .sls’?

enmus via Qubes OS Forum qubes_os@forum.qubes-os.org writes:

They do?

And do you have that template-debian-11-minimal on disk ?

So find out :

  1. how to call it directly.
  2. how to include it in your other files.

As I said, even when using provided files without any modification,
template-debian-10-minimal.template-debian-10-minimal error is produced,

Are there any typos in those original .sls’?

No. But as stated previously, the original files call include on
template-debian-10-minimal, it is not shipped with the repository.

So it is error prone and your following error seems to be about that :

 `Comment: One or more requisite failed:

template-debian-11-minimal.template-debian-11-minimal`

Thanks for your efforts dal, but I can’t follow you. It is trivial to manually download any debian template and to clone it to whatever name, and to put that name in other formulas to proper place, which I actually did, and then all other formulas work. My cacher qube was already set 10 days ago and is working flawlessly both with debian and fedora qubes.

I just wanted to discover what is wrong with first two formulas so other users having the same issue could benefit from it. Obviously they won’t, from me at least.

There are also some inconsistencies in unman’s two guides, with bind dirs, for example (they do not match here and here), and I thought something more must’ve been missing with template-debian-10-minimal.sls and clone.sls, but couldn’t seem to figure out what it was.

50_user.conf

shaker/cacher/ 50_user.conf

Latest commit b2f1e71 on Feb 2, 2021

2 lines (2 sloc) 74 Bytes

binds+=( ‘/var/cache/apt-cacher-ng’ )

binds+=( ‘/var/log/apt-cacher-ng’ )

notes/blob/master/apt-cacher-ng

notes/ apt-cacher-ng

Latest commit f1cb90a on Dec 16, 2018

In caching qube, use bind-dirs:

binds+=( ‘/var/cache/apt-cacher-ng’ )

binds+=( ‘/var/log/apt-cacher-ng’ )

binds+=( ‘/etc/apt-cacher-ng’)

This is all I found in journalctl -f

dom0 qubesd[3121]: permission denied for call b’admin.vm.Create.AppVM’+b’template-cacher’ (b’dom0’ → b’dom0’) with payload of 24 bytes

Couldn’t find anything useful on admin.vm.Create.AppVM other than

Hello @enmus.
Did you manage to get the cacher to work?

I’m having similar issues with qubesctl state.apply cacher.create but my error is:

local:
Data failed to compile:
------------
Specified SLS template-debian-11-minimal in saltenv base is not available on the salt master or through a configured fileserver

Unsure on how to proceed

I did, but as I said, I had to manually download/install debian-xx-template and to create clone of it. After that, the rest of the salt formula works.
You have to be more detailed in order to get help.

Because, for example, I don’t know if you read the topic carefully and if you created that sls file according to a link I posted above

In 4.1, templates are not installed via dnf, but using the qvm-template
tool. There is a specific salt state to deal with them.
This means that instead of pkg.installed, you use qvm.template_installed

In /srv/salt, create a file named template-debian-11-minimal.sls:

debian-11-minimal:
  qvm.template_installed

The point is to install the template if it is not already
installed - otherwise, the clone operation will fail.
If you examine the clone.sls file you will see that it includes
another state, and that the clone operation requires that state.

If you know that you already have a debian-11-minimal template, then you
can remove this check, by deleting the section that starts “include:”,
and the two lines “require”.

1 Like

Wow! Twenty one posts to discover this. I’m wondering how we should know that, when even search via docs site doesn’t return any result on the ducduckgo page for a phrase qvm.template_installed on all of the three resources (forum, docs and dev)

No, really, where is this documented? I’m trying to learn salt, but it looks it won’t be easy to salt the Qubes?