deploying telegram bot on Render.com permission denied - deployment

I am new to python-telegram-bot and I am trying to deploy my bot on Render as a web service. Render provides me with a deploy hook and I have added the WEBHOOK_URL to start my bot application.run_webhook(webhook_url=WEBHOOK_URL). It starts giving me warning Errno 13 Permission Denied once I deploy it on Render. I am using python-telegram-bot v20.0. Any help would be grateful.
application = Application.builder().token(BOT_API_KEY).build()
application.add_handler(CallbackQueryHandler(yes, pattern='^yes'))
application.add_handler(CallbackQueryHandler(no, pattern='^no'))
application.add_handler(CallbackQueryHandler(cancel, pattern='cancel'))
application.run_webhook(
listen='127.0.0.1',
port=80,
url_path='',
webhook_url=WEBHOOK_URL,
)
I have tested it on my pc locally with ngrok and it works perfectly fine.

You can not use port 80 in render.
Get the port from environment variables.
port = os.environ.get('PORT')
print(port)
If this prints None, try:
port = os.environ.get('$PORT')
print(port)
Then,
application.run_webhook(
listen='127.0.0.1',
port=port,
url_path='',
webhook_url=WEBHOOK_URL,
)

Related

WLST - Cannot connect() with HTTPS - T3S Protocol - Port 9002

We changed the configuration of our WebLogic servers to use HTTPS and T3S for connections and use the secure encrypted port 9002 instead of cleartext port 7001. However when using the Web Logic Scripting Tool (WLST)'s connect() function, errors are thrown. One such error is as follows:
WLSTException: Error occurred while performing connect : Cannot connect via t3s or https. If using demo certs, verify that the -Dweblogic.security.TrustKeyStore=DemoTrust system property is set. : t3s://DatServer:9002: Destination 10.10.100.3, 9002 unreachable; nested exception is:
javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination
Use dumpStack() to view the full stacktrace :
The syntax of the connect function is: connect('user', 'password', 't3s://host:9002')
This connect() function works fine before the switch from HTTP to HTTPS. Now we cannot connect to the remote admin server using the connect command. Does anyone have any idea how to fix this?
I read some interesting help options but none of them seemed to work. These help suggestions and tips are located here: https://community.oracle.com/thread/1036828
We were able to connect to the remote host and port via telnet. We saw that the port is open and listening for connections on the loop back address with netstat. We tried adding these options to the script invocation: java -cp /path/to/weblogic.jar weblogic.WLST -Dweblogic.security.TrustKeyStore=DemoTrust -Dssl.debug=true Dweblogic.security.SSL.ignoreHostnameVerification=true -Djava.security.egd=file:/dev/./urandom but this also did not work.
We enabled tunneling in the General tab of WebLogic but not in the HTTP tab. I am not the one in control of the server so I just have to suggest things and hope that the instructions are followed.
I get it running in 12.2. by adding to
../oracle_common/common/bin/setWlstEnv_internal.sh
at the end the following lines (youu need to customize line 5 und 6, the values in brackets):
JAVA_OPTIONS="-Dweblogic.ssl.JSSEEnabled=true ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.SSL.enableJSSE="true" ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.SSL.ignoreHostnameVerification=true ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.TrustKeyStore=CustomTrust ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.CustomTrustKeyStoreFileName= ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.CustomTrustKeyStorePassPhrase= ${JAVA_OPTIONS}"
JAVA_OPTIONS="-Dweblogic.security.CustomTrustKeyStoreType=JKS ${JAVA_OPTIONS}"
export JAVA_OPTIONS
and modifying in
../oracle_common/common/bin/wlst_internal.sh
the line starting with
eval '"${JAVA_HOME}/bin/java"' ${JVM_ARGS} ...
by adding ${JAVA_OPTIONS}
so that it looks as follows:
eval '"${JAVA_HOME}/bin/java"' ${JVM_ARGS} ${JAVA_OPTIONS} weblogic.WLST '"$#"'
Hope this helps, allthough modifying scripts that are named "..internal.." doesn´t give me a good feeling
export this before running wlst.sh
export WLST_PROPERTIES=" -Dweblogic.security.TrustKeyStore=CustomTrust -Dweblogic.security.CustomTrustKeyStoreFileName=/u01/oracle/properties/truststore.jks -Dweblogic.security.CustomTrustKeyStoreType=jks -Dweblogic.security.CustomTrustKeyStorePassPhrase=qaz#1234 " ;

Nodebb web app has failed to start and just crashes

I managed to install the nodebb forum very well and i was able to use it... On the next day , it failed to start and just crashes. I think my problem was that connect mongo cannot easily connect to mongodb database. probably help me look at this error.
16/2 20:26 [4171] - info: Launching web installer on port 4567
events.js:72
throw er; // Unhandled 'error' event
Error: listen EADDRINUSE
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1043:14)
at listen (net.js:1065:10)
at Server.listen (net.js:1139:5)
at EventEmitter.listen (/home/goldsoft25/Desktop/NodeJS/NodeBB-master/node_modules/express/lib/application.js:617:24)
at launchExpress (/home/goldsoft25/Desktop/NodeJS/NodeBB-master/install/web.js:53:15)
This is a very common error for any of application running on top of node. Both applications are pointing to same port, 4567 in your case .
You will have to change the port of one application or kill application when swapping between each app.

jetty error starting on Mac

Hello Ive downloaded jetty and whenever I try to start it it generate the following log and gives an error so I can't use it, can somebody tell me whats wrong or whats missing
Im starting on terminal in the bin folder with the "./jetty.sh start"
Here's the error on localhost:8080
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
Powered by Jetty Java Web Server
Heres the log:
https://www.dropbox.com/s/u6j7t1lhqscv34l/log.rtf
Looks like that port 8080 is already in use: "java.net.BindException: Address already in use
"
Try an different port or don't declare a port and use logic like this to figure out what you are bound to:
Server server = new Server(0);
int port = ((ServerConnector) server.getConnectors()[0]).getLocalPort();

Fatal error: Uncaught CurlException: 7: couldn't connect to host thrown in

Yesterday was fine, but today, suddenly, my web app report an error while accessing Facebook PHP API.
At first, the error was connection time out. So, I added the time in base_facebook.php, changed the variable
CURLOPT_CONNECTTIMEOUT => 10 into
CURLOPT_CONNECTTIMEOUT => 60
Now, my web app reports another error:
Fatal error: Uncaught CurlException: 7: couldn't connect to host thrown in xxx\src\base_facebook.php on line 972
Ah, I run my app on localhost in Windows (XAMPP 1.7.7).
For testing it, I also run the example codes from the newest facebook API in github.
I also have restarted my Apache server, and It still gives the same error.
This is probably a server configuration problem on your side.
Check whether the host has blocked the ports 80 and 443.

Communicating with DB through SSH in GWT app (using RPC)

I am trying to write a GWT back-end using the RPC model for java servlets.
Is it possible to ssh tunnel within an RPC in order to communicate with a remote sql database?
The code I try to execute is below, using Jsch. The error occurs on "session.connect();"
String host="xxxxx.xxx.edu";
String user="username";
String password="password";
Session session= null;
try{
//Set StrictHostKeyChecking property to no to avoid UnknownHostKey issue
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
JSch jsch = new JSch();
session=jsch.getSession(user, host, 22);
session.setPassword(password);
session.setConfig(config);
session.connect();
}
The runtime error I get on the 'session.connect()' line is as follows: (scroll right to see whole error)
com.jcraft.jsch.JSchException: java.security.AccessControlException: access denied (java.net.SocketPermission xxxxx.xxx.edu resolve)
at com.jcraft.jsch.Util.createSocket(Util.java:341)
at com.jcraft.jsch.Session.connect(Session.java:194)
at com.jcraft.jsch.Session.connect(Session.java:162)
at com.front.server.GameServiceImpl.createGame(GameServiceImpl.java:39)
The frustrating part about this is that I copied/pasted the exact same code into a simple java program and it works. So I know the code is correct; obviously the jetty server which GWT creates for local testing has a problem executing the code. What else can I do / what should I be doing in this situation with GWT? Shouldn't the back-end of a GWT application have the capacity to ssh??
I suggest you try running your gwt app with a different web container (Tomcat, JBoss). You can still make use of debugging functionality by running the hosted mode with the -noserver flag.
See here