douban / code

[DEPRECATED]Douban CODE

Home Page:http://douban-code.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

启动报错提示 undefined symbol: git_oid_equal 与配置的问题

aqqwiyth opened this issue · comments

(venv)[root@BJNET-APP-99 code]# gunicorn -w 2 -b 127.0.0.1:8800 app:app
2014-05-06 16:30:50 [25604] [INFO] Starting gunicorn 18.0
2014-05-06 16:30:50 [25604] [INFO] Listening at: http://127.0.0.1:8800 (25604)
2014-05-06 16:30:50 [25604] [INFO] Using worker: sync
2014-05-06 16:30:50 [25609] [INFO] Booting worker with pid: 25609
2014-05-06 16:30:50 [25610] [INFO] Booting worker with pid: 25610
2014-05-06 16:30:50 [25609] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
2014-05-06 16:30:50 [25609] [INFO] Worker exiting (pid: 25609)
2014-05-06 16:30:50 [25610] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
Traceback (most recent call last):
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
worker.init_process()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
self.wsgi = self.app.wsgi()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
self.callable = self.load()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
return self.load_wsgiapp()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
return util.import_app(self.app_uri)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
import(module)
File "/data/project/code/app.py", line 5, in
from web import app as web
File "/data/project/code/web.py", line 11, in
from vilya import views as controllers
File "/data/project/code/vilya/views/init.py", line 9, in
from vilya.views.users import UserUI
File "/data/project/code/vilya/views/users/init.py", line 6, in
from vilya.models.project import Project
File "/data/project/code/vilya/models/project.py", line 9, in
from vilya.models.git.repo import ProjectRepo
File "/data/project/code/vilya/models/git/repo.py", line 12, in
from ellen.repo import Jagare
File "/data/project/code/venv/src/ellen/ellen/repo.py", line 6, in
from pygit2 import Repository
File "/data/project/code/venv/src/pygit2/pygit2/init.py", line 32, in
import _pygit2
ImportError: /data/project/code/venv/src/pygit2/_pygit2.so: undefined symbol: git_oid_equal
2014-05-06 16:30:50 [25610] [INFO] Worker exiting (pid: 25610)
Traceback (most recent call last):
File "/data/project/code/venv/bin/gunicorn", line 9, in
load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 71, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/app/base.py", line 143, in run
Arbiter(self).run()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 203, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 298, in halt
self.stop()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 341, in stop
self.reap_workers()
File "/data/project/code/venv/lib/python2.7/site-packages/gunicorn/arbiter.py", line 452, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

还有问一下:local_config.py 与config.py的关系是什么
gunicorn -w 2 -b 127.0.0.1:8000 app:app 启动会选择哪一个配置文件?

这个可能是 libgit2 的版本的问题。

config.py 在 import 的时候会去 import local_config 一下,如果说关系的话,config 包含 local_config,local_config 的设置会覆盖 config.py 中的。

现在 code 还处于开发期当中~

@aqqwiyth 你可以把libgit2/pygit2删掉 重新按code提供的文档来一次. 还有问题,你可以把安装过程粘在gist/pastebin上发出来.

@xtao 嗯,明白了
@dongweiming 我是这样卸载安装的,您看看对不对
(venv)[root@BJNET-APP-99 code]# pip uninstall pygit2
Cannot uninstall requirement pygit2, not installed
Storing debug log for failure in /root/.pip/pip.log
(venv)[root@BJNET-APP-99 code]#
(venv)[root@BJNET-APP-99 code]#
(venv)[root@BJNET-APP-99 code]# pip install -e git+https://github.com/douban/pygit2.git@c7b13237e9934b5620cf0c351ae7eaea7d14ffc3#egg=pygit2
Obtaining pygit2 from git+https://github.com/douban/pygit2.git@c7b13237e9934b5620cf0c351ae7eaea7d14ffc3#egg=pygit2
Updating ./venv/src/pygit2 clone (to c7b13237e9934b5620cf0c351ae7eaea7d14ffc3)
Could not find a tag or branch 'c7b13237e9934b5620cf0c351ae7eaea7d14ffc3', assuming commit.
Running setup.py (path:/data/project/code/venv/src/pygit2/setup.py) egg_info for package pygit2
checkout libgit2 source
build libgit2 embed

Installing extra requirements: 'egg'
Installing collected packages: pygit2
Running setup.py develop for pygit2
checkout libgit2 source
build libgit2 embed

Creating /data/project/code/venv/lib/python2.7/site-packages/pygit2.egg-link (link to .)
Adding pygit2 0.20.1 to easy-install.pth file

Installed /data/project/code/venv/src/pygit2

Successfully installed pygit2
Cleaning up...
(venv)[root@BJNET-APP-99 code]#

(venv)[root@BJNET-APP-99 code]# pip list |grep pygit2
pygit2 (0.20.1, /data/project/code/venv/src/pygit2)
(venv)[root@BJNET-APP-99 code]#

发现一个问题就是不能下载到hash为c7b13237e9934b5620cf0c351ae7eaea7d14ffc3的文件了,下载了master的最新版本

那个提示倒是没有关系.0.20.1的版本是对的.

