Error when trying to couchapp push code that I updated from team's Git repo
[CRITICAL] nothing to repeat
The above is the error that I get when I tried to push the code in my couchDB. It was all working well until I tried to pull changes from Git repository that our team uses. Haven't resolved it yet.
Any idea(s) or help will be appreciated!
Detailed Error Report is below (for additional info.):
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 di开发者_运维技巧r_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
I am not sure what is wrong (I will ask Benoit if I see him on IRC). Perhaps a workaround?
Create a .couchapprc
instead. It is a standard JSON object.
cat > .couchapprc
{ "env":
{ "dev" : {"db": "http://localhost:5984/thoughtboard_db"}
, "staging": {"db": "http://user:pass@staging.server:5984/thoughtboard_db"}
}
}
Now simply push with couchapp push dev
.
Standard practice is do not check this file into Git because it has (or might have in the future) production passwords. In fact, tell git to ignore it.
echo .couchapprc >> .gitignore
git add .gitignore
git commit -m "Ignore the .couchapprc"
If you are concerned about leaving passwords in (git ignored) files on your system, consider that your shell commands (with any passwords) are already stored in $HOME/.bash_history
and that passwords entered at the command-line are world-readable by typing ps
when couchapp is running. (This may not be relevant in your situation, just reminding you.)
Thanks @jhs!
Adding default or dev environments was not of any avail for me. Though, I got a different error message this time when I followed your instruction (added just the dev environemnt alone in the .couchapprc)
$ 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>}
精彩评论