dreipol / django-scarface

Send push notifications to mobile devices using Amazon SNS
MIT License
43 stars 21 forks source link

application_plattform.register(), with BotoServerError #2

Closed Dealers closed 9 years ago

Dealers commented 9 years ago

Additional help is needed... While this command is executed: application_plattform.register(), I am getting this error: Exception Type: BotoServerError Exception Value:

BotoServerError: 400 Bad Request {"Error":{"Code":"InvalidParameter","Message":"Invalid parameter: PlatformPrincipal not valid.","Type":"Sender"},"RequestId":"d027b359-0dd4-5296-9dd9-fe748596113c"} Exception Location: C:\Python27\lib\site-packages\boto\sns\connection.py in _make_request, line 765

Any idea? Thanks

philipplaeubli commented 9 years ago

Several things could cause this:

best wishes, phil

Dealers commented 9 years ago

Yes, i did all of these. Can it be something with boto?

‫ב-12 בינו׳ 2015, בשעה 12:29, ‏‏Philipp Läubli ‏notifications@github.com כתב/ה:‬

Several things could cause this:

Did you specify SCARFACE_APNS_CERTIFICATE and SCARFACE_APNS_PRIVATE_KEY in your settings (also see the extract_keys command as documented: http://django-scarface.readthedocs.org/) When SCARFACE_APNS_MODE = u"APNS_SANDBOX", is the certificate/private key from the sandbox enviromnent? best wishes, phil

— Reply to this email directly or view it on GitHub.

philipplaeubli commented 9 years ago

Maybe the AWS Credentials (AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) are invalid or do not have the permission to create an sns application or endpoint?

This example access-policy for your aws user should work:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "<SOME VALUE> ",
      "Effect": "Allow",
      "Action": [
        "sns:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

Any luck with this?

Dealers commented 9 years ago

No I already checked it...

‫ב-12 בינו׳ 2015, בשעה 12:56, ‏‏Philipp Läubli ‏notifications@github.com כתב/ה:‬

Maybe the AWS Credentials (AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) are invalid or do not have the permission to create an sns application or endpoint?

This example access-policy for your aws user should work:

{ "Version": "2012-10-17", "Statement": [ { "Sid": " ", "Effect": "Allow", "Action": [ "sns:" ], "Resource": [ "" ] } ] } Any luck with this?

— Reply to this email directly or view it on GitHub.

philipplaeubli commented 9 years ago

Hmmm.. tried to reproduce the error and I only get that error when the SCARFACE_APNS_CERTIFICATE/SCARFACE_APNS_PRIVATE_KEY are not correctly set. For reference the settings must look like this:

local_py_-_django-scarface_-____documents_repositories_django-scarface_

Dealers commented 9 years ago

Thanks a lot. Sorry for my late response… my variables looks similar except for the u”xxxx…”. (what this u”… “ for?) also, I set the (SCARFACE_LOGGING_ENABLED = True), to “True” and you have “false”.

philipplaeubli commented 9 years ago

The SCARFACE_LOGGING_ENABLED setting should not be the reason for your troubles. the u'xxx' this is just a way to declare a unicode string, see https://docs.python.org/2/howto/unicode.html and shouldn't be the problem either. Are you working in the apns sandbox or using a production environment? Does the problem only occur with apns?

philipplaeubli commented 9 years ago

and: have you tried to create the sns application directly in the AWS web console?

Dealers commented 9 years ago

Yes and it is working. The only differences with your example is :

my variables looks similar except for the u”xxxx…”. (what this u”… “ for?)

also, I set the (SCARFACE_LOGGING_ENABLED = True), to “True” and you have “false”.

Regards

Uzi Lumbroso

M +972-52-3330506

F +972-9-7710184

uzi@dealers-app.com

Skype: uzport

Logo_(full).png

http://www.dealers-app.com www.dealers-app.com

The information contained in this document is proprietary of Dealers©. It contains confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this document or communication in error, please return it to Dealers© and delete it from your computer. Thank you.

P Please consider the environment before printing this email

From: Philipp Läubli [mailto:notifications@github.com] Sent: Monday, January 12, 2015 7:07 PM To: dreipol/django-scarface Cc: Dealers Subject: Re: [django-scarface] application_plattform.register(), with BotoServerError (#2)

and: have you tried to create the sns application directly in the AWS web console?

— Reply to this email directly or view it on GitHub https://github.com/dreipol/django-scarface/issues/2#issuecomment-69604985 . https://github.com/notifications/beacon/AFtSyz9h8quWCwtp-RwU9DCpJeBv4jtNks5ng_argaJpZM4DRCtW.gif

Dealers commented 9 years ago

Yes, we are using the apns sandbox only right now so the problem only occur only with apns? If I use the Amazon SNS Dashboard it works OK with the same parameters.

philipplaeubli commented 9 years ago

hmm... i can't really imagine any other solution at the moment. If you want you can email me your settings and i can try to reproduce the error (you may want to replace the aws user you are using and generate a new certificate). you can send me a mail to phil@dreipol.ch

Dealers commented 9 years ago

Thanks Philipp. I will try few things and may send you my settings so you can try to reproduce

Regards

Uzi Lumbroso

M +972-52-3330506

F +972-9-7710184

uzi@dealers-app.com

Skype: uzport

Logo_(full).png

http://www.dealers-app.com www.dealers-app.com

The information contained in this document is proprietary of Dealers©. It contains confidential or privileged information, and is intended only for the use of the intended addressee thereof. If you are not the intended addressee, please be aware that any use, disclosure, distribution and/or copying of this communication is strictly prohibited. If you receive this document or communication in error, please return it to Dealers© and delete it from your computer. Thank you.

P Please consider the environment before printing this email

From: Philipp Läubli [mailto:notifications@github.com] Sent: Monday, January 12, 2015 7:32 PM To: dreipol/django-scarface Cc: Dealers Subject: Re: [django-scarface] application_plattform.register(), with BotoServerError (#2)

hmm... i can't really imagine any other solution at the moment. If you want you can email me your settings and i can try to reproduce the error (you may want to replace the aws user you are using and generate a new certificate). you can send me a mail to phil@dreipol.ch

— Reply to this email directly or view it on GitHub https://github.com/dreipol/django-scarface/issues/2#issuecomment-69609289 . https://github.com/notifications/beacon/AFtSy9AvYnGVdhH1hkxCzRIoB8_SrbDtks5ng_yCgaJpZM4DRCtW.gif

Dealers commented 9 years ago

Hi Philip

I sent an email to mailto:phil@dreipol.ch phil@dreipol.ch With my setting info

Regards

Uzi

From: Philipp Läubli [mailto:notifications@github.com] Sent: Monday, January 12, 2015 7:32 PM To: dreipol/django-scarface Cc: Dealers Subject: Re: [django-scarface] application_plattform.register(), with BotoServerError (#2)

hmm... i can't really imagine any other solution at the moment. If you want you can email me your settings and i can try to reproduce the error (you may want to replace the aws user you are using and generate a new certificate). you can send me a mail to phil@dreipol.ch

— Reply to this email directly or view it on GitHub https://github.com/dreipol/django-scarface/issues/2#issuecomment-69609289 . https://github.com/notifications/beacon/AFtSy9AvYnGVdhH1hkxCzRIoB8_SrbDtks5ng_yCgaJpZM4DRCtW.gif

melbic commented 9 years ago

I'll close this issue. If it isn't solved, please reopen.