Corteza-server auth assets export segmentation violation

I’m trying to setup an offline docker image to experiment with Personalization. I have docker running healthy but I get stuck when its time to setup Auth Dev Mode.

I’m not sure if I’m doing something wrong along the way or if there is an actual bug somewhere.

What happens: corteza-server auth assets export throws a segmentation violation runtime error.

What should happen (I think): Meaningful messages from error handling from the https://github.com/cortezaproject/corteza-server/tree/2021.9.x/auth/commands/assets.go file.

Steps to reproduce:

  1. Setup directory and files as shown in DevOps Guide.
    1a. (Following Personalization > Authentication documentation to setup Auth Mode makes no difference, as in, the same error pops up regardless.
  2. Run “Docker-Compose up -d”
  3. Open Docker CLI in corteza-server container
  4. Run “corteza-server auth assets export”

Any advice or feedback would be appreciated.

Yes, we do need to improve our error messages to make them more understandable to the general public.
I’ve just tried to do the same with my own containers and I was able to export my assets just fine.

Can you give us some more context on your setup, such as the Corteza version, operating system, …

Just to confirm we’re on the same page; I’ve done the following:

  1. added AUTH_DEVELOPMENT_MODE=true and AUTH_ASSETS_PATH=/assets/auth to the .env
  2. added a new volume to the docker-compose.yaml (added volumes: ["./templates:/assets/auth"] under the server service)
  3. created the appropriate folders on my local machine (ref – added the templates folder along with the public and templates sub-folders).
  4. docker-compose up -d, docker-compose exec server sh, and corteza-server auth assets export

If its still causing issues you can also manually download the assets in question from the corteza-server repository. Place the downloaded assets into the volume you’ve prepared and you should be good to go.

So I tried to follow what you gave me now and was still unsuccessful.
I will be trying to download the assets manually next.

Here is a screenshot of my last attempt…

Tried the manual download and cant get that working either.
Docker is failing to find the directory still.
I tried all the configurations I could think of by putting the downloaded public and templates folders in each directory.

If I recall correctly; the last time I had to map volumes on a Windows machine; I had to explicitly grant access to the Docker engine – is this the case here (I had a popup notification when I started the thing)?

It’s also possible that the current directory visible to your Docker manager (the program on the right) isn’t the same as the config files; does an absolute path fix the issue?

Tried opening docker engine in admin mode and I tried absolute paths.

Perhaps my volume path isn’t correct? I’m not 100% how they correlate to my local directories as it will not allow me to give it an absolute path in the docker-compose; says it has too many colons.

You mentioned a parent templates folder with child folders public and templates .

  • templates (at root level/docker-compose level)
    • public/
    • templates/

but the public and template folders are said/shown to go in /assets/auth/.

So I’m a bit confused on the relationship with those.
Essentially, ‘volumes: [./templates:/assets/auth]’ doesn’t make a whole lot of sense to me.

It seems that this will only work with a volume mounted to /corteza/auth/assets/ like “./assets:/corteza/auth/assets/” and AUTH_ASSETS_PATH=/corteza/auth/assets/

This is because of the relative path passed to os.Open in /corteza-server/auth/handlers/handle_dev.go/getScenes()

Using any other path will cause this error:

Either the relative path should be addressed or the documentation should be updated?

This is now I managed to set it up on my windows machine:

  1. create a folder on my desktop with .env, docker-compose.yaml files and templates folder

  2. in .env file add AUTH_DEVELOPMENT_MODE=true AUTH_ASSETS_PATH=/templates

  3. in docker-compose.yaml add services: server: volumes: ["./corteza-server/auth/assets:/templates", “./corteza-server/auth:/corteza/auth”]

  4. in templates folder copy-paste public and templates folders from corteza-server repo that are located in auth > assets

2 Likes

By doing these steps where you able to change the logo in Corteza.

Can you please explain the same is more detail. I am not able to understand your steps