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

Already on GitHub? Sign in to your account

Instructions on README do not work #150

Closed
fxdgear opened this Issue Feb 17, 2014 · 7 comments

Comments

Projects
None yet
4 participants

fxdgear commented Feb 17, 2014

When following the instructions on the readme I get here:

root@NPMMirror:~/npmjs.org# npm run copy \
>   --npmjs.org:couch=http://admin:password@localhost:5984/registry

> npmjs.org@1.2.0 copy /root/npmjs.org
> bash ./copy.sh

Did you already run the load-views.sh script? (type 'yes')
yes
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    67  100    67    0     0     82      0 --:--:-- --:--:-- --:--:--    83
{"error":"unauthorized","reason":"Name or password is incorrect."}

anvaka commented Feb 21, 2014

Looks like this happens when you install fresh couch db. Quick and dirty fix can be, removing revision for a first run in copy.sh. So your last lines would look like:

# We are not going to use rev below (there is no _design/app in fresh couch)
rev=$(curl -k "$c"/_design/app | json _rev)
auth="$(node -pe 'require("url").parse(process.argv[1]).auth' "$c")"
url="$(node -pe 'u=require("url");p=u.parse(process.argv[1]);delete p.auth;u.format(p)' "$c")"

curl "$url/_design/scratch" \
   -k -u "$auth" \
  -X COPY \
  -H destination:'_design/app'
# no `rev` in destination

anvaka commented Feb 21, 2014

Wait, I just realized you have a different problem - in your case you are not passing correct user name and password for couch. Make sure you edited your local.ini file from Couch DB, with correct password for admin.

fxdgear commented Feb 21, 2014

@anvaka I found in the issue ssomeone who's written more detailed instructions on how to make this work: https://gist.github.com/dandean/8365028

those instructions go through configuring the admin user in the couch local.ini file.

I'm trying to not be a dunce about this. BUT I've never used couch before. So The whole thing is new to me. I was looking for instructions that would just step by step get it up and running for me. The instructions you have in the README are close, but are missing some minor details that would be known to someone familiar with couch, but a noob like me I failed to notice that. I was trying to google creating users in couch and made some but still was running into issues :/

@anvaka - thanks for your tip on skipping the revision in copy.sh. It helped me get past the error: {"error":"bad_request","reason":"Invalid rev format"}

Member

terinjokes commented Feb 26, 2014

I've also reported this as #152

Member

terinjokes commented Mar 4, 2014

@anvaka your tip is now the behavior on master.

The other issue here, and on the mentioned ticket, is that copy.sh attempts to parse out the username and password information, which fails (by returning the string "null") if none were passed. I'm sure a PR will be accepted.

Member

terinjokes commented Mar 11, 2014

Auth issue resolved with e4512dd

@terinjokes terinjokes closed this Mar 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment