Custom catalog not showing templates

Hi,

Recently we have installed Rancher as a docker container. We’re using rancher/server:latest which I found today, it’s not stable version.
Configuration itself went smooth and we are able to manage containers from within the Rancher/Cattle UI.

Yesterday I tried to create custom catalog with the application we built. To deploy it, we are successfully using docker-compose.yml file.
I read a ton of guides and followed the instructions.
The difference from others is that I’m using local git repository instead of the one at GitHub to maintain catalog content.
The reason why I do this, is the copyrights policy in the company where I work.

Unfortunately what ever I would do, the custom catalog shows “There are no compatible templates.”
I started to debug this situation.
To exclude any docker-compose / rancher-compose issues, I just created empty files, as it was described on one blog.
The config.yml file is as follows :

name: test # Name of the Catalog Entry
description: |
test app # Description of the Catalog Entry
version: 1 # Version of the Catalog to be used
category: test # Category to be used for searching catalog entries
maintainer: mike # The maintainer of the catalog entry
license: Company # The license
projectURL: /private_catalog/templates/ # A URL related to the catalog entry

I’ve set the custom catalog at Cattle :

Name : Dev URL: /private_catalog/templates/.git Branch: master

I checked from the rancher/server container that I can successfully do “git clone” from the repository which is also on the same container. I read that changes are cloned into DATA directory which is not present on the container.
I created “DATA” directory at /var/lib/cattle/DATA and manually “git cloned” the repository which resulted in fetching advised folders structure. Also didn’t work out. Still “There are no compatible templates.” information at Catalog tab.
After this test I reverted the changes (deleted DATA directory).

However I noticed that there is “cache” directory. When I changed the content of local git repository and committed it, files at /var/lib/cattle/cache/global/31dc0f55293c998d0e770efa811d2612 where pulled/cloned successfully.

I reviewed the logs and didn’t see any relevant error.

Audit Logs → Response Object :

Logs from the container :

2017-05-23 11:54:59,927 INFO [:] [ecutorService-2] [i.c.p.core.cleanup.TableCleanup ] Skipped “cattle”.“environment” where id in [22, 23]
2017-05-23 11:54:59,948 INFO [:] [ecutorService-2] [i.c.p.core.cleanup.TableCleanup ] SQL [delete from account where account.id in (?, ?, ?)]; (conn:1055) Cannot delete or update a parent row: a foreign key constraint fails (cattle.audit_log, CONSTRAINT fk_audit_log__account_id FOREIGN KEY (account_id) REFERENCES account (id) ON DELETE NO ACTION ON UPDATE NO ACTION)
Query is: delete from account where account.id in (?, ?, ?), parameters [14,15,16]
2017-05-23 11:54:59,948 INFO [:] [ecutorService-2] [i.c.p.core.cleanup.TableCleanup ] Skipped “cattle”.“account” where id in [9, 17]
2017-05-23 11:54:59,949 INFO [:] [ecutorService-2] [i.c.p.core.cleanup.TableCleanup ] Cleanup other tables [cutoff=Sun May 21 11:54:59 UTC 2017]
2017-05-23 11:54:59,949 INFO [:] [ecutorService-2] [i.c.p.core.cleanup.TableCleanup ] [Rows Skipped] instance=32 service_index=11 image=32 agent=2 service=9 environment=2 account=2

Docker is installed on Red Hat Enterprise Linux Server release 7.3 (Maipo)
Docker engine version : 17.03.1-ce

CATTLE_RANCHER_CLI_VERSION=v0.6.0
DEFAULT_CATTLE_RANCHER_CLI_DARWIN_URL=https://releases.rancher.com/cli/v0.6.0/rancher-darwin-amd64-v0.6.0.tar.gz
CATTLE_CATTLE_VERSION=v0.179.7
DEFAULT_CATTLE_RANCHER_COMPOSE_WINDOWS_URL=https://releases.rancher.com/compose/v0.12.5/rancher-compose-windows-386-v0.12.5.zip
DEFAULT_CATTLE_API_UI_CSS_URL=/api-ui/ui.min.css
DEFAULT_CATTLE_RANCHER_CLI_WINDOWS_URL=https://releases.rancher.com/cli/v0.6.0/rancher-windows-386-v0.6.0.zip
DEFAULT_CATTLE_AUTH_SERVICE_EXECUTE=true
DEFAULT_CATTLE_RANCHER_COMPOSE_LINUX_URL=https://releases.rancher.com/compose/v0.12.5/rancher-compose-linux-amd64-v0.12.5.tar.gz
CATTLE_HOME=/var/lib/cattle
DEFAULT_CATTLE_RANCHER_CLI_LINUX_URL=https://releases.rancher.com/cli/v0.6.0/rancher-linux-amd64-v0.6.0.tar.gz
CATTLE_API_UI_URL=//releases.rancher.com/api-ui/1.0.8
CATTLE_RANCHER_SERVER_VERSION=v1.6.0
DEFAULT_CATTLE_API_UI_INDEX=//releases.rancher.com/ui/1.6.1
DEFAULT_CATTLE_SECRETS_API_EXECUTE=true
CATTLE_RANCHER_SERVER_IMAGE=rancher/server
CATTLE_HOST_API_PROXY_MODE=embedded
DEFAULT_CATTLE_CATALOG_URL={“catalogs”:{“community”:{“url”:“https://git.rancher.io/community-catalog.git",“branch”:“master”},“library”:{“url”:“https://git.rancher.io/rancher-catalog.git”,“branch”:"master”}}}
CATTLE_USE_LOCAL_ARTIFACTS=true
DEFAULT_CATTLE_WEBHOOK_SERVICE_EXECUTE=true
CATTLE_RANCHER_COMPOSE_VERSION=v0.12.5
DEFAULT_CATTLE_RANCHER_COMPOSE_DARWIN_URL=https://releases.rancher.com/compose/v0.12.5/rancher-compose-darwin-amd64-v0.12.5.tar.gz
DEFAULT_CATTLE_API_UI_JS_URL=/api-ui/ui.min.js
DEFAULT_CATTLE_CATALOG_EXECUTE=true
CATTLE_DB_CATTLE_DATABASE=mysql
DEFAULT_CATTLE_COMPOSE_EXECUTOR_EXECUTE=true
DEFAULT_CATTLE_MACHINE_EXECUTE=true

Does this situation is the result of unstable version ?
Any advice would be appreciated.

Cheers
M.J.

PS. I wanted to upload more screebshots but unfortunately as a new member I can attach only 1.

HI,

I found the reason why I couldn’t see a template.
Initially I was creating entry based on the document at http://rancher.com/rancher-catalog-templates-from-scratch-part-1/
Unfortunately either this post is old and changes have been made to rancher or author didn’t write important note.

It turned out that rancher-compose.yml file can not be empty.
In other words when I added the “.catalog” section I was able to see the icon and view details.
A scaffolding for this section is :

.catalog:
name: TestApp
version: 1.0.1
description: |
A test app scenario.

After adding this to rancher-compose.yml I’m able to add custom catalog entry either via GitHub or local git repo.