Telegram bot python erro in webhooks heroku - heroku

I deploy a bot in heroku but it give a erro
2021-04-03T02:56:36.610385+00:00 app[web.1]: 2021-04-03 02:56:36,604 - apscheduler.scheduler - INFO - Scheduler started
2021-04-03T02:56:37.316107+00:00 app[web.1]: 2021-04-03 02:56:37,315 - telegram.ext.updater - ERROR - Error while bootstrap set webhook: Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443
2021-04-03T02:56:37.316196+00:00 app[web.1]: 2021-04-03 02:56:37,316 - telegram.ext.updater - ERROR - Failed bootstrap phase after 0 retries (Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443)
2021-04-03T02:47:04.325287+00:00 app[web.1]: 2021-04-03 02:47:04,317 - telegram.ext.updater - ERROR - unhandled exception in Bot:1718309867:updater
Well, i tryed all port 80, 88, 8443 but it give me the same erro again.
My hook and port code:
#change PORT TO HEROKU
PORT = int(os.environ.get('PORT', '8443'))
updater = Updater(SECRET_KEY, use_context=True)
#hook to heroku
updater.start_webhook(listen="0.0.0.0",
port=PORT,
url_path=SECRET_KEY)
updater.bot.set_webhook('https://myapp.herokuapp.com/' + SECRET_KEY)
PS: In localhost work very well

Given the date of this question, I assume that you're using PTB v13.4+. In that case, please see this channel post, i.e. change
updater.start_webhook(listen="0.0.0.0",
port=PORT,
url_path=SECRET_KEY)
updater.bot.set_webhook('https://myapp.herokuapp.com/' + SECRET_KEY)
to
updater.start_webhook(listen="0.0.0.0",
port=PORT,
url_path=SECRET_KEY,
webhook_url='https://myapp.herokuapp.com/' + SECRET_KEY)

Related

Promtail: "error sending batch, will retry" status=500

