You can also try to put the URL in quotes to avoid escaping problem. Where do you have pio_event_1 declared ? What are the events that you declared in engine.json ?
On Tue, Jan 31, 2017 at 9:41 PM, Tom Chan <[email protected]> wrote: > I feel like the error is not in the '-' vs '$', since from the error > message, PIO could tell its app id which means the access key is correct. > > On Tue, Jan 31, 2017 at 4:44 PM, Christopher Fifty <[email protected]> > wrote: > >> I think the error may be in your POST request: >> >> Try: >> >> curl -i -X POST http://localhost:7070/events.json\?accessKey\=$my-access- >> key \ >> >> -H "Content-Type: application/json" \ >> >> -d '{ >> >> "event" : "$set", >> >> "entityType" : "user", >> >> "entityId" : "u0" >> >> }' >> >> Replacing your "-" with a "$", where $my-access-key is a variable for the >> access key for one of your apps. >> >> >> Fifty >> >> On Tue, Jan 31, 2017 at 7:07 PM, Chan Lee <[email protected]> wrote: >> >>> That is strange. The event table should have been created when you run >>> `pio app new MyApp`. >>> >>> Could you try re-creating your app with `pio app new MyApp2 --verbose`, >>> and check that table "pio_event_<your_app_id>" has been created? >>> >>> On Tue, Jan 31, 2017 at 2:12 PM, Saarthak Chandra < >>> [email protected]> wrote: >>> >>>> I'm using postgresql >>>> I created the db called pio..using the created pio command... >>>> >>>> Not sure why the event table is not being created when I send the post >>>> request though .... >>>> >>>> On 31 Jan 2017 17:10, "Tom Chan" <[email protected]> wrote: >>>> >>>>> I don't have an answer from the top of my head, hope someone can chime >>>>> in and help. >>>>> >>>>> To help others debugging this, which database are you using >>>>> (PostgreSQL, MySQL or elasticsearch)? >>>>> >>>>> Tom >>>>> >>>>> On Tue, Jan 31, 2017 at 1:47 PM, Saarthak Chandra < >>>>> [email protected]> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I did create a new app, and used the access key when doing a post to >>>>>> the event server. >>>>>> When i run pio app list, I do see the app that I created here >>>>>> >>>>>> [INFO] [App$] MpApp | 1 | -my-access-key | (all) >>>>>> >>>>>> >>>>>> Post request I made from my terminal : >>>>>> >>>>>> curl -i -X POST http://localhost:7070/events.j >>>>>> son\?accessKey\=-my-access-key \ >>>>>> >>>>>> -H "Content-Type: application/json" \ >>>>>> >>>>>> -d '{ >>>>>> >>>>>> "event" : "$set", >>>>>> >>>>>> "entityType" : "user", >>>>>> >>>>>> "entityId" : "u0" >>>>>> >>>>>> }' >>>>>> >>>>>> >>>>>> Response I get : >>>>>> >>>>>> HTTP/1.1 500 Internal Server Error >>>>>> >>>>>> Server: spray-can/1.3.3 >>>>>> >>>>>> Date: Tue, 31 Jan 2017 21:46:24 GMT >>>>>> >>>>>> Content-Type: application/json; charset=UTF-8 >>>>>> >>>>>> Content-Length: 76 >>>>>> >>>>>> >>>>>> {"message":"ERROR: relation \"pio_event_1\" does not exist\n >>>>>> Position: 20"}*%* >>>>>> >>>>>> On a side note : I also checked to see that the event server was up : >>>>>> localhost:7070 : Shows the JSON {"status":"alive"} >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Jan 31, 2017 at 4:39 PM, Tom Chan <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> As a quick check, did you do >>>>>>> >>>>>>> pio app new MyApp1 >>>>>>> >>>>>>> and what's the output when you run >>>>>>> >>>>>>> pio app list >>>>>>> >>>>>>> ? and what's the POST request you're trying that returned error 500? >>>>>>> >>>>>>> Tom >>>>>>> >>>>>>> On Tue, Jan 31, 2017 at 12:48 PM, Saarthak Chandra < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I am currently using Postgresql , as my storage repo for event data. >>>>>>>> >>>>>>>> However, when i do a POST using curl, to the event server at >>>>>>>> 'localhost:7070', I get a Http 500 error saying : >>>>>>>> >>>>>>>> {"message":"ERROR: relation \"pio_event_1\" does not exist\n >>>>>>>> Position: 20"} >>>>>>>> Shouldn't the table/relation be created automatically, and then the >>>>>>>> data I posted be inserted ?? >>>>>>>> >>>>>>>> I was following along the tutorials here : >>>>>>>> http://predictionio.incubator.apache.org/templates/javaeco >>>>>>>> mmercerecommendation/quickstart/ >>>>>>>> >>>>>>>> Thanks for your help !! >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Saarthak Chandra , >>>>>> Masters in Computer Science, >>>>>> Cornell University. >>>>>> >>>>> >>>>> >>> >> >
