LXC copy and lxc export/import results in "object not found" or "not found"

So, I’m trying to copy a container from one system to another. If I do an lxc copy remote:container container it results in a generic “object not found” message. If I do export/import I get a generic “not found”. However, in no case does it say what is not found, leaving me having no real idea what to do. Adding -v doesn’t actually make it any more verbose, and changes nothing.

How can I find out what is missing and thus what can be done about it?

Okay, so, I did solve this. It was the storage pool. It was listed as ABC when it should have been DEF in the default profile.

However, I’d suggest improving the error message if possible :slight_smile:

Haha, yeah, we have a Github issue to work on our error messages, especially not found which we definitely should be qualifying with what wasn’t found…

We are working towards improving this, for example this recent PR improved the error message when networks are not found from the generic “Not found” to “Network not found”.

We can follow this pattern in our DB queries to convert a raw DB ErrNoSuchObject and ErrNoRows error into a contextually relevant api.StatusError;

if err != nil {
    if errors.Is(err, sql.ErrNoRows) {
        return api.StatusErrorf(http.StatusNotFound, "Network not found")

Nice :slight_smile: Would it be possible for such errors to also say which thing was not found, in cases where there could be multiple things?

I’m sure it would be possible, it may be we wrap the error in the API handler rather than in the DB layer so we aren’t returning info from the DB layer in the error that was asked for by the API handler.

Would definitely be great :slight_smile: