Telethon Issue: OperationalError: database is locked - telegram-bot

The issue was appearing because we're connecting the client twice in the code.
client = TelegramClient(phone, api_id, api_hash)
client.connect()
if not client.is_user_authorized():
client.send_code_request(phone)
client.sign_in(phone, input('Enter the code: '))

To solve the "DataBase is locked" error,
you'll have to restart/abort the kernal and then remove the already created session from your local directory. Remove the client.connect() line from the code as it's getting connected at the first line itself.
The session file must be created with the following name as {phone}.session in the directory where your python code is kept.

You saved my day. I was facing the same issue, then I removed the client.start() and kept only the connect() part. That solved the issue. Kudos to you!

Related

aioamqp can't connect to rabbitmqserver

The server error is:
but when I use pika to connect to the rabbitmq server with the same parameter such as same usernameļ¼Œ password, virtual host, the pika can connect to the server.
the Error code is blow:
transport, protocol = await aioamqp.connect(host='localhost',
virtualhost='/', port=5672, ssl=False, insist=True,
login_method='AMQPLAIN') # use default parameters
How can I solve it?
I have fixed the error, and the solution is below:
1\ the master branch code did not correspond to aioamqp pypy code.
2\ so I git clone the master branch code to my project and make some test for it, then id did well for me.

"Invalid authentication data. Connection reset" When trying to log in to github within IntelliJ

Whenever I try to log into github from IntelliJ, I get this error.
Even thought my authentication data is correct, it tells me it's not. And it doesn't matter if I use a token or just use my credentials. I get the same problem. I've tried to delete all tokens and generated a new one, this also didn't change anything. What could be the problem? Thanks.
The issue might be caused by some proxy in the middle. Invalid authentication data is a generic message that appears when call to GitHub API fails without clear reasons. Connection reset seems to be the real message, and could be caused by some proxy or network firewall.
Check the logs for more details on the error. If you think it is some bug in IntelliJ, it is worth reporting the issue to http://youtrack.jetbrains.com/ with logs attached.

Facing badmatch keyfile error while fetching APNS Socket

Since i was facing unrecognised algorithm crash, I did the patching as mentioned here:
http://erlang.org/pipermail/erlang-questions/2015-June/084870.html
The CRASH no longer appears but i do not get any APNS push notofications even after that. I have the sandbox environment at my end.
when i run on the ejabberd shell:
mod_mymodule:get_socket().
I get:
{error,{keyfile,{badmatch,{error,{asn1,{invalid_length,6}}}}}}
My certificate and private RSA key file worked fine for several months until this popped up.
The get_socket() method definition is:
get_socket()->
%%Options
Options = [{certfile, ?Cert}, {keyfile, ?Key}, {mode, binary}],
%%ssl connection
ssl:connect(?Address, ?Port, Options, infinity) .
FYI, I have macros declared like:
-define(Cert,"/opt/ejabberd-14.07/bin/MantuPush/cert.pem").
-define(Key,"/opt/ejabberd-14.07/bin/MantuPush/finalkey.pem").
Note: I havent used the CSR here, since examples do not state it mandatory(Guessing!).
What could be wrong?
What is the correct Certificate and Private key contents used with APNS?
Kindly help.
Thanks
This is an Erlang bug. Check out our Erlang pull request for quick hack and the discussion on Github: https://github.com/erlang/otp/pull/767
Here is the blog post explaining the issue: https://blog.process-one.net/apple-increasing-security-of-push-service-ahead-of-wwdc/

Pentaho Kettle Invalid JNDI connection Could not create connection to database server

I was using JNDI method to connect several MySQL database servers with my Pentaho PDI (CE 5.0.1) and working fine till now, excpet the one. One of the MySQL server went down, so I changed my JNDI connection (...\data-integration\simple-jndi\jdbc.properties) to connect to new server, but Kettle is not recogising this change and throwing the error as follows:
Error connecting to database [db-name] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Invalid JNDI connection kidr_db_5 : Could not create connection to database server. Attempted reconnect 3 times. Giving up.
org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Invalid JNDI connection kidr_db_5 : Could not create connection to database server. Attempted reconnect 3 times. Giving up.
I can connect to new server directly from Kettle through Native(JDBC) connection method, but not through JNDI only for this new server. Rest DB connection from JNDI working fine. Please guide me whats wrong here? Am missing something? or is it a bug?
I had resolved this issue, sorry in replying lately. The problem was, the password included few special characters including # symbol; but in Pentaho, # is a comment line, so part of password was appeared to be comment for Pentaho.
So the conclusion is, don't use # other than comments in either JNDI configuration or Kettle configuration files.
Quick info.
Not exactly it is a Kettle Pentaho bug. Bug(if it is not made intentionally) is in "simple-jndi" library. Library simple-jndi is used by Kettle, to provide jndi context. While oracle documentation of java.util.Properties class (http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html) states that, comment line must started by '#' symbol and it must be the first symbol in the line, library "simple-jndi" - use own loader, called org.osjava.sj.loader.util.CustomLoader. That is where bug resides
int idx = line.indexOf('#');
// remove comment
if(idx != -1) {
line = line.substring(0,idx);
}
So comment is everything after '#' symbol in the line if u use simple-jndi.
use .xml instead of .properties
<?xml version="1.0" encoding="UTF-8"?>
<something>
<connection-name>
<type>javax.sql.DataSource</type>
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://localhost:5432/database</url>
<user>user</user>
<password>#secret#</password>
</connection-name>
</something>
my files is called connections.xml
and then you can refer to connections/something/connection-name
in pdi for above example

InvocationTargetException:There was an error while invoking the operation. Flash Builder 4.6

I am having issues getting my remote server configured right after everything working properly on the local host. I am getting the following error:
InvocationTargetException:There was an error while invoking the operation. Check your operation inputs or server code and try invoking the operation again.
The key parts of the large message I am getting after that are:
Class "test" does not exist: Plugin by name 'Test' was not found in the registry; used paths::
..../smii/test/ID5D8FE3F-A1D1-4174-98B3-4BED10FD8FFEI79685B66-D792-E4E9-13B3-00004DA5951BI0F94D267-0704-3C89-0B5B-0000090BA097134950398900
I don't know how this last part of the address with random number and letters is getting there.
Also, when searching for my server settings today it seems to add a "-1" on the end of the initial directory on the server not sure why but I seem to be having major issues implementing the service remotely.