Re: httpd vs chttpd, and 5984 vs 5986

2016-10-13 Thread Jan Lehnardt
Ugh, that on is on me, sorry!

Best
Jan
--

> On 13 Oct 2016, at 19:43, Timothy McKernan  wrote:
> 
> The setup endpoint was easy to use and I have a lot more confidence that
> I've set it up correctly, thanks.
> 
> The only thing that threw me was the endpoint name and json format are
> incorrect in the README. I was going to fork and fix it but it looks like
> https://github.com/apache/couchdb-setup/pull/10 already did pretty much
> every change I was going to make. His stuff just hasn't made it into the
> base.
> 
> Thanks for your help,
> Tim
> 
> On Thu, Oct 13, 2016 at 4:11 AM Jan Lehnardt  wrote:
> 
> 
>> On 12 Oct 2016, at 22:40, Timothy McKernan 
> wrote:
>> 
>> You are right, I did skip over it. I apologize for the easy miss.
>> 
>> If you'll bear with me, here is what I was seeing, and why I skipped over
>> it: I only use ssl and was trying to automate that step (for an rpm
>> installation). The behavior seems different under ssl than port 5984. My
>> bit adds the admin user and binds to 0.0.0.0 easily enough. But when I run
>> setup and am viewing fauxton under https the list of db's shows missing
>> shards, such as this:
>> shards/-1fff/_global_changes.1476302646
> 
> shards don’t show up on 5984, they are an implementation detail that is
> (for the moment) only relevant on a per-node basis (and thus 5986).
> 
>> And likewise there are lots of errors in the logs:
>> [error] 2016-10-12T20:22:01.293892Z couchdb@localhost <0.9859.0> 
>> httpd 400 error response: {"error":"illegal_database_name","reason":"Name:
>> 'shards%2F6000-7fff%2F_users.1476302646'. Only lowercase
> characters
>> (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are
>> allowed. Must begin with a letter."}
>> 
>> I'm really only explaining all of this to get around to my next question:
>> Those shards/errors that are created during setup don't appear under
>> fauxton:5984, but they do under fauxton:5986 and fauxton:6984. Am I
> missing
>> something in my ssl setup?
> 
> Yes, you need to run the equivalent of creating the three databases:
> _global_changes
> _users and _replicator.
> 
> Or use the /_setup_cluster endpoint as documented (roughly) here:
> https://github.com/apache/couchdb-setup
> 
> It is what Fauxton uses under the hood, so you can script it.
> 
> * * *
> 
> That said, we totally acknowledge that this is a bit confusing and
> under-documented, so we hope you bear with us :)
> 
> Best
> Jan
> --
> 
> 
> 
>> 
>> On Wed, Oct 12, 2016 at 3:35 PM Jan Lehnardt  wrote:
>> 
>>> Looks like you skipped over the "setup cluster" step from the
> installation
>>> notes on docs.couchdb.org. Even a single/node cluster-of-one needs this,
>>> as it creates the necessary system databases.
>>> 
>>> At this point, best to ignore the 5986 port (unless for per-node
>>> maintenance).
>>> 
>>> Cheers
>>> Jan
>>> --
>>> 
 On 12 Oct 2016, at 20:44, Timothy McKernan 
>>> wrote:
 
 I've installed CouchDB 2.0.0 from source using:
 ./configure
 make release
 sudo mv rel/couchdb /var/lib/couchdb
 sudo chown -R couchdb:couchdb /var/lib/couchdb
 sudo -u couchdb /var/lib/couchdb/bin/couchdb
 
 The problem I'm seeing is that, by default, [chttpd] is being assigned
>>> port
 5984 (in the default.ini) and [httpd] is assigned 5986.
 
 Throughout the online docs port 5984 is referenced for the majority of
 endpoints, such as fauxton.
  Used for pretty much everything, such as couchapps (fauxton is the new
 futon) and db access.
 
 
>>> 
> http://docs.couchdb.org/en/2.0.0/intro/tour.html?highlight=5984#welcome-to-fauxton
 And port 5986 is the "back-door" port.
 
>>> http://docs.couchdb.org/en/2.0.0/cluster/databases.html?highlight=5986
  http://docs.couchdb.org/en/2.0.0/whatsnew/2.0.html?highlight=5986
 
 So we end up with the following behavior:
 md-007:~ $ curl -k -X GET http://127.0.0.1:5984/_all_dbs
 []
 md-007:~ $ curl -k -X GET http://127.0.0.1:5986/_all_dbs
 ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
 md-007:~ $ curl -k -X GET https://127.0.0.1:6984/_all_dbs
 ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
 
 It seems that chttpd doesn't have the usual default access to everything
 that it used to in couchdb 1.6. Indeed, if you use fauxton over port
> 5984
 as the docs say to, it _doesn't_ show you any db's, because it clearly
 (from the above curl examples) can't see any. And the emulator complains
 because it's using 5984 to try and find _users.
 
 [error] 2016-10-12T18:42:53.106630Z couchdb@localhost emulator 
 Error in process <0.4185.0> on node couchdb@localhost with exit value:
 
>>> 
> 

Re: httpd vs chttpd, and 5984 vs 5986

2016-10-13 Thread Timothy McKernan
The setup endpoint was easy to use and I have a lot more confidence that
I've set it up correctly, thanks.

The only thing that threw me was the endpoint name and json format are
incorrect in the README. I was going to fork and fix it but it looks like
https://github.com/apache/couchdb-setup/pull/10 already did pretty much
every change I was going to make. His stuff just hasn't made it into the
base.

Thanks for your help,
Tim

On Thu, Oct 13, 2016 at 4:11 AM Jan Lehnardt  wrote:


> On 12 Oct 2016, at 22:40, Timothy McKernan 
wrote:
>
> You are right, I did skip over it. I apologize for the easy miss.
>
> If you'll bear with me, here is what I was seeing, and why I skipped over
> it: I only use ssl and was trying to automate that step (for an rpm
> installation). The behavior seems different under ssl than port 5984. My
> bit adds the admin user and binds to 0.0.0.0 easily enough. But when I run
> setup and am viewing fauxton under https the list of db's shows missing
> shards, such as this:
> shards/-1fff/_global_changes.1476302646

shards don’t show up on 5984, they are an implementation detail that is
(for the moment) only relevant on a per-node basis (and thus 5986).

> And likewise there are lots of errors in the logs:
> [error] 2016-10-12T20:22:01.293892Z couchdb@localhost <0.9859.0> 
> httpd 400 error response: {"error":"illegal_database_name","reason":"Name:
> 'shards%2F6000-7fff%2F_users.1476302646'. Only lowercase
characters
> (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are
> allowed. Must begin with a letter."}
>
> I'm really only explaining all of this to get around to my next question:
> Those shards/errors that are created during setup don't appear under
> fauxton:5984, but they do under fauxton:5986 and fauxton:6984. Am I
missing
> something in my ssl setup?

Yes, you need to run the equivalent of creating the three databases:
_global_changes
_users and _replicator.

Or use the /_setup_cluster endpoint as documented (roughly) here:
https://github.com/apache/couchdb-setup

It is what Fauxton uses under the hood, so you can script it.

* * *

That said, we totally acknowledge that this is a bit confusing and
under-documented, so we hope you bear with us :)

Best
Jan
--



>
> On Wed, Oct 12, 2016 at 3:35 PM Jan Lehnardt  wrote:
>
>> Looks like you skipped over the "setup cluster" step from the
installation
>> notes on docs.couchdb.org. Even a single/node cluster-of-one needs this,
>> as it creates the necessary system databases.
>>
>> At this point, best to ignore the 5986 port (unless for per-node
>> maintenance).
>>
>> Cheers
>> Jan
>> --
>>
>>> On 12 Oct 2016, at 20:44, Timothy McKernan 
>> wrote:
>>>
>>> I've installed CouchDB 2.0.0 from source using:
>>> ./configure
>>> make release
>>> sudo mv rel/couchdb /var/lib/couchdb
>>> sudo chown -R couchdb:couchdb /var/lib/couchdb
>>> sudo -u couchdb /var/lib/couchdb/bin/couchdb
>>>
>>> The problem I'm seeing is that, by default, [chttpd] is being assigned
>> port
>>> 5984 (in the default.ini) and [httpd] is assigned 5986.
>>>
>>> Throughout the online docs port 5984 is referenced for the majority of
>>> endpoints, such as fauxton.
>>>   Used for pretty much everything, such as couchapps (fauxton is the new
>>> futon) and db access.
>>>
>>>
>>
http://docs.couchdb.org/en/2.0.0/intro/tour.html?highlight=5984#welcome-to-fauxton
>>> And port 5986 is the "back-door" port.
>>>
>> http://docs.couchdb.org/en/2.0.0/cluster/databases.html?highlight=5986
>>>   http://docs.couchdb.org/en/2.0.0/whatsnew/2.0.html?highlight=5986
>>>
>>> So we end up with the following behavior:
>>> md-007:~ $ curl -k -X GET http://127.0.0.1:5984/_all_dbs
>>> []
>>> md-007:~ $ curl -k -X GET http://127.0.0.1:5986/_all_dbs
>>> ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
>>> md-007:~ $ curl -k -X GET https://127.0.0.1:6984/_all_dbs
>>> ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
>>>
>>> It seems that chttpd doesn't have the usual default access to everything
>>> that it used to in couchdb 1.6. Indeed, if you use fauxton over port
5984
>>> as the docs say to, it _doesn't_ show you any db's, because it clearly
>>> (from the above curl examples) can't see any. And the emulator complains
>>> because it's using 5984 to try and find _users.
>>>
>>> [error] 2016-10-12T18:42:53.106630Z couchdb@localhost emulator 
>>> Error in process <0.4185.0> on node couchdb@localhost with exit value:
>>>
>>

Re: httpd vs chttpd, and 5984 vs 5986

2016-10-13 Thread Jan Lehnardt

> On 12 Oct 2016, at 22:40, Timothy McKernan  wrote:
> 
> You are right, I did skip over it. I apologize for the easy miss.
> 
> If you'll bear with me, here is what I was seeing, and why I skipped over
> it: I only use ssl and was trying to automate that step (for an rpm
> installation). The behavior seems different under ssl than port 5984. My
> bit adds the admin user and binds to 0.0.0.0 easily enough. But when I run
> setup and am viewing fauxton under https the list of db's shows missing
> shards, such as this:
> shards/-1fff/_global_changes.1476302646

shards don’t show up on 5984, they are an implementation detail that is
(for the moment) only relevant on a per-node basis (and thus 5986).

> And likewise there are lots of errors in the logs:
> [error] 2016-10-12T20:22:01.293892Z couchdb@localhost <0.9859.0> 
> httpd 400 error response: {"error":"illegal_database_name","reason":"Name:
> 'shards%2F6000-7fff%2F_users.1476302646'. Only lowercase characters
> (a-z), digits (0-9), and any of the characters _, $, (, ), +, -, and / are
> allowed. Must begin with a letter."}
> 
> I'm really only explaining all of this to get around to my next question:
> Those shards/errors that are created during setup don't appear under
> fauxton:5984, but they do under fauxton:5986 and fauxton:6984. Am I missing
> something in my ssl setup?

Yes, you need to run the equivalent of creating the three databases: 
_global_changes
_users and _replicator.

Or use the /_setup_cluster endpoint as documented (roughly) here: 
https://github.com/apache/couchdb-setup

It is what Fauxton uses under the hood, so you can script it.

* * *

That said, we totally acknowledge that this is a bit confusing and 
under-documented, so we hope you bear with us :)

Best
Jan
--



> 
> On Wed, Oct 12, 2016 at 3:35 PM Jan Lehnardt  wrote:
> 
>> Looks like you skipped over the "setup cluster" step from the installation
>> notes on docs.couchdb.org. Even a single/node cluster-of-one needs this,
>> as it creates the necessary system databases.
>> 
>> At this point, best to ignore the 5986 port (unless for per-node
>> maintenance).
>> 
>> Cheers
>> Jan
>> --
>> 
>>> On 12 Oct 2016, at 20:44, Timothy McKernan 
>> wrote:
>>> 
>>> I've installed CouchDB 2.0.0 from source using:
>>> ./configure
>>> make release
>>> sudo mv rel/couchdb /var/lib/couchdb
>>> sudo chown -R couchdb:couchdb /var/lib/couchdb
>>> sudo -u couchdb /var/lib/couchdb/bin/couchdb
>>> 
>>> The problem I'm seeing is that, by default, [chttpd] is being assigned
>> port
>>> 5984 (in the default.ini) and [httpd] is assigned 5986.
>>> 
>>> Throughout the online docs port 5984 is referenced for the majority of
>>> endpoints, such as fauxton.
>>>   Used for pretty much everything, such as couchapps (fauxton is the new
>>> futon) and db access.
>>> 
>>> 
>> http://docs.couchdb.org/en/2.0.0/intro/tour.html?highlight=5984#welcome-to-fauxton
>>> And port 5986 is the "back-door" port.
>>> 
>> http://docs.couchdb.org/en/2.0.0/cluster/databases.html?highlight=5986
>>>   http://docs.couchdb.org/en/2.0.0/whatsnew/2.0.html?highlight=5986
>>> 
>>> So we end up with the following behavior:
>>> md-007:~ $ curl -k -X GET http://127.0.0.1:5984/_all_dbs
>>> []
>>> md-007:~ $ curl -k -X GET http://127.0.0.1:5986/_all_dbs
>>> ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
>>> md-007:~ $ curl -k -X GET https://127.0.0.1:6984/_all_dbs
>>> ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
>>> 
>>> It seems that chttpd doesn't have the usual default access to everything
>>> that it used to in couchdb 1.6. Indeed, if you use fauxton over port 5984
>>> as the docs say to, it _doesn't_ show you any db's, because it clearly
>>> (from the above curl examples) can't see any. And the emulator complains
>>> because it's using 5984 to try and find _users.
>>> 
>>> [error] 2016-10-12T18:42:53.106630Z couchdb@localhost emulator 
>>> Error in process <0.4185.0> on node couchdb@localhost with exit value:
>>> 
>> {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
>>> 
>>> What's the correct configuration here? What ports should chttpd and httpd
>>> be set to so that the emulator process isn't erroring?
>> 
>> 

-- 
Professional Support for Apache CouchDB:
https://neighbourhood.ie/couchdb-support/



Re: httpd vs chttpd, and 5984 vs 5986

2016-10-12 Thread Jan Lehnardt
Looks like you skipped over the "setup cluster" step from the installation 
notes on docs.couchdb.org. Even a single/node cluster-of-one needs this, as it 
creates the necessary system databases.

At this point, best to ignore the 5986 port (unless for per-node maintenance).

Cheers
Jan
--

> On 12 Oct 2016, at 20:44, Timothy McKernan  wrote:
> 
> I've installed CouchDB 2.0.0 from source using:
> ./configure
> make release
> sudo mv rel/couchdb /var/lib/couchdb
> sudo chown -R couchdb:couchdb /var/lib/couchdb
> sudo -u couchdb /var/lib/couchdb/bin/couchdb
> 
> The problem I'm seeing is that, by default, [chttpd] is being assigned port
> 5984 (in the default.ini) and [httpd] is assigned 5986.
> 
> Throughout the online docs port 5984 is referenced for the majority of
> endpoints, such as fauxton.
>Used for pretty much everything, such as couchapps (fauxton is the new
> futon) and db access.
> 
> http://docs.couchdb.org/en/2.0.0/intro/tour.html?highlight=5984#welcome-to-fauxton
> And port 5986 is the "back-door" port.
>http://docs.couchdb.org/en/2.0.0/cluster/databases.html?highlight=5986
>http://docs.couchdb.org/en/2.0.0/whatsnew/2.0.html?highlight=5986
> 
> So we end up with the following behavior:
> md-007:~ $ curl -k -X GET http://127.0.0.1:5984/_all_dbs
> []
> md-007:~ $ curl -k -X GET http://127.0.0.1:5986/_all_dbs
> ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
> md-007:~ $ curl -k -X GET https://127.0.0.1:6984/_all_dbs
> ["_dbs","_nodes","_replicator","_users","md_rules","monitor"]
> 
> It seems that chttpd doesn't have the usual default access to everything
> that it used to in couchdb 1.6. Indeed, if you use fauxton over port 5984
> as the docs say to, it _doesn't_ show you any db's, because it clearly
> (from the above curl examples) can't see any. And the emulator complains
> because it's using 5984 to try and find _users.
> 
> [error] 2016-10-12T18:42:53.106630Z couchdb@localhost emulator 
> Error in process <0.4185.0> on node couchdb@localhost with exit value:
> {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
> 
> What's the correct configuration here? What ports should chttpd and httpd
> be set to so that the emulator process isn't erroring?