尝试使用我从团队的Git仓库更新的couchapp推送代码时出错

时间:2011-07-04 09:53:48

标签: couchdb couchapp

  

[关键]无需重复

以上是我尝试在couchDB中推送代码时出现的错误。在我尝试从我们团队使用的Git存储库中提取更改之前,一切正常。尚未解决。

任何想法或帮助将不胜感激!

详细错误报告如下(有关其他信息。):

thoughtboard$ couchapp push http://localhost:5984/thoughtboard_db
2011-07-04 14:52:52 [CRITICAL] nothing to repeat

    $ couchapp push http://localhost:5984/thoughtboard_db
    2011-07-04 14:52:52 [CRITICAL] nothing to repeat

    Traceback (most recent call last):
      File "/usr/local/lib/python2.6/dist-packages/couchapp/dispatch.py", line 48, in dispatch
        return _dispatch(args)
      File "/usr/local/lib/python2.6/dist-packages/couchapp/dispatch.py", line 92, in _dispatch
        return fun(conf, conf.app_dir, *args, **opts)
      File "/usr/local/lib/python2.6/dist-packages/couchapp/commands.py", line 79, in push
        doc.push(dbs, noatomic, browse, force)
      File "/usr/local/lib/python2.6/dist-packages/couchapp/localdoc.py", line 122, in push
        doc = self.doc(db, force=force)
      File "/usr/local/lib/python2.6/dist-packages/couchapp/localdoc.py", line 185, in doc
        self._doc.update(self.dir_to_fields(self.docdir, manifest=manifest))
      File "/usr/local/lib/python2.6/dist-packages/couchapp/localdoc.py", line 303, in dir_to_fields
        elif self.check_ignore(name):
      File "/usr/local/lib/python2.6/dist-packages/couchapp/localdoc.py", line 285, in check_ignore
        match = re.match(i, item)
      File "/usr/lib/python2.6/re.py", line 137, in match
        return _compile(pattern, flags).match(string)
      File "/usr/lib/python2.6/re.py", line 245, in _compile
        raise error, v # invalid expression
    error: nothing to repeat

2 个答案:

答案 0 :(得分:1)

我不确定是什么问题(如果我在IRC上看到他,我会问Benoit)。也许是一种解决方法?

改为创建.couchapprc。它是标准的JSON对象。

cat > .couchapprc
{ "env":
  { "dev"    : {"db": "http://localhost:5984/thoughtboard_db"}
  , "staging": {"db": "http://user:pass@staging.server:5984/thoughtboard_db"}
  }
}

现在只需按下couchapp push dev

标准做法将此文件检入Git,因为它已经(或将来可能有)生产密码。事实上,告诉git忽略它。

echo .couchapprc >> .gitignore
git add .gitignore
git commit -m "Ignore the .couchapprc"

如果您担心在系统上的(git ignored)文件中保留密码,请考虑您的shell命令(带有任何密码)已存储在$HOME/.bash_history中,并且在命令行输入的密码是世界 - 当couchapp运行时键入ps可读。 (这可能与您的情况无关,只是提醒您。)

答案 1 :(得分:1)

谢谢@jhs!

添加默认或开发环境对我来说无济于事。虽然,这次我按照你的指示得到了一个不同的错误信息(仅在.couchapprc中添加了dev environemnt)

$ couchapp push dev .
2011-07-05 20:51:54 [CRITICAL] {'msg': '', 'status_int': 400, 'response': <couchapp.client.CouchdbResponse object at 0xa2ead6c>}

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/couchapp/dispatch.py", line 48, in dispatch
    return _dispatch(args)
  File "/usr/local/lib/python2.6/dist-packages/couchapp/dispatch.py", line 92, in _dispatch
    return fun(conf, conf.app_dir, *args, **opts)
  File "/usr/local/lib/python2.6/dist-packages/couchapp/commands.py", line 76, in push
    dbs = conf.get_dbs(dest)
  File "/usr/local/lib/python2.6/dist-packages/couchapp/config.py", line 144, in get_dbs
    return [Database(dburl) for dburl in dburls]
  File "/usr/local/lib/python2.6/dist-packages/couchapp/client.py", line 223, in __init__
    self.res.head()
  File "/usr/local/lib/python2.6/dist-packages/couchapp/restkit/resource.py", line 121, in head
    params_dict=params_dict, **params)
  File "/usr/local/lib/python2.6/dist-packages/couchapp/client.py", line 141, in request
    raise RequestFailed(str(e))
RequestFailed: {'msg': '', 'status_int': 400, 'response': <couchapp.client.CouchdbResponse object at 0xa2ead6c>}