Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git error #4382

Closed
remyahalza opened this issue Aug 25, 2020 · 16 comments
Closed

git error #4382

remyahalza opened this issue Aug 25, 2020 · 16 comments
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.

Comments

@remyahalza
Copy link

i got keyerror Git

Error during template rendering
In template /home/site/wwwroot/weblate/templates/snippets/git-info.html, error at line 24

git

@nijel
Copy link
Member

nijel commented Aug 25, 2020

Can you please include some useful information in the report? What Weblate version do you use? What was the actual error? What was the exception traceback?

@remyahalza
Copy link
Author

I use 3.3 version. Now i upgraded to 4.1.1. when i click components in my project i got key error "git", only after signin to any user, without sign in no error

Exception Type: KeyError
'git'
/home/site/wwwroot/weblate/utils/classloader.py in getitem, line 78
/home/site/wwwroot/myenv/bin/python3.8
3.8.3

@nijel nijel added the question This is more a question for the support than an issue. label Aug 26, 2020
@nijel
Copy link
Member

nijel commented Aug 26, 2020

Have you changed configuration of VCS_BACKENDS? The Git backend has to stay there in case you are using it...

@github-actions
Copy link

This issue looks like a support question. We try to answer these reasonably fast, but in case you are looking for faster resolution, please consider purchasing support subscription and make Weblate stronger.

@remyahalza
Copy link
Author

No. i didn't changed the configuration of VCS_BACKENDS, Can you please help me to configure this

@nijel
Copy link
Member

nijel commented Aug 26, 2020

Can you please provide full traceback of the error?

@remyahalza
Copy link
Author

Request Method: GET
http://halzaweblatenew.azurewebsites.net/manage/repos/
3.0.9
KeyError
'git'
/home/site/wwwroot/weblate/utils/classloader.py in getitem, line 78
/home/site/wwwroot/myenv/bin/python3.8
3.8.3
['/home/site/wwwroot/myenv/lib/python3.8/site-packages/git/ext/gitdb', '/home/site/wwwroot', '/home/site/wwwroot', '/home/site/wwwroot/myenv/bin', '/opt/python/3.8.3/lib/python38.zip', '/opt/python/3.8.3/lib/python3.8', '/opt/python/3.8.3/lib/python3.8/lib-dynload', '/home/site/wwwroot/myenv/lib/python3.8/site-packages', '/home/site/wwwroot/myenv/lib/python3.8/site-packages/gitdb/ext/smmap']

@remyahalza
Copy link
Author

i got an error like ,

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception

Example:
export GIT_PYTHON_REFRESH=quiet

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\26099\AppData\Local\Programs\Python\Python36\lib\site-packages\git_init_.py", line 85, in
raise ImportError('Failed to initialize: {0}'.format(exc))
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception

so I do
export GIT_PYTHON_REFRESH=quiet

I think the key error due to this,

Can you please give me a solution for this

@nijel
Copy link
Member

nijel commented Aug 27, 2020

All git commands will error until this is rectified.

Weblate can not find the git command. Maybe it's not installed in the PATH?

File "C:\Users\26099\AppData\Local\Programs\Python\Python36\lib\site-packages\git_init_.py", line 85, in

You apparently run Weblate on Windows, which is not supported, some things might be broken, see https://docs.weblate.org/en/latest/admin/install.html#operating-system

@remyahalza
Copy link
Author

How to install git in the path in linux

@remyahalza
Copy link
Author

when i go to weblate, select a project and select a component, its working,
but I login to any user and do the same like above it shows git keyerror like above

@remyahalza
Copy link
Author

When i try to create component, in version control option there is no git, can you please help me why this happened

@nijel
Copy link
Member

nijel commented Aug 27, 2020

When not authenticated, it doesn't show VCS information, so the related code path is not invoked. Anyway the root cause is that Weblate can not find git command. Are you running Windows or Linux? How did you install Git?

@remyahalza
Copy link
Author

I am running in Azure Webapp service linux application, in its startup file i add like this,

#!/bin/bash
apt-get update
apt-get install libssl-dev --yes
apt-get install libxml2-dev --yes
apt-get install libxslt-dev --yes
apt-get install libfreetype6-dev --yes
apt-get install libjpeg-dev --yes
apt-get install libz-dev --yes
apt-get install libyaml-dev --yes
apt-get install libcairo-dev --yes
apt-get install gir1.2-pango-1.0 --yes
apt-get install libgirepository1.0-dev --yes
apt-get install libacl1-dev --yes
apt-get install libssl-dev --yes
apt-get install build-essential --yes
apt-get install python3-gdbm --yes
apt-get install python3-dev --yes
apt-get install virtualenv --yes
apt-get install git --yes
apt-get install gcc --yes
apt-get install libcairo2-dev --yes

cd /home/site/wwwroot

#export GIT_PYTHON_REFRESH=quiet
#export GIT_PYTHON_GIT_EXECUTABLE=\usr\local\bin

pip install Weblate==4.1.1
pip install django-redi
pip install mysqlclient
pip install whitenoise
gunicorn --bind=0.0.0.0 --workers=4 --timeout 3600 weblate.wsgi

@nijel
Copy link
Member

nijel commented Sep 1, 2020

Maybe you're mixing native Windows Python with Linux container? You don't seem to install pip in the container, so it probably sticks to using system one which then cannot find the Git binary installed in the container? Try installing python3-pip and then installing Weblate using it. You can also install optional deps in single command:

pip3 install Weblate[MySQL]==4.2.1

@stale
Copy link

stale bot commented Sep 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Nobody will work on this. label Sep 11, 2020
@stale stale bot closed this as completed Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is more a question for the support than an issue. wontfix Nobody will work on this.
Projects
None yet
Development

No branches or pull requests

2 participants