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

separating out design documents not working on OS X #17

Closed
gad2103 opened this issue Feb 15, 2015 · 7 comments
Closed

separating out design documents not working on OS X #17

gad2103 opened this issue Feb 15, 2015 · 7 comments
Labels

Comments

@gad2103
Copy link

gad2103 commented Feb 15, 2015

.. INFO: Separating Design documents ... INFO: Duplicating original file for alteration ... INFO: Stripping _design elements from regular documents ... INFO: Fixing end document ... INFO: Inserting Design documents ... INFO: Successfully imported 0 Design Documents ... INFO: Small dataset. Importing as a single file. {"error":"bad_request","reason":"Missing JSON list of 'docs'"}

This is the output i'm getting. I'm wondering it there is something wrong with the sed command?

@dalgibbard
Copy link
Collaborator

Do you have any '_design' docs in your DB? They normally at the start or end of the dumped JSON if that helps.

@dalgibbard
Copy link
Collaborator

Also; try running with 'bash -x <command_here>' to get some debug info :)

@dalgibbard
Copy link
Collaborator

I suspect I hit this issue in a recent run; and it may be a different issue; the actual problem is when the dataset is small enough to be imported in a single job without needing to split it; it doesn't seem to format the file appropriately. If/when I do my next load of dev on this code, i'll look to identify and sort this too :)

One thought; if the design docs are at the end (with only the footer after it), and we remove that, the last document should have the final comma stripped. Could be something as simple as this throwing off the parser.

@dalgibbard
Copy link
Collaborator

OK so I spent some time testing/debugging this - and I can't reproduce it.

[root@server dir]# /root/couchdb-backup.sh -R -H 127.0.0.1 -u admin -p pass -d db2 -f db.nodesign.json
... INFO: Separating Design documents
... INFO: Duplicating original file for alteration
... INFO: Stripping _design elements from regular documents
... INFO: Fixing end document
... INFO: Inserting Design documents
... INFO: Successfully imported 0 Design Documents
... INFO: Small dataset. Importing as a single file.
[]

[root@server dir]# /root/couchdb-backup.sh -R -H 127.0.0.1 -u admin -p pass -d db3 -f db.short2.json
... INFO: Separating Design documents
... INFO: Duplicating original file for alteration
... INFO: Stripping _design elements from regular documents
... INFO: Fixing end document
... INFO: Inserting Design documents
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
104  1357    0    78  106  1279  34090   545k --:--:-- --:--:-- --:--:--  624k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
104  1988    0    74  100  1914  22162   559k --:--:-- --:--:-- --:--:--  934k
... INFO: Successfully imported 2 Design Documents
... INFO: Small dataset. Importing as a single file.
[]

[root@server dir]# /root/couchdb-backup.sh -R -H 127.0.0.1 -u admin -p pass -d db4 -f db.short1.json
... INFO: Separating Design documents
... INFO: Duplicating original file for alteration
... INFO: Stripping _design elements from regular documents
... INFO: Fixing end document
... INFO: Inserting Design documents
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
104  1357    0    78  106  1279  23276   372k --:--:-- --:--:-- --:--:--  416k
... INFO: Successfully imported 1 Design Documents
... INFO: Small dataset. Importing as a single file.
[]

So with:

  • Small file for import, with two design docs
  • Small file for import, with one design doc
  • Small file for import with no design docs
    No issues were found.

@danielebailo I would suggest we can close this for now, and re-open if it can be reproduced, complete with the output from 'bash -x'.

@dalgibbard
Copy link
Collaborator

Note that i've got a merge pending to fix the incorrect detection of _design docs in #23

@danielebailo
Copy link
Owner

Darren,
I just added you as collaborator.
You deserve it for the great work you are doing.
Thanks.
Daniele

Daniele

http://www.danielebailo.it/ http://danielebailo.wordpress.com/

2015-05-07 18:15 GMT+02:00 Darren Gibbard notifications@github.com:

Note that i've got a merge pending to fix the incorrect detection of
_design docs in #23 #23


Reply to this email directly or view it on GitHub
#17 (comment)
.

@dalgibbard
Copy link
Collaborator

Cheers dude :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants