You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@predictionio.apache.org by Сергей Купрюшин <sk...@surfstudio.ru> on 2017/02/16 15:32:51 UTC

template-similar-product, import_eventserver error, status: 401 Invalid accessKey

Hi all!

I'm newbie in predictionio. I try to install test template similar-product,
and run all as describe in manual:
*1. pio template get apache/incubator-predictionio-template-similar-product
MySimilarProduct2*

*2. cd MySimilarProduct2*

*3. pio app new TestApp1*

> [INFO] [HBLEvents] The table pio_event:events_7 doesn't exist yet.
> Creating now...

[INFO] [App$] Initialized Event Store for this app ID: 7.

[INFO] [App$] Created new app:

[INFO] [App$]       Name: TestApp1

[INFO] [App$]         ID: 7

[INFO] [App$] Access Key: *<**My_Access_Key**>*


*4. pio build*

> [INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the
> current working directory to build.
> [INFO] [Console$] If the path above is incorrect, this process will fail.
> [INFO] [Console$] Uber JAR disabled. Making sure
> lib/pio-assembly-0.10.0-incubating.jar is absent.
> [INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt  package
> assemblyPackageDependency
> [INFO] [Console$] Build finished successfully.
> [INFO] [Console$] Looking for an engine...
> [INFO] [Console$] Found
> template-scala-parallel-similarproduct-assembly-0.1-SNAPSHOT-deps.jar
> [INFO] [Console$] Found
> template-scala-parallel-similarproduct_2.10-0.1-SNAPSHOT.jar
> [INFO] [RegisterEngine$] Registering engine *<some string>*
> [INFO] [Console$] Your engine is ready for training.


*5. python data/import_eventserver.py --access_key*
*Namespace(access_key='My_Access_Key', url='http://localhost:7070
<http://localhost:7070>'){u'status': u'alive'}Importing data...Set user
u1Traceback (most recent call last):  File "import_eventserver.py", line
73, in <module>    import_events(client)  File "import_eventserver.py",
line 24, in import_events    entity_id=user_id  File
"/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
247, in create_event    event_time).get_response()  File
"/usr/local/lib/python2.7/dist-packages/predictionio/connection.py", line
111, in get_response    self._response = self.rfunc(tmp_response)  File
"/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
122, in _acreate_resp    response.body))predictionio.NotCreatedError:
request: POST /events.json?accessKey=My_Access_Key {'entityId': 'u1',
'entityType': 'user', 'event': '$set', 'eventTime':
'2017-02-16T14:20:40.633+0000'}
/events.json?accessKey=My_Access_Key
?entityId=u1&entityType=user&event=%24set&eventTime=2017-02-16T14%3A20%3A40.633%2B0000
status: 401 body: {"message":"Invalid accessKey."}*


PIO version 0.10.0. Installed with HBASE and Elasticsearch. Make some
changes in installation script (install.sh in attachments). In base version
it install predictionio from develop branch, i make it for 0.10.0 version
and release/0.10.0 branch.

The 3 step (*3. pio app new TestApp1*) run 20-40 minutes. That's OK? With
MySQL that step was run for about 2 hours, and no result. So i try install
another engine.

My HW Google-cloud compute instance: n1-standard-2 (2 virtual CPU, 7,5 Gb
memory). OS: Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64).

What I do wrong? And what i can do for fix errors?
Thanks in advice.
-- 
*С уважением, *
*Купрюшин Сергей.*
  <http://surfstudio.ru>
*SurfStudio LLC*
*surfstudio.ru <http://surfstudio.ru/>*
Старший системный администратор
skype: skupryshin
тел.: +7-920-438-20-89

Re: template-similar-product, import_eventserver error, status: 401 Invalid accessKey

Posted by Сергей Купрюшин <sk...@surfstudio.ru>.
   - *pio status*

[INFO] [Console$] Inspecting PredictionIO...
> [INFO] [Console$] PredictionIO 0.10.0-incubating is installed at
> /root/PredictionIO
> [INFO] [Console$] Inspecting Apache Spark...
> [INFO] [Console$] Apache Spark is installed at
> /root/PredictionIO/vendors/spark-1.6.2
> [INFO] [Console$] Apache Spark 1.6.2 detected (meets minimum requirement
> of 1.3.0)
> [INFO] [Console$] Inspecting storage backend connections...
> [INFO] [Storage$] Verifying Meta Data Backend (Source: ELASTICSEARCH)...
> [INFO] [Storage$] Verifying Model Data Backend (Source: LOCALFS)...
> [INFO] [Storage$] Verifying Event Data Backend (Source: HBASE)...
> [INFO] [Storage$] Test writing to Event Store (App Id 0)...
> [INFO] [HBLEvents] The table pio_event:events_0 doesn't exist yet.
> Creating now...
> [INFO] [HBLEvents] Removing table pio_event:events_0...
> [INFO] [Console$] (sleeping 5 seconds for all messages to show up...)
> [INFO] [Console$] Your system is all ready to go.




   - *jps -l*

17216 org.elasticsearch.bootstrap.Elasticsearch
> 18144 sun.tools.jps.Jps
> 17308 org.apache.hadoop.hbase.master.HMaster
> 17614 org.apache.predictionio.tools.console.Console



   - *pio-start-all*

Starting Elasticsearch...
> Starting HBase...
> starting master, logging to
> /root/PredictionIO/vendors/hbase-1.2.2/bin/../logs/hbase-root-master-predictionio.out
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m;
> support was removed in 8.0
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
> MaxPermSize=128m; support was removed in 8.0
> Waiting 10 seconds for HBase to fully initialize...
> Starting PredictionIO Event Server...



   - *stop eventserver with kill** and run it manually:*

*${PIO_HOME}/bin/pio-daemon ${PIO_HOME}/eventserver.pid eventserver --ip
0.0.0.0 --port 7070*


   - *cat eventserver.pid*

*19243*



   - *netstat -anlp | grep 7070*

*tcp        0      0 0.0.0.0:7070 <http://0.0.0.0:7070>
>  0.0.0.0:*               LISTEN      19243/java*



   -  *ps aux | grep [e]ventserver*

*root     19243  6.5  3.3 6789876 258880 pts/1  Sl   08:10   0:09
> /usr/lib/jvm/java-8-oracle/bin/java -cp
> /root/PredictionIO/conf:/root/PredictionIO/plugins/*:/root/PredictionIO/lib/pio-assembly-0.10.0-incubating.jar:/root/PredictionIO/vendors/hbase-1.2.2/conf:/root/PredictionIO/lib/postgresql-9.4-1204.jdbc41.jar:/root/PredictionIO/lib/mysql-connector-java-5.1.37.jar
> -Xmx4g org.apache.predictionio.tools.console.Console eventserver --ip
> 0.0.0.0 --port 7070 --pio-home /root/PredictionIO*




   - *pio app list*

[INFO] [App$]                 Name |   ID |
>                       Access Key | Allowed Event(s)
> [INFO] [App$]               MyApp3 |    3 | some_key | (all)
> [INFO] [App$]        MySimilarApp1 |    5 | some_key | (all)
>
> *[INFO] [App$]             TestApp1 |    7 | MY_ACCESS_KEY | (all)*[INFO]
> [App$] Finished listing 6 app(s).




   - curl -i -X GET http://localhost:7070/

HTTP/1.1 200 OK
> Server: spray-can/1.3.3
> Date: Fri, 17 Feb 2017 08:19:33 GMT
> Content-Type: application/json; charset=UTF-8
> Content-Length: 18
> {"status":"alive"}


   - curl -i -X POST http://localhost:7070/events.json?accessKey=
   *MY_ACCESS_KEY*

HTTP/1.1 401 Unauthorized
> Server: spray-can/1.3.3
> Date: Fri, 17 Feb 2017 08:16:58 GMT
> Content-Type: application/json; charset=UTF-8
> Content-Length: 32
> {"message":"Invalid accessKey."}




This is some kind of magic. When i try run *python
data/import_eventserver.py --access_key **MY_ACCESS_KEY  *import was
successful.

> ...
> User u10 views item i18
> User u10 views item i29
> 160 events are imported.


I dont know what the difference. All apps now work. The problem is solved.

Thanks for help.






On Fri, Feb 17, 2017 at 7:26 AM, Kenneth Chan <ke...@apache.org> wrote:

> would you check if your access key is the same as the one you see in
>
> $pai app list
>
> ?
>
>
> On Thu, Feb 16, 2017 at 9:47 AM Pat Ferrel <pa...@occamsmachete.com> wrote:
>
>> Is the EventServer running?
>>
>>
>> On Feb 16, 2017, at 9:01 AM, Сергей Купрюшин <sk...@surfstudio.ru> wrote:
>>
>> yes, i try that.
>> And try insert *<**My_Access_Key**> *in script import_eventserver.py as
>> parameter: parser.add_argument('--access_key', default='*My_Access_Key*')
>>
>> curl return the same error.
>>
>>
>>
>> On Thu, Feb 16, 2017 at 7:28 PM, Daniel Gabrieli <
>> dgabrieli@salesforce.com> wrote:
>>
>> Are you actually providing your access key to the python command?  like:
>>
>> *python data/import_eventserver.py --access_key=* *<**My_Access_Key**>*
>>
>>
>>
>> On Thu, Feb 16, 2017 at 10:33 AM Сергей Купрюшин <sk...@surfstudio.ru>
>> wrote:
>>
>> Hi all!
>>
>> I'm newbie in predictionio. I try to install test template
>> similar-product, and run all as describe in manual:
>> *1. pio template get
>> apache/incubator-predictionio-template-similar-product MySimilarProduct2*
>>
>> *2. cd MySimilarProduct2*
>>
>> *3. pio app new TestApp1*
>>
>> [INFO] [HBLEvents] The table pio_event:events_7 doesn't exist yet.
>> Creating now...
>>
>> [INFO] [App$] Initialized Event Store for this app ID: 7.
>>
>> [INFO] [App$] Created new app:
>>
>> [INFO] [App$]       Name: TestApp1
>>
>> [INFO] [App$]         ID: 7
>>
>> [INFO] [App$] Access Key: *<**My_Access_Key**>*
>>
>>
>> *4. pio build*
>>
>> [INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the
>> current working directory to build.
>> [INFO] [Console$] If the path above is incorrect, this process will fail.
>> [INFO] [Console$] Uber JAR disabled. Making sure lib/pio-assembly-0.10.0-incubating.jar
>> is absent.
>> [INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt  package
>> assemblyPackageDependency
>> [INFO] [Console$] Build finished successfully.
>> [INFO] [Console$] Looking for an engine...
>> [INFO] [Console$] Found template-scala-parallel-
>> similarproduct-assembly-0.1-SNAPSHOT-deps.jar
>> [INFO] [Console$] Found template-scala-parallel-similarproduct_2.10-0.1-
>> SNAPSHOT.jar
>> [INFO] [RegisterEngine$] Registering engine *<some string>*
>> [INFO] [Console$] Your engine is ready for training.
>>
>>
>> *5. python data/import_eventserver.py --access_key*
>> *Namespace(access_key='My_Access_Key', url='http://localhost:7070
>> <http://localhost:7070/>'){u'status': u'alive'}Importing data...Set user
>> u1Traceback (most recent call last):  File "import_eventserver.py", line
>> 73, in <module>    import_events(client)  File "import_eventserver.py",
>> line 24, in import_events    entity_id=user_id  File
>> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
>> 247, in create_event    event_time).get_response()  File
>> "/usr/local/lib/python2.7/dist-packages/predictionio/connection.py", line
>> 111, in get_response    self._response = self.rfunc(tmp_response)  File
>> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
>> 122, in _acreate_resp    response.body))predictionio.NotCreatedError:
>> request: POST /events.json?accessKey=My_Access_Key {'entityId': 'u1',
>> 'entityType': 'user', 'event': '$set', 'eventTime':
>> '2017-02-16T14:20:40.633+0000'}
>> /events.json?accessKey=My_Access_Key ?entityId=u1&entityType=user&event=%24set&eventTime=2017-02-16T14%3A20%3A40.633%2B0000
>> status: 401 body: {"message":"Invalid accessKey."}*
>>
>>
>> PIO version 0.10.0. Installed with HBASE and Elasticsearch. Make some
>> changes in installation script (install.sh in attachments). In base version
>> it install predictionio from develop branch, i make it for 0.10.0 version
>> and release/0.10.0 branch.
>>
>> The 3 step (*3. pio app new TestApp1*) run 20-40 minutes. That's OK?
>> With MySQL that step was run for about 2 hours, and no result. So i try
>> install another engine.
>>
>> My HW Google-cloud compute instance: n1-standard-2 (2 virtual CPU, 7,5
>> Gb memory). OS: Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64).
>>
>> What I do wrong? And what i can do for fix errors?
>> Thanks in advice.
>> --
>> *С уважением, *
>> *Купрюшин Сергей.*
>>   <http://surfstudio.ru/>
>> *SurfStudio LLC*
>> *surfstudio.ru <http://surfstudio.ru/>*
>> Старший системный администратор
>> skype: skupryshin
>> тел.: +7-920-438-20-89 <+7%20920%20438-20-89>
>>
>>
>>
>>
>> --
>> *С уважением, *
>> *Купрюшин Сергей.*
>>   <http://surfstudio.ru/>
>> *SurfStudio LLC*
>> *surfstudio.ru <http://surfstudio.ru/>*
>> Старший системный администратор
>> skype: skupryshin
>> тел.: +7-920-438-20-89
>>
>>
>>


-- 
*С уважением, *
*Купрюшин Сергей.*
  <http://surfstudio.ru>
*SurfStudio LLC*
*surfstudio.ru <http://surfstudio.ru/>*
Старший системный администратор
skype: skupryshin
тел.: +7-920-438-20-89

Re: template-similar-product, import_eventserver error, status: 401 Invalid accessKey

Posted by Kenneth Chan <ke...@apache.org>.
would you check if your access key is the same as the one you see in

$pai app list

?


On Thu, Feb 16, 2017 at 9:47 AM Pat Ferrel <pa...@occamsmachete.com> wrote:

> Is the EventServer running?
>
>
> On Feb 16, 2017, at 9:01 AM, Сергей Купрюшин <sk...@surfstudio.ru> wrote:
>
> yes, i try that.
> And try insert *<**My_Access_Key**> *in script import_eventserver.py as
> parameter: parser.add_argument('--access_key', default='*My_Access_Key*')
>
> curl return the same error.
>
>
>
> On Thu, Feb 16, 2017 at 7:28 PM, Daniel Gabrieli <dgabrieli@salesforce.com
> > wrote:
>
> Are you actually providing your access key to the python command?  like:
>
> *python data/import_eventserver.py --access_key=* *<**My_Access_Key**>*
>
>
>
> On Thu, Feb 16, 2017 at 10:33 AM Сергей Купрюшин <sk...@surfstudio.ru> wrote:
>
> Hi all!
>
> I'm newbie in predictionio. I try to install test template
> similar-product, and run all as describe in manual:
> *1. pio template get
> apache/incubator-predictionio-template-similar-product MySimilarProduct2*
>
> *2. cd MySimilarProduct2*
>
> *3. pio app new TestApp1*
>
> [INFO] [HBLEvents] The table pio_event:events_7 doesn't exist yet.
> Creating now...
>
> [INFO] [App$] Initialized Event Store for this app ID: 7.
>
> [INFO] [App$] Created new app:
>
> [INFO] [App$]       Name: TestApp1
>
> [INFO] [App$]         ID: 7
>
> [INFO] [App$] Access Key: *<**My_Access_Key**>*
>
>
> *4. pio build*
>
> [INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the
> current working directory to build.
> [INFO] [Console$] If the path above is incorrect, this process will fail.
> [INFO] [Console$] Uber JAR disabled. Making sure
> lib/pio-assembly-0.10.0-incubating.jar is absent.
> [INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt  package
> assemblyPackageDependency
> [INFO] [Console$] Build finished successfully.
> [INFO] [Console$] Looking for an engine...
> [INFO] [Console$] Found
> template-scala-parallel-similarproduct-assembly-0.1-SNAPSHOT-deps.jar
> [INFO] [Console$] Found
> template-scala-parallel-similarproduct_2.10-0.1-SNAPSHOT.jar
> [INFO] [RegisterEngine$] Registering engine *<some string>*
> [INFO] [Console$] Your engine is ready for training.
>
>
> *5. python data/import_eventserver.py --access_key*
> *Namespace(access_key='My_Access_Key', url='http://localhost:7070
> <http://localhost:7070/>'){u'status': u'alive'}Importing data...Set user
> u1Traceback (most recent call last):  File "import_eventserver.py", line
> 73, in <module>    import_events(client)  File "import_eventserver.py",
> line 24, in import_events    entity_id=user_id  File
> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
> 247, in create_event    event_time).get_response()  File
> "/usr/local/lib/python2.7/dist-packages/predictionio/connection.py", line
> 111, in get_response    self._response = self.rfunc(tmp_response)  File
> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
> 122, in _acreate_resp    response.body))predictionio.NotCreatedError:
> request: POST /events.json?accessKey=My_Access_Key {'entityId': 'u1',
> 'entityType': 'user', 'event': '$set', 'eventTime':
> '2017-02-16T14:20:40.633+0000'}
> /events.json?accessKey=My_Access_Key ?entityId=u1&entityType=user&event=%24set&eventTime=2017-02-16T14%3A20%3A40.633%2B0000
> status: 401 body: {"message":"Invalid accessKey."}*
>
>
> PIO version 0.10.0. Installed with HBASE and Elasticsearch. Make some
> changes in installation script (install.sh in attachments). In base version
> it install predictionio from develop branch, i make it for 0.10.0 version
> and release/0.10.0 branch.
>
> The 3 step (*3. pio app new TestApp1*) run 20-40 minutes. That's OK? With
> MySQL that step was run for about 2 hours, and no result. So i try install
> another engine.
>
> My HW Google-cloud compute instance: n1-standard-2 (2 virtual CPU, 7,5 Gb
> memory). OS: Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64).
>
> What I do wrong? And what i can do for fix errors?
> Thanks in advice.
> --
> *С уважением, *
> *Купрюшин Сергей.*
>   <http://surfstudio.ru/>
> *SurfStudio LLC*
> *surfstudio.ru <http://surfstudio.ru/>*
> Старший системный администратор
> skype: skupryshin
> тел.: +7-920-438-20-89 <+7%20920%20438-20-89>
>
>
>
>
> --
> *С уважением, *
> *Купрюшин Сергей.*
>   <http://surfstudio.ru/>
> *SurfStudio LLC*
> *surfstudio.ru <http://surfstudio.ru/>*
> Старший системный администратор
> skype: skupryshin
> тел.: +7-920-438-20-89
>
>
>

Re: template-similar-product, import_eventserver error, status: 401 Invalid accessKey

Posted by Pat Ferrel <pa...@occamsmachete.com>.
Is the EventServer running?


On Feb 16, 2017, at 9:01 AM, Сергей Купрюшин <sk...@surfstudio.ru> wrote:

yes, i try that. 
And try insert <My_Access_Key> in script import_eventserver.py as parameter: parser.add_argument('--access_key', default='My_Access_Key')

curl return the same error.



On Thu, Feb 16, 2017 at 7:28 PM, Daniel Gabrieli <dgabrieli@salesforce.com <ma...@salesforce.com>> wrote:
Are you actually providing your access key to the python command?  like:

python data/import_eventserver.py --access_key= <My_Access_Key>



On Thu, Feb 16, 2017 at 10:33 AM Сергей Купрюшин <sk@surfstudio.ru <ma...@surfstudio.ru>> wrote:
Hi all!

I'm newbie in predictionio. I try to install test template similar-product, and run all as describe in manual:
1. pio template get apache/incubator-predictionio-template-similar-product MySimilarProduct2

2. cd MySimilarProduct2

3. pio app new TestApp1
[INFO] [HBLEvents] The table pio_event:events_7 doesn't exist yet. Creating now...
[INFO] [App$] Initialized Event Store for this app ID: 7.
[INFO] [App$] Created new app:
[INFO] [App$]       Name: TestApp1
[INFO] [App$]         ID: 7
[INFO] [App$] Access Key: <My_Access_Key>

4. pio build
[INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the current working directory to build.
[INFO] [Console$] If the path above is incorrect, this process will fail.
[INFO] [Console$] Uber JAR disabled. Making sure lib/pio-assembly-0.10.0-incubating.jar is absent.
[INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt  package assemblyPackageDependency
[INFO] [Console$] Build finished successfully.
[INFO] [Console$] Looking for an engine...
[INFO] [Console$] Found template-scala-parallel-similarproduct-assembly-0.1-SNAPSHOT-deps.jar
[INFO] [Console$] Found template-scala-parallel-similarproduct_2.10-0.1-SNAPSHOT.jar
[INFO] [RegisterEngine$] Registering engine <some string>
[INFO] [Console$] Your engine is ready for training.
 
5. python data/import_eventserver.py --access_key
Namespace(access_key='My_Access_Key', url='http://localhost:7070 <http://localhost:7070/>')
{u'status': u'alive'}
Importing data...
Set user u1
Traceback (most recent call last):
  File "import_eventserver.py", line 73, in <module>
    import_events(client)
  File "import_eventserver.py", line 24, in import_events
    entity_id=user_id
  File "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line 247, in create_event
    event_time).get_response()
  File "/usr/local/lib/python2.7/dist-packages/predictionio/connection.py", line 111, in get_response
    self._response = self.rfunc(tmp_response)
  File "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line 122, in _acreate_resp
    response.body))
predictionio.NotCreatedError: request: POST /events.json?accessKey=My_Access_Key {'entityId': 'u1', 'entityType': 'user', 'event': '$set', 'eventTime': '2017-02-16T14:20:40.633+0000'} /events.json?accessKey=My_Access_Key ?entityId=u1&entityType=user&event=%24set&eventTime=2017-02-16T14%3A20%3A40.633%2B0000 status: 401 body: {"message":"Invalid accessKey."}


PIO version 0.10.0. Installed with HBASE and Elasticsearch. Make some changes in installation script (install.sh in attachments). In base version it install predictionio from develop branch, i make it for 0.10.0 version and release/0.10.0 branch.

The 3 step (3. pio app new TestApp1) run 20-40 minutes. That's OK? With MySQL that step was run for about 2 hours, and no result. So i try install another engine.

My HW Google-cloud compute instance: n1-standard-2 (2 virtual CPU, 7,5 Gb memory). OS: Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64).

What I do wrong? And what i can do for fix errors?
Thanks in advice.
-- 
С уважением, 
Купрюшин Сергей.
  <http://surfstudio.ru/>
SurfStudio LLC
surfstudio.ru <http://surfstudio.ru/>
Старший системный администратор
skype: skupryshin
тел.: +7-920-438-20-89 <tel:+7%20920%20438-20-89>




-- 
С уважением, 
Купрюшин Сергей.
  <http://surfstudio.ru/>
SurfStudio LLC
surfstudio.ru <http://surfstudio.ru/>
Старший системный администратор
skype: skupryshin
тел.: +7-920-438-20-89



Re: template-similar-product, import_eventserver error, status: 401 Invalid accessKey

Posted by Сергей Купрюшин <sk...@surfstudio.ru>.
yes, i try that.
And try insert *<**My_Access_Key**> *in script import_eventserver.py as
parameter: parser.add_argument('--access_key', default='*My_Access_Key*')

curl return the same error.



On Thu, Feb 16, 2017 at 7:28 PM, Daniel Gabrieli <dg...@salesforce.com>
wrote:

> Are you actually providing your access key to the python command?  like:
>
> *python data/import_eventserver.py --access_key=* *<**My_Access_Key**>*
>
>
>
> On Thu, Feb 16, 2017 at 10:33 AM Сергей Купрюшин <sk...@surfstudio.ru> wrote:
>
>> Hi all!
>>
>> I'm newbie in predictionio. I try to install test template
>> similar-product, and run all as describe in manual:
>> *1. pio template get
>> apache/incubator-predictionio-template-similar-product MySimilarProduct2*
>>
>> *2. cd MySimilarProduct2*
>>
>> *3. pio app new TestApp1*
>>
>> [INFO] [HBLEvents] The table pio_event:events_7 doesn't exist yet.
>> Creating now...
>>
>> [INFO] [App$] Initialized Event Store for this app ID: 7.
>>
>> [INFO] [App$] Created new app:
>>
>> [INFO] [App$]       Name: TestApp1
>>
>> [INFO] [App$]         ID: 7
>>
>> [INFO] [App$] Access Key: *<**My_Access_Key**>*
>>
>>
>> *4. pio build*
>>
>> [INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the
>> current working directory to build.
>> [INFO] [Console$] If the path above is incorrect, this process will fail.
>> [INFO] [Console$] Uber JAR disabled. Making sure lib/pio-assembly-0.10.0-incubating.jar
>> is absent.
>> [INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt  package
>> assemblyPackageDependency
>> [INFO] [Console$] Build finished successfully.
>> [INFO] [Console$] Looking for an engine...
>> [INFO] [Console$] Found template-scala-parallel-
>> similarproduct-assembly-0.1-SNAPSHOT-deps.jar
>> [INFO] [Console$] Found template-scala-parallel-similarproduct_2.10-0.1-
>> SNAPSHOT.jar
>> [INFO] [RegisterEngine$] Registering engine *<some string>*
>> [INFO] [Console$] Your engine is ready for training.
>>
>>
>> *5. python data/import_eventserver.py --access_key*
>> *Namespace(access_key='My_Access_Key', url='http://localhost:7070
>> <http://localhost:7070>'){u'status': u'alive'}Importing data...Set user
>> u1Traceback (most recent call last):  File "import_eventserver.py", line
>> 73, in <module>    import_events(client)  File "import_eventserver.py",
>> line 24, in import_events    entity_id=user_id  File
>> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
>> 247, in create_event    event_time).get_response()  File
>> "/usr/local/lib/python2.7/dist-packages/predictionio/connection.py", line
>> 111, in get_response    self._response = self.rfunc(tmp_response)  File
>> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
>> 122, in _acreate_resp    response.body))predictionio.NotCreatedError:
>> request: POST /events.json?accessKey=My_Access_Key {'entityId': 'u1',
>> 'entityType': 'user', 'event': '$set', 'eventTime':
>> '2017-02-16T14:20:40.633+0000'}
>> /events.json?accessKey=My_Access_Key ?entityId=u1&entityType=user&event=%24set&eventTime=2017-02-16T14%3A20%3A40.633%2B0000
>> status: 401 body: {"message":"Invalid accessKey."}*
>>
>>
>> PIO version 0.10.0. Installed with HBASE and Elasticsearch. Make some
>> changes in installation script (install.sh in attachments). In base version
>> it install predictionio from develop branch, i make it for 0.10.0 version
>> and release/0.10.0 branch.
>>
>> The 3 step (*3. pio app new TestApp1*) run 20-40 minutes. That's OK?
>> With MySQL that step was run for about 2 hours, and no result. So i try
>> install another engine.
>>
>> My HW Google-cloud compute instance: n1-standard-2 (2 virtual CPU, 7,5
>> Gb memory). OS: Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64).
>>
>> What I do wrong? And what i can do for fix errors?
>> Thanks in advice.
>> --
>> *С уважением, *
>> *Купрюшин Сергей.*
>>   <http://surfstudio.ru>
>> *SurfStudio LLC*
>> *surfstudio.ru <http://surfstudio.ru/>*
>> Старший системный администратор
>> skype: skupryshin
>> тел.: +7-920-438-20-89 <+7%20920%20438-20-89>
>>
>>


-- 
*С уважением, *
*Купрюшин Сергей.*
  <http://surfstudio.ru>
*SurfStudio LLC*
*surfstudio.ru <http://surfstudio.ru/>*
Старший системный администратор
skype: skupryshin
тел.: +7-920-438-20-89

Re: template-similar-product, import_eventserver error, status: 401 Invalid accessKey

Posted by Daniel Gabrieli <dg...@salesforce.com>.
Are you actually providing your access key to the python command?  like:

*python data/import_eventserver.py --access_key=* *<**My_Access_Key**>*



On Thu, Feb 16, 2017 at 10:33 AM Сергей Купрюшин <sk...@surfstudio.ru> wrote:

> Hi all!
>
> I'm newbie in predictionio. I try to install test template
> similar-product, and run all as describe in manual:
> *1. pio template get
> apache/incubator-predictionio-template-similar-product MySimilarProduct2*
>
> *2. cd MySimilarProduct2*
>
> *3. pio app new TestApp1*
>
> [INFO] [HBLEvents] The table pio_event:events_7 doesn't exist yet.
> Creating now...
>
> [INFO] [App$] Initialized Event Store for this app ID: 7.
>
> [INFO] [App$] Created new app:
>
> [INFO] [App$]       Name: TestApp1
>
> [INFO] [App$]         ID: 7
>
> [INFO] [App$] Access Key: *<**My_Access_Key**>*
>
>
> *4. pio build*
>
> [INFO] [Console$] Using command '/root/PredictionIO/sbt/sbt' at the
> current working directory to build.
> [INFO] [Console$] If the path above is incorrect, this process will fail.
> [INFO] [Console$] Uber JAR disabled. Making sure
> lib/pio-assembly-0.10.0-incubating.jar is absent.
> [INFO] [Console$] Going to run: /root/PredictionIO/sbt/sbt  package
> assemblyPackageDependency
> [INFO] [Console$] Build finished successfully.
> [INFO] [Console$] Looking for an engine...
> [INFO] [Console$] Found
> template-scala-parallel-similarproduct-assembly-0.1-SNAPSHOT-deps.jar
> [INFO] [Console$] Found
> template-scala-parallel-similarproduct_2.10-0.1-SNAPSHOT.jar
> [INFO] [RegisterEngine$] Registering engine *<some string>*
> [INFO] [Console$] Your engine is ready for training.
>
>
> *5. python data/import_eventserver.py --access_key*
> *Namespace(access_key='My_Access_Key', url='http://localhost:7070
> <http://localhost:7070>'){u'status': u'alive'}Importing data...Set user
> u1Traceback (most recent call last):  File "import_eventserver.py", line
> 73, in <module>    import_events(client)  File "import_eventserver.py",
> line 24, in import_events    entity_id=user_id  File
> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
> 247, in create_event    event_time).get_response()  File
> "/usr/local/lib/python2.7/dist-packages/predictionio/connection.py", line
> 111, in get_response    self._response = self.rfunc(tmp_response)  File
> "/usr/local/lib/python2.7/dist-packages/predictionio/__init__.py", line
> 122, in _acreate_resp    response.body))predictionio.NotCreatedError:
> request: POST /events.json?accessKey=My_Access_Key {'entityId': 'u1',
> 'entityType': 'user', 'event': '$set', 'eventTime':
> '2017-02-16T14:20:40.633+0000'}
> /events.json?accessKey=My_Access_Key ?entityId=u1&entityType=user&event=%24set&eventTime=2017-02-16T14%3A20%3A40.633%2B0000
> status: 401 body: {"message":"Invalid accessKey."}*
>
>
> PIO version 0.10.0. Installed with HBASE and Elasticsearch. Make some
> changes in installation script (install.sh in attachments). In base version
> it install predictionio from develop branch, i make it for 0.10.0 version
> and release/0.10.0 branch.
>
> The 3 step (*3. pio app new TestApp1*) run 20-40 minutes. That's OK? With
> MySQL that step was run for about 2 hours, and no result. So i try install
> another engine.
>
> My HW Google-cloud compute instance: n1-standard-2 (2 virtual CPU, 7,5 Gb
> memory). OS: Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64).
>
> What I do wrong? And what i can do for fix errors?
> Thanks in advice.
> --
> *С уважением, *
> *Купрюшин Сергей.*
>   <http://surfstudio.ru>
> *SurfStudio LLC*
> *surfstudio.ru <http://surfstudio.ru/>*
> Старший системный администратор
> skype: skupryshin
> тел.: +7-920-438-20-89 <+7%20920%20438-20-89>
>
>