Error "DContainer matching query does not exist."

Hi,

Im trying to build a nextcloud rock-on based on this docker container: https://hub.docker.com/r/wonderfall/nextcloud/ with mariadb. I wrote a nextcloud.json (see below) file and saved it in “/opt/rockstor/rockons-metastore/” directoy. When I hit “Update” in the rock-on web ui I get the follwing error. What is wrong with my json-file?

Errors occurred while processing updates for following Rock-ons. Nextcloud: DContainer matching query does not exist.

Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/storageadmin/views/rockon.py”, line 105, in post
self._create_update_meta(r, rockons[r])
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/utils/decorators.py”, line 145, in inner
return func(*args, **kwargs)
File “/opt/rockstor/src/rockstor/storageadmin/views/rockon.py”, line 319, in _create_update_meta
co = DContainer.objects.get(rockon=ro, name=cname)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/manager.py”, line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File “/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/db/models/query.py”, line 334, in get
self.model._meta.object_name
DoesNotExist: DContainer matching query does not exist.

/opt/rockstor/rockons-metastore/nextcloud.json :

{
    "Nextcloud": {
        "container_links": {
            "owncloud": [
                {
                    "name": "db_nextcloud",
                    "source_container": "db_nextcloud"
                }
            ]
        },
        "containers": {
            "nextcloud": {
                "image": "wonderfall/nextcloud",
		        "tag": "latest",
                "launch_order": 2,
                "ports": {
                    "8888": {
                        "description": "OwnCloud WebUI port. Suggested default: 8888",
                        "host_default": 8888,
                        "label": "WebUI port",
                        "protocol": "tcp",
                        "ui": true
                    }
                },
                "volumes": {
                    "/config": {
                        "description": "Choose a Share for Nextcloud configuration (e.g. config.php).",
                        "label": "Config Storage",
                        "min_size": 1073741824
                    },
                    "/data": {
                        "description": "Choose a Share for Nextcloud data.",
                        "label": "Data Storage",
                        "min_size": 1073741824
                    },
                    "/apps2": {
                        "description": "Choose a Share for Nextcloud downloaded apps",
                        "label": "App Storage",
                        "min_size": 1073741824
                    }
                },
                "environment":{
                    "TZ":{
                        "description":"the system/log timezone (default : Etc/UTC)",
                        "label":"Timezone"
                    },
                    "ADMIN_USER":{
                        "description":"username of the admin account (default : admin)",
                        "label":"Admin User"
                    },
                    "ADMIN_PASSWORD":{
                        "description":"password of the admin account (default : admin)",
                        "label":"Admin Password"
                    },
                    "DB_TYPE":{
                        "description":"must be set to 'mysql'",
                        "label":"Database Type"
                    },
                    "DB_NAME":{
                        "description":"must be the same as on db_nextcloud",
                        "label":"Name Of Database"
                    },
                    "DB_USER":{
                        "description":"must be the same as on db_nextcloud",
                        "label":"Name of Database User"
                    },
                    "DB_PASSWORD":{
                        "description":"must be the same as on db_nextcloud",
                        "label":"Database Password"
                    },
                    "DB_HOST":{
                        "description":"must be set to 'db_nextcloud'",
                        "label":"Database Host"
                    }
                }
            },
            "db_nextcloud": {
                "image": "mariadb",
		        "tag": "10",
                "launch_order": 1,
                "volumes": {
                    "/var/lib/mysql": {
                        "description": "Choose a Share for Nextclouds's mysql database.",
                        "label": "Database Storage",
                        "min_size": 1073741824
                    }
                },
                "environment":{
                    "MYSQL_ROOT_PASSWORD":{
                        "description":"User nextcloud database password",
                        "label":"Mysql Root Password"
                    },
                    "MYSQL_DATABASE":{
                        "description":"User nextcloud database name",
                        "label":"Mysql Database Name"
                    },
                    "MYSQL_PASSWORD":{
                        "description":"User nextcloud database password",
                        "label":"Mysql Password"
                    }
                }
            }
        },
        "version": "latest stable",
        "description": "Secure file sharing and hosting",
        "icon": "https://nextcloud.com/wp-content/themes/next/assets/img/common/nextcloud-square-logo.png",
        "more_info": "<p>More info...</p>",
        "ui": {
            "https": true,
            "slug": ""
        },
        "website": "https://nextcloud.com/"
    }
}

Thanks in advance!

I found the error: In the “container_links” section i tried to add a link for the owncloud container instead of the nextcloud container (copy paste). The error message could be better though.

@Tschaul Welcome to Rockstor. Well done on getting your Rock-on sorted.

Do you fancy submitting your working Rock-on to the Rockon-registry as a pull request. It would seem like a nice addition and we even have an open issue with 3 contributor’s comments already:

I plan to submit it once its running. Unfortunately i didn’t manage to get it running yet. Mostly because of permission problems. I decided to get my server operational with the owncloud-official rock-on first. I also need some other rock-ons that are not on the registry like tiny-tiny-rss and lychee. I will start with building these first because they seam easier. Then i will get back to the nextcloud rock-on when i understand more about docker and rock-ons :slight_smile:

1 Like

@Tschaul Turns out that the current version of Rockstor does not allow to use environment section on linked containers. Here is the modified version with hardcoded mysql info. I also forked the wonderfall/nextcloud to add SSL and Let’s Encrypt support.

1 Like