when starting the promtail client, it gives an error:
component=client host=loki:3100 msg="error sending batch, will retry" status=500 error="server returned HTTP status 500 Internal Server Error (500): rpc error: code = ResourceExhausted desc = grpc: received message larger than max (6780207 vs. 4194304)"
promtail config
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: 'http://loki:3100/loki/api/v1/push'
scrape_configs:
- job_name: server-log
pipeline_stages:
static_configs:
- targets:
- localhost
labels:
job: server-log
__path__: /opt/log/*.log
__path_exclude__: /opt/log/jck_*,*.log
I tried to start changing limits on the server, and run promtail with parameters:
/usr/local/bin/promtail-linux-amd64 -config.file=/etc/config-promtail.yml -server.grpc-max-recv-msg-size-bytes 16777216 -server.grpc-max-concurrent-streams 0 -server.grpc-max-send-msg-size-bytes 16777216 -limit.readline-rate-drop -client.batch-size-bytes 2048576
But judging by what I found, this is a grpc protocol error, or rather, in the size of the transmitted message, where the maximum is 4 mb
Changing the server parameters, not the client, solved the problem
server:
http_listen_port: 3100
grpc_listen_port: 9096
grpc_server_max_recv_msg_size: 8388608
grpc_server_max_send_msg_size: 8388608
limits_config:
ingestion_rate_mb: 15
ingestion_burst_size_mb: 30
per_stream_rate_limit: 10MB
per_stream_rate_limit_burst: 20MB
reject_old_samples: true
reject_old_samples_max_age: 168h
retention_period: 744h
max_query_length: 0h

Websocket connection error with HiveMQ 2.1.0 + Paho javascript mqttws31.js

Hi I am using Hivemq (windows) too and have an issue !
websocket are open and I receive some information:
2017-01-19 11:05:27,065 INFO - Starting HiveMQ Server
2017-01-19 11:05:27,070 INFO - HiveMQ version: 3.2.1
2017-01-19 11:05:27,074 INFO - HiveMQ home directory: C:\hivemq-3.2.1
2017-01-19 11:05:27,115 INFO - Log Configuration was overridden by C:\hivemq-3.2.1\conf\logback.xml
2017-01-19 11:05:31,533 INFO - Loaded Plugin HiveMQ JMX Metrics Reporting Plugin - v3.0.0
2017-01-19 11:05:31,534 INFO - Loaded Plugin HiveMQ JVM Metrics Plugin - v3.1.0
2017-01-19 11:05:31,535 INFO - Loaded Plugin HiveMQ MQTT Message Log Plugin - v3.0.0
2017-01-19 11:05:31,551 INFO - JMX Metrics Reporting started.
2017-01-19 11:05:31,574 INFO - Starting TCP listener on address 127.0.0.1 and port 1883
2017-01-19 11:05:31,701 INFO - Starting Websocket listener on address 127.0.0.1 and port 9001
2017-01-19 11:05:31,705 INFO - Started TCP Listener on address 127.0.0.1 and on port 1883
2017-01-19 11:05:31,706 INFO - Started Websocket Listener on address 127.0.0.1 and on port 9001
2017-01-19 11:05:31,707 INFO - Started HiveMQ in 4637ms
2017-01-19 11:05:31,708 INFO - No valid license file found. Using evaluation license, restricted to 25 connections.
2017-01-19 11:05:46,058 INFO - Client mosq/#IL\R8\7_1OBQj3hs# connected
2017-01-19 11:05:46,138 INFO - Subscribe from client mosq/#IL\R8\7_1OBQj3hs# received: domoticz/in QoS: 0
2017-01-19 11:05:49,867 INFO - Client mosq/#IL\R8\7_1OBQj3hs# sent a message to topic "domoticz/out": "{
"Battery" : 100,
"RSSI" : 7,
"description" : "",
"dtype" : "Temp + Humidity",
"id" : "62721",
"idx" : 3,
"name" : "bureau",
"nvalue" : 0,
"stype" : "THGN122/123, THGN132, THGR122/228/238/268",
"svalue1" : "19.0",
"svalue2" : "34",
"svalue3" : "2",
"unit" : 1
}
" (QoS: 0, retained: false)
2017-01-19 11:06:05,761 INFO - Client mosq/#IL\R8\7_1OBQj3hs# sent a message to topic "domoticz/out": "{
"Battery" : 100,
"RSSI" : 7,
"description" : "",
"dtype" : "Temp + Humidity",`enter code here
`
but i always have issue in chrome console :
`WebSocket connection to 'ws://127.0.0.1:9001/' failed: Connection closed before receiving a handshake response
k._doConnect # mqttws31-min.js:36
k._disconnected # mqttws31-min.js:54
k._on_socket_error # mqttws31-min.js:51
(anonymous) # mqttws31-min.js:19e
i am not a specialist please help
According to the Eclipse Paho Wiki
The path portion of the url specified on the MQTT connect should be "mqtt"
For instance ws://m2m.eclipse.org:800/mqtt . mqtt should be the default with the option for an alternative to be configured / specified
However the default path used by paho javascript is "/ws"
HiveMQ uses default configuration of "/mqtt" for websocket's path
Possible solutions are
Change path in Client to "/mqtt"
client = new Paho.MQTT.Client("127.0.0.1", Number(9001), "/mqtt", "clientId");
Change path in HiveMQ config to "/ws"
<websocket-listener>
...
<path>/ws</path>
...
</websocket-listener>
Regards,
Florian, from the HiveMQ Team.

Rightscale::HttpConnection : re-raising same error: https://eu-central-1.ec2.amazonaws.com:443 temporarily unavailable

I'm using chef_gem "right_aws" version '3.0.5'
https://supermarket.chef.io/cookbooks/aws#changelog
v2.5.0 (2014-10-22)
Got the following error when trying to use aws cookbook in ec2-central-1 region
WARN: Rightscale::HttpConnection : request failure count: 1, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : request failure count: 2, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : request failure count: 3, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : request failure count: 4, exception: #<SocketError: getaddrinfo: Name or service not known>
WARN: Rightscale::HttpConnection : re-raising same error: https://eu-central-1.ec2.amazonaws.com:443 temporarily unavailable: (SocketError: getaddrinfo: Name or service not known) -- error count: 4, error age: 0
From this documentation 'http://docs.aws.amazon.com/general/latest/gr/rande.html',
the endpoint should be 'ec2.eu-central-1.amazonaws.com'
I tried to edit my cookbook under libraries-> ec2.rb, but it doesn't work:
require 'open-uri'
module Opscode
module Aws
module Ec2
...
def ec2
region = instance_availability_zone
region = region[0, region.length-1]
aws_ec2_endpoint = "https://ec2." + region + ".amazonaws.com"
Chef::Log.debug("Using AWS EC2 endpoint: " + aws_ec2_endpoint)
##ec2 ||= create_aws_interface(RightAws::Ec2)
end
Any workarounds anyone can offer?
Thanks!
If you have the same issue, please find all details here:
https://github.com/rightscale/right_aws/issues/190

Don't build docs from local hosted readthedocs

I am deploy local instance application readthedocs. When I'm start the generation of documentation appear errors.
Here logs:
29/May/2015 08:47:00] INFO [requests.packages.urllib3.connectionpool:180] Starting new HTTP connection (1): localhost
[29/May/2015 08:47:00] INFO [projects.tasks:87] (Build) [diclonius-doc:] Building
[29/May/2015 08:47:00] ERROR [projects.tasks:576] Unable to post a new build
Traceback (most recent call last):
File "/srv/readthedoc/readthedocs/projects/tasks.py", line 574, in record_build
api.build(build['id']).put(build)
File "/srv/readthedoc/.env/local/lib/python2.7/site-packages/slumber/__init__.py", line 164, in put
resp = self._request("PUT", data=data, files=files, params=kwargs)
File "/srv/readthedoc/.env/local/lib/python2.7/site-packages/slumber/__init__.py", line 108, in _request
raise exceptions.HttpClientError("Client Error %s: %s" % (resp.status_code, url), response=resp, content=resp.content)
HttpClientError: Client Error 401: http://localhost:8000/api/v1/build/7/
[29/May/2015 08:47:00] INFO [projects.tasks:209] (Build) [diclonius-doc:latest] Updating docs from VCS
...
...
[29/May/2015 08:47:01] INFO [vcs_support.base:66] VCS[diclonius-doc:latest]: 47973225b291c752663da75d5ba218e5423029c4
[29/May/2015 08:47:01] ERROR [projects.tasks:576] Unable to post a new build
Traceback (most recent call last):
File "/srv/readthedoc/readthedocs/projects/tasks.py", line 574, in record_build
api.build(build['id']).put(build)
File "/srv/readthedoc/.env/local/lib/python2.7/site-packages/slumber/__init__.py", line 164, in put
resp = self._request("PUT", data=data, files=files, params=kwargs)
File "/srv/readthedoc/.env/local/lib/python2.7/site-packages/slumber/__init__.py", line 108, in _request
raise exceptions.HttpClientError("Client Error %s: %s" % (resp.status_code, url), response=resp, content=resp.content)
HttpClientError: Client Error 401: http://localhost:8000/api/v1/build/7/
[29/May/2015 08:47:01] INFO [projects.tasks:308] (Build) [diclonius-doc:latest] Removing existing build dir
[29/May/2015 08:47:01] INFO [projects.utils:81] Running: 'virtualenv-2.7 -p python --no-site-packages /srv/readthedoc/user_builds/diclonius-doc/envs/latest' [/srv/readthedoc]
[29/May/2015 08:47:02] INFO [projects.utils:81] Running: '/srv/readthedoc/user_builds/diclonius-doc/envs/latest/bin/pip install --use-wheel --find-links=/srv/readthedoc/deploy/wheels -U sphinx==1.3.1 Pygments==2.0.2 virtualenv==1.10.1 setuptools==1.1 docutils==0.11 mkdocs==0.11.1 mock==1.0.1 pillow==2.6.1 readthedocs-sphinx-ext==0.4.4 sphinx-rtd-theme==0.1.8 recommonmark==0.1.1' [/srv/readthedoc]
I am use server gunicorn and nginx for proxy.

Api Error: TSocket read 0 bytes when using hue with hbase

Here is my settings in hue config
[hbase]
# Comma-separated list of HBase Thrift servers for
# clusters in the format of '(name|host:port)'.
hbase_clusters=(Cluster|MasterIP:ThriftPort)
# Hard limit of rows or columns per row fetched before truncating.
## truncate_limit = 500
but when I connect to hue webpage and switch to Hbase tab, it shows
Log:
[08/Dec/2013 19:30:13 +0000] middleware INFO Processing exception: Api Error: TSocket read 0 bytes: Traceback (most recent call last):
File "/home/ubuntu/workspaces/hue/hue-master/build/env/lib/python2.7/site-packages/Django-1.4.5-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/workspaces/hue/hue-master/apps/hbase/src/hbase/views.py", line 69, in api_router
return api_dump(HbaseApi().query(*url_params))
File "/home/ubuntu/workspaces/hue/hue-master/apps/hbase/src/hbase/api.py", line 47, in query
raise PopupException(_("Api Error: %s") % e.message)
PopupException: Api Error: TSocket read 0 bytes
[08/Dec/2013 19:30:13 +0000] thrift_util INFO Thrift saw a transport exception: TSocket read 0 bytes
[08/Dec/2013 19:30:13 +0000] thrift_util WARNING Out of retries for thrift call: getTableNames
[08/Dec/2013 19:30:13 +0000] thrift_util DEBUG Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={})
[08/Dec/2013 19:30:13 +0000] thrift_util INFO Thrift exception; retrying: TSocket read 0 bytes
[08/Dec/2013 19:30:13 +0000] thrift_util DEBUG Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={})
[08/Dec/2013 19:30:13 +0000] thrift_util INFO Thrift exception; retrying: TSocket read 0 bytes
[08/Dec/2013 19:30:13 +0000] thrift_util DEBUG Thrift call: hbased.Hbase.Client.getTableNames(args=(), kwargs={})
[08/Dec/2013 19:30:13 +0000] access INFO 118.163.58.205 tracy - "POST /hbase/api/getTableList/Cluster HTTP/1.1"
Is HBase Master and the Thrift server still up? (do you have the logs?)
Also are you using security and which HBase version are you using?
Could you check the localtimes on the instances.
I have had the same issue and I have it fixed now after having the same timezones on all instances and the HUE timezone
Add this to your hbase "core-site.conf":
<property>
<name>hbase.thrift.support.proxyuser</name>
<value>true</value>
</property>
<property>
<name>hbase.regionserver.thrift.http</name>
<value>true</value>
</property>

Resources