Deploying TelegramBot(Rust) using Heroku - heroku

Okay to start with-
I am building a Telegram bot for scanning my location for covid vaccine availability.
The source code is available here
The program works fine on my PC and I wanted to upload it on a server.
So I found a tutorial online to upload python-based web apps to Heroku to get insight into Heroku.
I made the mistake of creating a python environment for a rust app(forgive me, I am just a beginner).
Then I fixed it by undoing the changes to the best of my knowledge.
Then I learned that Rust requires a buildpack and then I implemented it(hopefully).
Then finally I learned of the importance of Procfile and made this (I really hope I didn't get the Procfile wrong).
release: export TELOXIDE_TOKEN=*********
release: export CHANNEL_ID=********
release: export OWNER_ID=*********
release: cargo run
I dint create a "web" process type cuz I think it's only needed when you have a web interface or require Heroku to accept from one.
A Heroku app’s web process type is special: it’s the only process type that can receive external HTTP traffic from Heroku’s routers. If your app includes a web server, you should declare it as your app’s web process.
got this from the documentation
Now the problem is that Heroku is showing me this error code while I try to open the app.
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
I figured this was because I was not using any web interface.
Then I checked the log files and this happened
2021-05-23T13:35:09.287511+00:00 heroku[router]: at=error code=H14 desc="No web processes running"
method=GET path="/favicon.ico" host=pure-stream-48197.herokuapp.com request_id=8859d568-2f24-4f83-
b9c8-45e8603a373a fwd="116.68.99.130" dyno= connect= service= status=503 bytes= protocol=https
I tried specifying dyno
and also rechecked my "P"rocfile's extension"no extension"
I am getting the fundamentals wrong somewhere and not sure what I am doing wrong.
Thank you for helping me out

You need to run a worker: dyno.
Please update your Procfile to the following content.
release: export TELOXIDE_TOKEN=*********
release: export CHANNEL_ID=********
release: export OWNER_ID=*********
worker: cargo run

Related

Cannot change dynos on Heroku dashboard

After having used the Heroku server successfully many times now I am consistently getting this error:
at=error code=H14 desc="No web processes running" method=GET path="/" host=rand-dyl-test.herokuapp.com request_id=b900df9f-c6cc-4b5e-a776-aff2ce92fd35 fwd="134.117.121.232" dyno= connect= service= status=503 bytes= protocol=https
From what I understand this is something related to the dynos, but I cannot adjust these in the configuration on oTree hub or from the dashboard on Heroku.
I have tried some things that I saw suggest online regarding the Procfile but this is, frankly, over my head. I am really at a loss for what to do next. Does anyone have any ideas?
As you are mentioning the Procfile, you may find it very useful to create one to see if that fixes the part of No web processes running.
A Procfile are just the commands your Dynos are going to execute in order to boot up your program, you can create one by just naming it “Procfile” and placing it on the root of your project folder.
For example, if you have a Node.js app or similar:
Worker: npm run deploy
This will create a Worker Dyno that deploys the app whenever a new version is created.
You may also need to manually activate your Dyno on your Dashboard to make sure it is running.
You can read more about the Procfile here

How to enter commands in heroku?

I have been struggling to host a strapi for development use. I have deployed the app using strapi's Heroku template link=https://github.com/strapi/strapi-heroku-template. Everything worked fine it got deployed. But my issue is that i wanna stop the server and enter yarn develop because it's running in production mode and i can't build amy collection in strapi. Please tell me how to do that . This is my first deployement on heroku that's why i am asking for help .
MY link to the app is
https://strapionheroku.herokuapp.com/
Please tell me. And thanks
Strapi one click heroku deploy template

Using actix-web with HTTP2 support in Heroku

I am trying to deploy one of the actix-web examples that offers HTTP/2 support in Heroku, after having slightly modified it to listen at the provided $PORT number, as well as the way in which certs are loaded -- rather than read from a file, it obtains the public and private key from the environment.
The problem is that, on each request, the Heroku router logs that the connection is closed without a response.
heroku[router]:
at=error
code=H13
desc="Connection closed without response"
method=GET
status=503
bytes=0
protocol=https
As it worked locally, I suspect the issue is at my dyno's configuration, which is a Hobby ($7/mo), especially at the certs section. As the application expects to receive the cert info from the environmental variables and having that Heroku does not provide you access to their certificates (e.g cert for xxxxx.herokuapp.com), I bought a domain name with the hopes of generating my own. I did, using the following page.
With a self-generated cert, I've tried so far the following, resulting in any of cases in the following errors:
To provide the same pair of keys to the dyno and application. The logs yield the error mentioned above.
Not to provide SSL configuration to the dyno, but to the application. Therefore, https access is disabled and the dyno is not even hit.
Not to provide certs configuration to the app, but to the dyno. The app crashes on boot time.
However, if I remove the related rustls lines, everything works smoothly, but the protocol used is HTTP/1.1.
Therefore, I'd like to kindly ask you:
Is there anything fundamentally bad about having the application expecting to load the certs?
Should I try other providers? (e.g DigitalOcean, AWS, Google Cloud)
Do you have any idea what might make it work in Heroku?
I've just found that Heroku does not support HTTP/2 at the time (source):
HTTP/2 is not currently supported on Heroku although this may change in future. You can find out about our currently supported HTTP protocols here: https://devcenter.heroku.com/articles/http-routing#http-versions-supported
For any future developments we recommend subscribing to the Heroku Changelog. This will let you know about updates, improvements and deprecations ahead of time so that you can make any necessary adjustments.

Incomplete chunks on Heroku with Dart app

I enabled WebSockets support on my Heroku application but last week Heroku updated their platform's routing architecture.
Now I get incomplete chunks in my browser. You can try my app:
http://dartlangfr-risk.herokuapp.com
Here my server code:
https://github.com/ggirou/risk/blob/master/bin/main.dart#L16-L40
Does anyone have a clue?
Thanks

My Sinatra App displaying 'Internal Server Error' after deployed to Heroku

My app is working locally, But after deploying to Heroku I'm getting an 'Internal Server Error' on my page
The Error log is as follows.
http://pastie.org/private/b5lgfmij1by3krieyp9sq
I cannot see what the problem is
Thanks for your help!
The problem is related to your database (or lack of):
2013-05-13T06:58:57.488018+00:00 app[web.1]: PG::Error - could not connect to server: Connection refused
Did you add one with $ heroku addons:add heroku-postgresql:[dev|basic|crane|etc] -a app_name? Checkout this Dev Center article with info on setting up Rack based web apps (including Sinatra) and setting up database access:
Deploying Rack-based Apps

Resources