Google Cloud Messaging Returns 'to' on localhost - google-app-engine

I am trying to send out a push notification through Google cloud messaging and using this as a guide
https://developers.google.com/web/fundamentals/getting-started/push-notifications/?hl=en
I get the endpoint from chrome but when I try to do a CURL call to the endpoint id (using my project number in the manifest file, and my api key), I don't get a meaningful message back. Not even a error.
All I get is 'to' as output. I am using CURL on Windows so I don't know if there is any additional info in the headers (is there?).
Has anyone any clue what 'to' is, and what can I do to fix this.
I am running this test on my localhost on an apache server.
Thanks

Related

How to solve net::ERR_SSL_PROTOCOL_ERROR?

The error shown in this image
I just made a simple landing page with Nestjs (backend), Reactjs (frontend) and using graphql for API and deployed on AWS EC2. (The error says, "POST https://[our public address]:[end point port number]/graphql net::ERR_SSL_PROTOCOL_ERROR")
And I set up a proxy server with Nginx and put SSL with Let's encrypt.
It was fine submitting a form (just simple email info) and got them in our database (PostgreSQL) and as soon as I got the SSL implemented in NginX.
We are getting that error.
Can anyone help us to solve this error please?
tried making https protocol for backend following this official doc https://docs.nestjs.com/faq/multiple-servers#https does not seem to work and I am not sure if this is necessary to do to be honest.
The current NginX set up
Not sure if I have to do somethings on this Nginx setup.

404 when requesting to issue token | ActiveCollab API

I can successfully login using this endpoint.
POST https://activecollab.com/api/v1/external/login
However when I try to issue a token I get a 404 not found. I have tried providing an app name and vendor name, I also tried omitting these fields and I still get a 404.
Are they found in our AC account somewhere? Because we cannot seem to find them.
Any assistance would be much appreciated.
Context: I have been testing through ARC (rest client) and intend to use the api in an electron desktop application. So unfortunately the feather sdk is not really useful. I have also looked into using the NodeJS sdk but unfortunately that also returns a 404.

npm sync-request: NetworkError: Failed to execute 'send' on 'XMLHttpRequest'

I'm studying about ReactJS and during my research I got stuck in middle of this untraceable issue. The idea is to present information on browser screen fetched from Database. I've chosen WebAPI to serve as a channel for communicating with database. The API implementation is working as expected, I tested it using Postman.
But I'm encountering the subjected error when I try to access API through Reducer (React-Redux implementation), please refer below screenshot.
It seems to me a CORS (Cross-Origin Resource Sharing) issue, as both API & ReactJS app running on localhost using different ports, but I'm not sure. In either case, please help me get to the solution.

smtp sendmail in Dockerised Golang Web App in GAE doesn't work

I have a dockerised web app deployed on GAE wriiten in Go. The payment module uses stripe checkout API and on success triggers an email notification.
On debugging, I observe that the following line of code is not executed. I have tried port 587 and the result is the same.
err := smtp.SendMail("smtp.gmail.com:465", auth, from, []string{to}, []byte(msg))
I have the same app on my local m/c and this feature works on it. Am not using docker on my local m/c though.
I am using the same user credentials as my GAE account in the 'from' user fields. Could that be the reason that the code fails. Or should the smtp service auth parameters along with the port to be exposed be described in the dockerfile. What would be the correct way to map port 465 or 587 in GAE given that only 4 ports are available?
I am using Golang image 1.7.1
docker logs doesn't show any errors. But the email doesn't get sent.
etc/resolv.conf of the container has the following DNS entries
search c.cloud-devshell-prod.internal. google.internal.
nameserver 169.254.169.254
options: ndots5
Would appreciate any suggestions..
Thanks
Followed instructions on the link
https://cloud.google.com/appengine/docs/flexible/go/sending-emails-with-mailgun
Set up and account with mailgun and got it to work. Mails get sent after running docker.

gsutil notification watchbucket returns "BadRequestException: 400 No valid domain for WebHook callback: https://https://..."

Following the instructions in https://cloud.google.com/storage/docs/object-change-notification#_Authorize_Endpoint I'm trying to set a watchbucket notification.
I'm running:
gsutil notification watchbucket https://-------.appspot.com gs://-----
(with my real application id and bucket)
The error string reported by gsutil suggest an internal bug:
BadRequestException: 400 No valid domain for WebHook callback: https://https://...
Note the double https:// in the error report
trying to remove the https:// ends with an error:
CommandException: The application URL must be an https:// URL.
I believe I've done all the things needed. I'm working with a service account of the application. the application URL is listed in https://console.developers.google.com/project/ywz-gcs-watch/apiui/notification. The service account has access to the watch bucket (tried it also with a bucket belong to the application project)
Is that a gsutil bug?
I've faced the exactly same problem here. The issue was that my allowed domain was registered like 'https://example.com' while it should be 'example.com'.
Go to your google developer console and open your project page.
In the sidebar on the left, click APIs & auth, then click Push.
Double check if your domain is correct. If not, enter just the domain without the protocol part and wait a few minutes before test again. Hope it helps!
Kindly Regards,
Vinícius Miasato

Resources