adonespitogo / AdoBot-IO

AdoBot NodeJS Server with socket.io
https://github.com/adonespitogo/AdoBot
MIT License
199 stars 160 forks source link

heroku and remote sql #14

Open alirezaac opened 5 years ago

alirezaac commented 5 years ago

I managed to set it up with some remote MySQL to use Heroku without a credit card. it works normally on localhost with a remote database but on Heroku when there are updates there is no sequelize message on the logs bot the message from the client is receiving.

019-04-09T02:44:23.544597+00:00 app[web.1]: path: //message

2019-04-09T02:44:23.544618+00:00 app[web.1]: query:

2019-04-09T02:44:23.544699+00:00 app[web.1]: {}

2019-04-09T02:44:23.544704+00:00 app[web.1]: body:

2019-04-09T02:44:23.544792+00:00 app[web.1]: { thread_id: '2',

2019-04-09T02:44:23.544793+00:00 app[web.1]:   date: '2019-04-09 07:14:21',

2019-04-09T02:44:23.544794+00:00 app[web.1]:   message_id: '16',

2019-04-09T02:44:23.544795+00:00 app[web.1]:   phone: '+1893565625552',

2019-04-09T02:44:23.544797+00:00 app[web.1]:   uid: 'd850e64d38de7872',

2019-04-09T02:44:23.544798+00:00 app[web.1]:   message: 'asda',

2019-04-09T02:44:23.544799+00:00 app[web.1]:   type: '2' }

2019-04-09T02:44:23.544802+00:00 app[web.1]: ----------------------------

2019-04-09T02:44:23.543556+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=c9086db5-8670-4b22-a853-df20eac904a3 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

and on get message i get the same heroku router error


2019-04-09T02:44:06.957309+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=ead69a6c-4c0b-4a02-8b29-555f1c7a3ecd fwd="109.202.101.34" dyno=web.1 connect=0ms service=1ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.956390+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=c54686c8-a9a1-4886-a649-a13396bd7b25 fwd="109.202.101.34" dyno=web.1 connect=0ms service=1ms status=404 bytes=392 protocol=http

2019-04-09T02:44:01.567390+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=533b7129-6e0e-48b5-bfcd-35b3f5bc89c7 fwd="109.202.101.34" dyno=web.1 connect=0ms service=1ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.518105+00:00 heroku[router]: at=info method=POST path="//notify" host=wispwi.herokuapp.com request_id=44f30ba4-fe7d-430b-8cf4-7086d560cd9d fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=391 protocol=http

2019-04-09T02:44:06.554555+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=bfc13ea6-2f36-4699-a456-780c55dcea36 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.573690+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=7ff9d232-bbaf-43b9-b605-a2f299750ce4 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.542827+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=2aad28d8-07c6-49dc-b19e-d8d3f56f4244 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:01.452157+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=9245007d-4e88-4db5-832e-7640405fb7ef fwd="109.202.101.34" dyno=web.1 connect=0ms service=3ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.511860+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=e1c0f358-d0f9-4c35-ada2-f204bcea8b9a fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:01.513165+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=af7ad076-bda8-44a3-abd9-49c693342e36 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:01.476299+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=1e74b6cb-49d6-4020-9f16-205728afa447 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.499244+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=08d8defa-c659-4ef4-8c6f-0bd9ffdb112f fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:01.582004+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=32b37549-9153-44cc-86ea-907e4d9b1d66 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

2019-04-09T02:44:06.514967+00:00 heroku[router]: at=info method=POST path="//notify" host=wispwi.herokuapp.com request_id=8283e851-73f1-4c1e-9e4d-246384d16be8 fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=391 protocol=http

2019-04-09T02:44:06.547959+00:00 heroku[router]: at=info method=POST path="//message" host=wispwi.herokuapp.com request_id=e36e5e90-d0fd-4cc0-8717-5d48acb68edb fwd="109.202.101.34" dyno=web.1 connect=0ms service=2ms status=404 bytes=392 protocol=http

is it from the remote database or using free Heroku account, and from heroku it can fetch old data from database or update status so it connects to it

alirezaac commented 5 years ago

ok, it seems related to routing and Heroku(only routes from the Android client) and looks like it occurs a lot(react,. . . ), in all of them everything works great on local or other environments. to work around, I just added a slash to post paths of android routes but I didn't make time to investigate the code.

alirezaac commented 5 years ago

it was a trailing slash you can close the issue