Troubleshooting guide to git related issue for on-premise customers

Hi Everyone,

I'm Noura, a TSE here at Google. This article will be a guide to self-serve and troubleshoot git related issues on your Looker instance.

Introduction

This guide is only for customers who host their own Looker instance. For Looker-hosted customers please reach out directly to support and we will investigate the issue for you.

Prerequisites

Before digging further on what is the git issue, the first thing will be to verify the git version. 

Looker needs to have git 2.39.1+ as noted on our documentation

Looker uses the cli to do some git operations. Mainly operation related to git worktree but also commands like git branch –show-current that are options that won’t work if you have a version below.  

Standard directory structure

This is the standard directory structure you will find on the file system where you will find the project. 

The full path is subject to change, depending on what is set in LOOKERDIR in the looker_init file. The path by default will be /home/looker/looker

 

 

 

looker_data
  └── modelshare
    ├── deploy_keys
    │   └── project_name
    │       ├── git_ssh
    │       ├── id_rsa
    │       └── id_rsa.pub
    ├── models 
    │   └── project_name
    │       ├── .git/
    │       ├── hello_world.lkml 
    │       └── toto.txt
    ├── models-user-1
    │   └── project_name
    │	├── .git
    │       ├── hello_world.lkml
    │       └── toto.txt
    └── models-user-looker
        └── project_name
            ├── hello_world.lkml
            ├── toto.txt
            └── .git/

 

 

 

You will see that there’s different model directories. Here a definition for each directories

models

Production project. This is what looker use when user is out of dev mode

models-user-<id>

When the user turns on development mode for the first time, this directory is created. This is the workspace of the developer and can do their changes. 

models-user-looker

When you use a ssh connection Looker will use git worktree. This directory will contain the worktree path to each developer. This is like the master project while developer work on their own branch in models-user-<id>

Common Git related issues

We have a few git related issues that can happen on your Looker instance that will show different symptoms and may not be obvious that they are related git issues. In this guide we will surface 2 problems. For any other problem, feel free to reach out to support and we will gladly help troubleshoot further.

That page doesn’t exist or you don’t have permission to view it. 

Symptoms: You switch into dev mode, click on your project and your face with a 500 error and the following error “That page doesn’t exist or you don’t have permission to view it.” 

4xoA4WyP6TpZPiu.png

There’s multiple reasons that this can happen. Usually this happens when the user’s directory has been corrupted and the .git file has been pulled out of the directory into a hidden purgatory directory. 

The easiest way to mitigate this issue is to do a git init on the problematic folder.   

To apply the workaround, you will need to reach out to the team responsible for the Looker infrastructure and have access to the terminal where Looker is hosted to navigate the file system. 

Note the user_id of the user affected in Admin > Users and the project name

 

 

cd /home/looker/looker/models-user-id/project-name 
git status # to verify if you have a git repository
git init # If the error pop-up that this is not a git repository 

 

 

At this point you can refresh the page on Looker and the issue will be solved.

JGIT Checkout Branch failed: Checkout conflict with files:<>

This error happens less frequently, but when it does and you don’t see any conflict on the file mentioned, that means that the conflict is with the production project. 

The production project is under  /home/looker/looker/models/project-name this directory should always be up to date and not have any pending change. 

In order to identify if the issue is with the production project, do a git status and verify that there is change. If there is then do a git diff HEAD to identify what are the changes. 

If you see change related to permission like so revert the change by doing a git restore . 

 

 

diff --git a/readme.md
b/readme.md
old mode 100755
new mode 100644

 

 

This issue may happen if you do change on the server as a root user. The root user will overwrite the file owner and permission. So be mindful to use the looker user if you plan to change anything that touches looker files.

Conclusion

In doubt feel free to reach out to Looker Support, we can guide you through the step and help you troubleshoot a novel issue. 

0 0 371
0 REPLIES 0