--- Log opened Tue Mar 18 00:00:11 2014 02:28 < tds5016> hi all. Question... how well does couchdb integrate with python and twisted? 02:31 <+Kxepal> tds5016: couldn't say how well, but there are couple clients for twisted. you could try them and share your experience with us (: 04:41 < fiatjaf> I'm getting an error 04:41 < fiatjaf> XMLHttpRequest cannot load https://fiatjaf.couchappy.com/p/_list/search/search?query. Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers. 04:41 < fiatjaf> when making a request with ajax (superagent.js) from another page to couchappy 11:28 < paldepind> I'm trying add a user to a database in the _security document, but when I save the document in Futon the changes are for some reason discarded? 11:34 <+Kxepal> paldepind: your session becomes expired? 11:35 < paldepind> Kxepal: Do you mean my login session in Futon? That's not it. I've just refreshed the page and I'm still logged in. 11:37 <+Kxepal> paldepind: hm..that's was my only idea since this is the only case I know when such behavior my happened ): 11:39 < paldepind> Thanks for the suggestion :) But I'm definitely logged in as the admin. 11:41 <+Kxepal> paldepind: btw. have you checked couch.log on the moment of saving _security? 11:42 < paldepind> Nope. I'll try that! 11:45 < paldepind> Hm, there doesn't seem to be a log file. 11:54 <+Kxepal> how's that? in futon got to configuration -> log -> file (also ensure that level is at least info to trace http requests) - it doesn't exists? 12:23 -!- Topic for #couchdb: Latest: 1.5.0 | The State of CouchDB 2013: https://blogs.apache.org/couchdb/entry/the_state_of_couchdb | http://docs.couchdb.org | http://couchdb.apache.org/ | Dev chat in #couchdb-dev | #couchdbconf presentations http://conf.couchdb.org/ and http://bit.ly/SYcWFl fun times! And always remember that 'guys' is not a synonym for 'everyone'. 12:23 -!- Topic set by rnewson [rnewson@couchdb/committer/rnewson] [Sat Dec 28 17:18:21 2013] 12:23 [Users #couchdb] 12:23 [@ChanServ ] [ conan_the_destro] [ garren ] [ kandinski ] [ ojeey ] [ srdjan ] 12:23 [+awenkhh ] [ couchbot ] [ giacecco ] [ kika1 ] [ omarkj ] [ sreeix ] 12:23 [+benoitc ] [ Couto ] [ glew ] [ klaus_trainer_] [ orospakr ] [ srm` ] 12:23 [+bigbluehat ] [ csm_memeo ] [ gnap ] [ koredn` ] [ paldepind ] [ stonebranch ] 12:23 [+dch ] [ daleharvey ] [ green_turtle] [ krry ] [ papajoe_ ] [ str4nd ] 12:23 [+fdmanana ] [ damjan ] [ grncdr ] [ ksnavely ] [ Part`_ ] [ strmpnk__ ] 12:23 [+jan____ ] [ darix ] [ histrio ] [ kwmiebach____ ] [ patrek ] [ svnlto__ ] 12:23 [+Kxepal ] [ darkelda ] [ hive-mind ] [ kwwolf ] [ peaceman ] [ svparijs ] 12:23 [+nslater ] [ Daviey ] [ Humbedooh ] [ L0u1s ] [ Popsikle ] [ T0by_ ] 12:23 [+rnewson|away ] [ dcl ] [ huslage ] [ l_fs_ ] [ pvde ] [ tellnes ] 12:23 [+Wohali ] [ Dedalo ] [ ikarus ] [ leptonix ] [ quiqua ] [ thomasvs ] 12:23 [ _janne ] [ destructure ] [ indutny ] [ marianoguerra ] [ RangeRick ] [ tmfsd_ ] 12:23 [ af ] [ dieswaytoofast__] [ ironfroggy ] [ marshall ] [ RetardedBear ] [ tobie_ ] 12:23 [ aj ] [ digilord ] [ irsol ] [ MatheusOl ] [ Rify ] [ tobmaster ] 12:23 [ akraut__ ] [ djcoin ] [ isaacs ] [ mike_k_ ] [ robertkowalski] [ tobyS ] 12:23 [ ASFBot ] [ djinni ] [ ixixi ] [ mikebreslin ] [ robfraz_away ] [ tomtomaso ] 12:23 [ astronouth7303] [ dpk ] [ izibi ] [ mikewallace ] [ rodasc ] [ topi` ] 12:23 [ banjiewen ] [ drdozer ] [ jabis ] [ mirkok ] [ rudasn ] [ uberjar ] 12:23 [ bartender ] [ dsantiago ] [ jakob- ] [ mkf ] [ RyanHirsch ] [ uris77_ ] 12:23 [ bedouin_ ] [ dsol ] [ JasonSmith_ ] [ mmalecki ] [ samsmith ] [ victor__ ] 12:23 [ berber ] [ dweremeichik ] [ jderose ] [ modafinil_ ] [ saurik ] [ vladan ] 12:23 [ bezik ] [ eaj ] [ jedgar ] [ mpw ] [ sbisbee ] [ wickedgrey_away] 12:23 [ blh42 ] [ edude03 ] [ jensnockert ] [ mrtazz ] [ SebastianFlyte] [ Will| ] 12:23 [ blyrone ] [ EnTeQuAk ] [ jjwatt ] [ muh-die-kuh ] [ shardz ] [ woody4u ] 12:23 [ calvinmetcalf ] [ eQQo ] [ jkarsrud ] [ naderman ] [ shaunbaker ] [ wookiehangover ] 12:23 [ chewbranca ] [ etrepum ] [ JPT ] [ Naked_ ] [ shrink0r ] [ wowi_ ] 12:23 [ chvck ] [ eXhumed ] [ js_ ] [ neo007 ] [ sidthekid_ ] [ x-tine ] 12:23 [ Cody ] [ eyebraus ] [ juanjoc ] [ niloc132 ] [ siel ] [ Xjs|moonshine ] 12:23 [ coffeejunk ] [ fiatjaf ] [ julianduque ] [ nisstyre ] [ skscharr ] [ yoleaux ] 12:23 [ commandoline ] [ flock3 ] [ jyahtthj ] [ nj3ma ] [ SlashLife ] [ zaphar_ps ] 12:23 -!- Irssi: #couchdb: Total of 180 nicks [1 ops, 0 halfops, 10 voices, 169 normal] 12:23 -!- Home page for #couchdb: http://couchdb.apache.org/ 12:23 -!- Channel #couchdb created Tue Sep 4 13:18:04 2007 12:24 -!- Irssi: Join to #couchdb was synced in 52 secs 13:21 < djcoin> I'm using provides('json', ...) and provides('html', ...) in a list function; I always get the json result (i'm using curl), how can I get the html version ? I tried curl -H 'Content-Type: text/html' 13:21 < djcoin> but I don't get better result 13:24 < djcoin> Ho nvm, I should have used "accept" 13:42 <+awenkhh> djcoin how does your request urt look like? 13:48 < djcoin> kandinski: it is ok now, I used accept as an header 13:49 < djcoin> I was mistakenly using Content-Type 13:49 < djcoin> By the way, I have another question, how can I require() html in couchdb ? 13:50 < djcoin> I saw that you would use couchapp for this, but I don't use it - furthermore it seems it was before commonjs require were introduced 13:50 < djcoin> What is the correct way to do this now ? 14:24 < fiatjaf> paldepind: in couchappy's fauxton that happens with me, but it works in futon 14:24 < fiatjaf> djcoin: it works out of the box, you don't need any couchapp tool ou compilator 14:25 < fiatjaf> you define a module, as a string, in some ddoc field, say, "lib": { "someModule": "module.exports = function () { ... }" }, then you can require('lib/someModule') from show and list functions. 14:31 <+bigbluehat> fiatjaf: you can also put them in views/lib for use in views fwiw 14:32 < fiatjaf> yes, yes, I was waiting for djcoin to read this first so he won't get confused 14:32 <+bigbluehat> :) 14:32 <+bigbluehat> good plan 14:35 < djcoin> bigbluehat: fiatjaf right, thanks :) 14:35 < djcoin> But my question was rather toward "requiring"html 14:36 < djcoin> I mean important some template, for example in a show function, using some template tools 14:36 < fiatjaf> for accessing html in lists and views you have the entire ddoc as a plain object 14:36 < fiatjaf> you get it as an argument 14:36 < djcoin> in the couchdb draft book, it uses a !json 14:36 < fiatjaf> and access any field, such as ddoc.templates.pageX 14:37 < djcoin> yes 14:37 < djcoin> Alright 14:38 < djcoin> BUt I wanted to know if there was any straight way to import html, otherwise I have to do exports = function() { return ['...'].join('') } 14:38 < djcoin> or something 14:38 < djcoin> (that could be automated easily) 14:39 < fiatjaf> djcoin: no, you don't need that 14:40 < fiatjaf> ok, I checked it 14:41 < fiatjaf> `this.templates.someHtml` will give you the string contents of "templates": { "someHtml": "..." } of the same design doc 14:42 < fiatjaf> require('...') would expect that that string would be a module definition, but simply accessing the key of the object will give its contents 14:43 < djcoin> Thanks fiatjaf 14:43 < fiatjaf> the same way require('lib/someModule') would give you a javascript module, this.lib.someModule will give you a string which reads "module.exports = function () { ... }", which is useless 14:43 < djcoin> And what would you use for escaping quote ( "" ) ? So you can put safely the content of your html in it 14:44 < fiatjaf> djcoin: why don't you want to use a couchapp tool? it will do everything for you. 14:44 < djcoin> fiatjaf: In fact i use kanso 14:44 < djcoin> But I wanted to know if there was a way to do this kind of stuff by hand also 14:45 < fiatjaf> oh, I can check what erica has done to my ddoc 14:52 < fiatjaf> nice, I don't have any example of template 14:56 < fiatjaf> djcoin: http://bpaste.net/show/k2OA3h0yiljUA4liQR4h/ 14:57 < fiatjaf> djcoin: some example of a couchapp with lists, views, templates and requires 14:57 < fiatjaf> djcoin: this is the entire ddoc 15:01 < djcoin> fiatjaf: seems well organized :) 15:02 < fiatjaf> it's not mine, it's an open source example that is cited in some wikis and tutorials :P 15:02 < djcoin> oh 15:02 < fiatjaf> the guys at couchappy created this database for me after a pointed a bug and they wanted me to see it was fixed 15:03 < djcoin> fiatjaf: if you have good reads or insights on how to build a nicely structured app, I'm all ears :) 15:05 < djcoin> Do people still use couchdb to build app ? 15:05 < djcoin> Most of the project I see have not been updated for 3 years or so 15:05 < fiatjaf> djcoin: I've been building some small couchapps using facebook's React, they use url routing, show and list functions to (server-)render React components at couchdb itself and then ajax calls to the same list/show functions to update the components on user interaction 15:06 < fiatjaf> I tried to explain my approach here: https://github.com/fiatjaf/reactive-couch 15:07 < fiatjaf> oh, well, you mean pure-couchdb apps? people talk about it in this channel often 15:08 < fiatjaf> https://github.com/benoitc/erica, the couchapp tool, is in constant development 15:08 < fiatjaf> I don't know about kanso, I never understood it 15:11 < fiatjaf> and there's PouchDB https://github.com/daleharvey/pouchdb which is an awesome revolutionary tool, is in constant development, and whose primary function it to work alongside a "pure" couch app (because it can only talk directly to couchdb) 15:24 < fiatjaf> I'm getting a "XMLHttpRequest cannot load https://fiatjaf.couchappy.com/p/_list/search/search?query. Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers." when making a request with ajax (superagent.js) from another page to couchappy 15:25 < fiatjaf> ok, found it 15:41 < djcoin> fiatjaf: how I use myself react 15:41 < djcoin> Jsut started too awesome :) 15:41 < djcoin> But I was a bit worried about performance as the lib is a bit large 15:42 < djcoin> no perf problem ? 15:42 < djcoin> I don't know about the performance of the js engine in couchdb 15:42 < djcoin> or the impact on memory etc. 15:42 < djcoin> Yeah and pouchdb seems nice too, I was following what folks in node/leveldb were using 15:42 < fiatjaf> I don't know also. I wish someone could tell me that. 15:43 < djcoin> and I happened to see this 15:43 < djcoin> fiatjaf: do you use pouchdb yourself ? 15:44 < djcoin> I know there are also some stuff with couchbase on android etc. don't remember if it is compatiable with couchdb 15:46 < fiatjaf> djcoin: I've used it, but not to any real project yet. 15:46 < fiatjaf> djcoin: althought this might happen soon 15:47 < djcoin> fiatjaf: :) great! And btw, mixing reactive and couch (well, reactive and server side in this case couch) must be awesome, nice projet 15:47 < djcoin> project* 15:47 < fiatjaf> what do you mean by "how I use myself react"? 15:49 < fiatjaf> react is not too big, but this also doesn't matter too much, I think. The point here is that the components are only rendered on the server once for each access, then every other rendering is done at the client. I think it is good, but has not been proven. 15:51 < djcoin> Sorry, I don't see where I said "how I use myself react" 15:51 < djcoin> Yeah, in my case I was thinking about react for rendering indeed but also for validation - didn't try yet either 15:55 < djcoin> fiatjaf: I see you use curl.js, any thought about browserify vs curljs ? 15:56 < fiatjaf> ahahah, why do you want my thoughts on everything? 15:57 < fiatjaf> I don't like node.js, and browserify is something made by node.js people, so I prefer AMD 15:57 < djcoin> Just because you try to make some couchapp and you use curl.js, just wanted to know why you went for this in this context 15:57 < djcoin> oh alright 15:57 < fiatjaf> I also don't like RequireJS, because their website is too pretentious, so curljs. 15:57 < djcoin> I will stop bothering you ;) 15:58 < fiatjaf> you can ask anything, I like talking about my opinions, like everyone does :P 15:58 < djcoin> :] 15:58 < fiatjaf> but I don't see how I could do this reactive-couch thing with browserify. 16:01 < djcoin> fiatjaf: you can't unless you pre-bundle the thing 16:01 < djcoin> I guess 16:08 < zathras_laptop> trying to use _all_docs with an if-modified-since header & xmlhttprequest results in a 405 error when the options is sent - is there a simple workaround? 16:23 <+rnewson> zathras_laptop: I don't think couchdb cares about if-modified-since at all, but what method were you using against _all_docs? 16:24 < zathras_laptop> it's just a get, but as i'm adding the header it trigger the "preflight" of cors and so an options is sent 16:24 < zathras_laptop> which then gives a 405 and the function stops :-( 16:34 <+rnewson> aha, so this is all a CORS issue 16:34 <+rnewson> sadly I know little about it or our implementation (cc chewbranca) 16:35 < chewbranca> zathras_laptop: rnewson: these are the headers we currently support: https://github.com/apache/couchdb/blob/master/src/couchdb/couch_httpd_cors.erl#L27-L30 16:36 < chewbranca> so you'll want to add the if-modified-since header to your config 16:36 < chewbranca> which reminds me we need to update that list of headers to include authorization, it's exclusion there is a bug 16:36 < zathras_laptop> chewbranca, can i do that via the configuration? 16:38 < chewbranca> zathras_laptop: yeah, you can set the headers options in your local ini file: http://docs.couchdb.org/en/latest/config/http.html#cross-origin-resource-sharing 16:38 < chewbranca> zathras_laptop: http://docs.couchdb.org/en/latest/config/http.html#cors/headers 16:38 < chewbranca> let me double check adding things there appends to the list, rather than replaces it 16:39 <+rnewson> zathras_laptop: as noted, if-modified-since does nothing to couchdb anyway, you want if-match on etags 16:40 < chewbranca> zathras_laptop: ahhh that's tedious, you'll need to copy over all the standard headers plus your additions 16:40 < chewbranca> it does a full replace, not an addition 16:40 < zathras_laptop> ok, but does the _all_docs endpoint respect the if-modified-since header? 16:40 <+rnewson> nothing in couchdb does. 16:40 < chewbranca> but, if you follow rnewson's advice and use "if-match", that's already in the headers and you don't need to change anything 16:41 <+rnewson> couchdb doesn't track physical time. 16:43 < zathras_laptop> chewbranca, hmm, so if i grab docs via _all_docs and then in an hour want to get newer ones, so do i do that? 16:43 <+rnewson> zathras_laptop: don't. use _changes and pass the since= parameter 16:44 < zathras_laptop> ok, will have a look - when i saw that earlier it didn't seem to do what i wanted 16:44 <+rnewson> maybe tell us what you wanted? :) 16:45 < zathras_laptop> rnewson, reading the docs again :-) may be back! 16:45 <+rnewson> sure thing 16:48 < zathras_laptop> rnewson, ok, so _changes will likely do what i need after all 16:48 < zathras_laptop> thanks 16:48 <+rnewson> great! 16:48 < zathras_laptop> btw, is since=0 valid for a new database? 16:48 <+rnewson> sure. 16:48 < zathras_laptop> thanks 16:54 < zathras_laptop> rnewson, made the changes and it seems to be working as i need :-) 16:54 <+rnewson> excellent, glad to hear it. and welcome to couchdb 16:54 < zathras_laptop> oh i've been dabbling for a while :-) 17:05 <+Wohali> yay 17:13 < isaacs> We're noticing that sometimes our replication hangs at 99% and never proceeds. (a) Is there anything that CouchDB says when replication hangs, and if so, where does it say it? (b) Is there any setting we can set to make CouchDB get crazy noisy when replication hangs/fails/etc, without being crazy noisy all the time when things are good and normal? 17:37 < isaacs> We have found that the only way to make it go good is to restart couchdb 17:37 < isaacs> And, obviously, that's kind of a crappy non-solution 18:01 <+dch> isaacs: I think the fixes we are doing now will likely solve your problem. 18:01 <+dch> the more logs you can share with me, the better I will be able to state that :-) 18:02 <+dch> I’m afk for a bit with family stuff btu if you want to poke me back later (or tomorrow morning) we can touch base. 18:03 <+dch> wrt to saying the replication is hung, I see it happening in a variety of places (not just 99%), 18:03 <+dch> I suspect that when it hangs there will be *some* things we can track, but they will not be exposed today. It’s a good idea BTW. 18:03 <+dch> bbl. 18:19 < isaacs> dch: there are no errors or anything interesting in the logs. just the standard expected stuff 18:21 <+dch> isaacs: what couch version are you running now? 18:22 <+dch> and what platform? 18:22 < isaacs> dch: 1.5.0 everywhere, latest spidermonkey. master is SmartOS, but the hanging replicas are linux 18:23 <+dch> ok 18:24 <+dch> could you run debugging (just for the replicator module) on one of those replicas? 18:24 <+dch> I will tell you how 18:24 <+dch> it can be done per module only now 18:26 < isaacs> dch: i'd love to 18:26 < isaacs> dch: probbly it'll be a few hours before it hangs again 18:27 <+dch> I guess you’re pushing a fair whack of data through these, yup? just beware logging will swallow disk space. 18:27 <+dch> isaacs: gimme about 10 minutes to dig this up for you 18:27 < isaacs> kk 18:28 < isaacs> dch: logging swalowin\\\\\\\\\\\ 18:28 < isaacs> ~> 18:29 < isaacs> gah 18:29 < isaacs> irc connection issues 18:32 < isaacs> dch: can you be more specific about roughly how much disk space you expect this logging to swallow? 18:32 <+Wohali> phrasing 18:32 * isaacs erhm... 18:33 <+Wohali> :P 18:33 <+Wohali> sorry just being puerile, don't mind me 18:33 < isaacs> dch: i mean, are we talking hundreds of mb's, or hundreds of gb's, or "better invest in a few extra disk drives" or what? 18:33 <+dch> isaacs: the former. 18:34 <+dch> in practical terms, you can leave a thing to disable the logging lurking in the background. 18:34 < isaacs> ok 18:34 < isaacs> we've got hundreds of MBs, no problem 19:28 <+dch> isaacs: 19:31 <+dch> you need to PUT “debug” to $COUCH/_config/log_level_by_module/couch_replicator 19:31 <+dch> I assume you have _config/log/level already at info or warning. 19:32 <+dch> to disable it, DELETE $COUCH/_config/log_level_by_module/couch_replicator 19:37 <+dch> isaacs: also, I need to know what erlang versions you are running at each end (smartos and linux) and what version of linux that is. 20:41 < isaacs> seldo: https://gist.github.com/isaacs/9629056 20:43 < seldo> dch: is there a fast way to get the version of erlang? 20:44 <+dch> GET / 20:44 <+dch> look in the headers 20:44 <+dch> seldo: aah you’re with isaacs ? 20:44 * dch waves 20:44 <+dch> e.g. Server: CouchDB/1.6.0+build. (Erlang OTP/17) 20:45 <+dch> what TZ are you in? 20:45 < seldo> Yes :-) 20:48 < seldo> dch: we are in PST 20:48 < seldo> Parent: Server: CouchDB/1.5.0 (Erlang OTP/R16B) 20:48 < seldo> Child: Server: CouchDB/1.5.0 (Erlang OTP/R14B04) 20:49 < seldo> Parent: SunOS 5.11 joyent_20131120T074720Z i86pc i386 i86pc Solaris 20:49 <+awenkhh> ping nslater 20:49 < seldo> Child: Ubuntu 12.04.4 LTS 20:49 <+nslater> awenkhh: pong 20:49 <+awenkhh> quick PM ;-) 20:52 < seldo> dch: ^ --- Log closed Wed Mar 19 00:00:17 2014