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

I'm Crashed Because this issue! #76

Open
hqsoft opened this issue Sep 7, 2016 · 2 comments
Open

I'm Crashed Because this issue! #76

hqsoft opened this issue Sep 7, 2016 · 2 comments
Assignees

Comments

@hqsoft
Copy link

hqsoft commented Sep 7, 2016

dear everyone:
I follow the tutorial at http://docs.basho.com/riak/kv/2.1.4/developing/usage/document-store/ , Step by Step Practice , when I've Post a request for store object , but the riak server respond 400 (Bad Request) , I review my code again and again , but no problem found . see below:

_riak = $riak; $this->_bucket = new Bucket($bucket, "cms"); $this->_location = new Riak\Location('blog1',$this->_bucket,"cms"); $this->_title = $title; $this->_author = $author; $this->_content = $content; $this->_keywords = $keywords; $this->_datePosted = $date; $this->_published = $published; } public function store() { $setBuilder = (new UpdateSet($this->_riak)); ``` foreach($this->_keywords as $keyword) { $setBuilder->add($keyword); } ``` /* (new UpdateMap($this->_riak)) ->updateRegister('title', $this->_title) ->updateRegister('author', $this->_author) ->updateRegister('content', $this->_content) ->updateRegister('date', $this->_datePosted) ->updateFlag('published', $this->_published) ->updateSet('keywords', $setBuilder) ->withBucket($this->_bucket) ->build() ->execute(); */ $response = (new UpdateMap($this->_riak)) ->updateRegister('title', $this->_title) ->updateRegister('author', $this->_author) ->updateRegister('content', $this->_content) ->updateRegister('date', $this->_datePosted) ->updateFlag('published', $this->_published) ->updateSet('keywords', $setBuilder) ->atLocation($this->_location) ->build() ->execute(); ``` echo '
'; var_dump($response); echo '
'; ``` } } $node = (new Node\Builder) ->atHost('192.168.111.2') ->onPort(8098) ->build(); ``` $riak = new Riak([$node]); ``` $keywords = ['adorbs', 'cheshire']; $date = new \DateTime('now'); $post1 = new BlogPost( $riak, 'cat_pics', // bucket 'This one is so lulz!', // title 'Cat Stevens', // author 'Please check out these cat pics!', // content $keywords, // keywords $date, // date posted true // published ); $post1->store(); the wireshark captured packet : 192.168.171.124(client ip) => 192.168.111.2(riak server ip) HTTP 511 POST /types/cms/buckets/cat_pics/datatypes/alldoc? HTTP/1.1 (application/json) 192.168.111.2 192.168.171.124 HTTP 251 HTTP/1.1 400 Bad Request GET http://192.168.111.2:8098//types/cms/buckets/cat_pics/props {"props":{"name":"cat_pics","young_vclock":20,"w":"quorum","small_vclock":50,"search_index":"blog_posts","rw":"quorum","r":"quorum","pw":0,"precommit":[],"pr":0,"postcommit":[],"old_vclock":86400,"notfound_ok":true,"n_val":3,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"last_write_wins":false,"dw":"quorum","dvv_enabled":true,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"big_vclock":50,"basic_quorum":false,"allow_mult":true,"datatype":"map","active":true,"claimant":"node1@192.168.111.1"}} ``` please help me catch the bugs thanks in advance! ``` regards
@lukebakken
Copy link

Hello, which PHP client library are you using?

@christophermancini
Copy link
Contributor

On the command builder, there is a withVerboseMode() which invokes verbose mode on cURL. Can you rerun it and share the output here?

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

No branches or pull requests

3 participants