你上面的一开始uninstall 其实就没有成功 我建议你再试试. 还不行 就去找pygit2和libgit2 2个安装路径目录 直接删掉 重新来.

你有没有试code提供的scripts/install_code.sh

之前是按照 http://douban-code.github.io/pages/getting-started.html 发现不成功
bash <(curl -s $file) 这样的shell执行不了,手动执行过 centos.sh

#!/usr/bin/env bash

#Get generic function
. common.sh

echo "Install needed package.This may take some time..."
sudo yum install -y -q git python-virtualenv python-devel memcached gcc gcc-c++

echo "Install mysql..."
#sudo yum install -y -q mysql-server mysql mysql-devel
#sudo /etc/init.d/mysqld start

echo "Setup memcached port to 11311..."
#sudo sed -i "s/PORT=11211/PORT=11311/" /etc/init.d/memcached
#sudo /etc/init.d/memcached start

echo "Install libmemcached..."
install_libmemcached

echo "Install code..."
install_code

echo "Start app..."
start_app

由于我的mysql跟memcache 是以前安装的,所以我把相关的安装给注释了
稍后我贴一个执行centos.sh过程
————————————————————————————————————
[root@BJNET-APP-99 scripts]# sh centos.sh
Install needed package.This may take some time...
Package git-1.8.2.1-1.el5.x86_64 already installed and latest version
Package 1:python-virtualenv-1.7.2-2.el5.noarch already installed and latest version
Package python-devel-2.4.3-56.el5.x86_64 already installed and latest version
Package python-devel-2.4.3-56.el5.i386 already installed and latest version
Package memcached-1.4.5-1.el5.x86_64 already installed and latest version
Package gcc-4.1.2-54.el5.x86_64 already installed and latest version
Package gcc-c++-4.1.2-54.el5.x86_64 already installed and latest version
Install mysql...
Setup memcached port to 11311...
Install libmemcached...
common.sh: line 7: check: command not found
Install code...
fatal: destination path 'code' already exists and is not an empty directory.
Setup database...
注释掉了数据库初始化
New python executable in venv/bin/python
Installing setuptools, pip...done.
virtualenv
Requirement already satisfied (use --upgrade to upgrade): cython in ./venv/lib/python2.7/site-packages
Cleaning up...
Downloading/unpacking setuptools from https://pypi.python.org/packages/3.4/s/setuptools/setuptools-3.5.1-py2.py3-none-any.whl#md5=2b7c2a0882249b0ff2972e6fe8d14b3e
Downloading setuptools-3.5.1-py2.py3-none-any.whl (546kB): 546kB downloaded
Installing collected packages: setuptools
Found existing installation: setuptools 3.4.4
Uninstalling setuptools:
Successfully uninstalled setuptools
Successfully installed setuptools
Cleaning up...
Downloading/unpacking MySQL-python==1.2.4 (from -r requirements.txt (line 1))
Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
Running setup.py (path:/data/project/code/scripts/code/venv/build/MySQL-python/setup.py) egg_info for package MySQL-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
——————————————————————————————————————————
安装 MySQL-python==1.2.4失败了

RuntimeError: maximum recursion depth exceeded

/data/project/code/scripts/code/venv/build/MySQL-python/distribute-0.6.28-py2.7.egg

Traceback (most recent call last):

File "", line 17, in

File "/data/project/code/scripts/code/venv/build/MySQL-python/setup.py", line 7, in

use_setuptools()

File "distribute_setup.py", line 145, in use_setuptools

return _do_download(version, download_base, to_dir, download_delay)

File "distribute_setup.py", line 125, in _do_download

_build_egg(egg, tarball, to_dir)

File "distribute_setup.py", line 116, in _build_egg

raise IOError('Could not build the egg.')

IOError: Could not build the egg.

——————————————————————————————————
Cleaning up...
Removing temporary dir /data/project/code/scripts/code/venv/build...
Command python setup.py egg_info failed with error code 1 in /data/project/code/scripts/code/venv/build/MySQL-python
Exception information:
Traceback (most recent call last):
File "/data/project/code/scripts/code/venv/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/data/project/code/scripts/code/venv/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/data/project/code/scripts/code/venv/lib/python2.7/site-packages/pip/req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "/data/project/code/scripts/code/venv/lib/python2.7/site-packages/pip/req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "/data/project/code/scripts/code/venv/lib/python2.7/site-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /data/project/code/scripts/code/venv/build/MySQL-python

根据 #14 里的把MySQL-python改成1.2.3之后重新执行

Downloading/unpacking misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10))
Could not find a version that satisfies the requirement misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10)) (from versions: 0.3.1, 0.3.2, 0.3.3, 0.4.0, 0.4.1, 0.4.2, 1.0.0, 1.0.1, 1.0.2)
Cleaning up...
No distributions matching the version for misaka==1.0.3 (from mikoto==0.0.4->-r requirements.txt (line 10))
Storing debug log for failure in /root/.pip/pip.log

好了么?

出现上面的问题就没弄了。。。。misaka==1.0.3 安装失败

@aqqwiyth 欢迎再试.