Python smtp set up with gmail fails - python-2.7

try:
server = smtplib.SMTP("smtp.gmail.com:587")
server.ehlo()
except Exception as t:
print 'setup failed'
print t
Gives the error:
[Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

using socks and setting a proxy fixed the issue

Related

issue from bsrn data retrieval via ftp

I was able to retrive data from (BSRN) after receiving username and password! After a week, it led to the issue shown below! Any suggestions on how to solve it?
data, metadata = pvlib.iotools.get_bsrn(
start=pd.Timestamp(2020,2,1), end=pd.Timestamp(2020,2,2),
station='BOS', username='redacted', password='redacted')
data
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Connection timeout on oauth2.googleapis.com and bigquery.googleapis.com, when trying to tabledata.insertAll

we are making stream inserts directly to a bigquery table and we are randomly receiving timeouts. The google cloud status page doesn't present any problems and we are respecting the quotas and limitations.
Google\Cloud\Core\Exception\ServiceException: cURL error 7: Failed to connect to oauth2.googleapis.com port 443: Connection timed out (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
Google\Cloud\Core\Exception\ServiceException: cURL error 7: Failed to connect to bigquery.googleapis.com port 443: Connection timed out (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)
Is anyone having the same problem?

Connection reset by peer error while using celery stats()

I'm trying to get stats for my celery Que (rabbitmq). I'm using celery.app.control.Inspect().stats() API. I'm doing this on a web server, I can get the stats only one time. If I refresh the page I'm getting "[Errno 104] Connection reset by peer" Error. how can I deal with this.
/init.py
celtasks = Celery(app.name,"rabbit mq url")
/helpers.py
get_stats():
stats = celtasks.control.Inspect().stats()
return stats
whenever there is a request "get_stats" function is hit. It is only working for the first request after this, it says connection reset by peer error.
If I go by connection has been reset and try to create the connection again, I get error
updated /helpers.py
get_stats():
celtasks = Celery(app.name,"rabbit mq url")
stats = celtasks.control.Inspect().stats()
return stats
Rabbitmq logs
=WARNING REPORT==== 10-Jul-2017::14:11:54 ===
closing AMQP connection <0.29185.6> (10.246.170.70:48618 -> 10.24.83.115:5672):
connection_closed_abruptly
=WARNING REPORT==== 10-Jul-2017::14:11:54 ===
closing AMQP connection <0.29197.6> (10.246.170.70:48620 -> 10.24.83.115:5672):
connection_closed_abruptly
"rabbit#oser000300.log-20170625" 9054L, 361662C
AT most times , CONNECTION RESET BY PEER is because the server close the connection itself, however the client does not know . When client want to communicate to sever through this broke connection, it receive this ERROR. In your case , maybe the hang time (time interval between two stats()) is too long, and server think this connection is useless and close it .

Exception Error Errorno 10061 in solrpy program

I just started working on solrpy with below code.
import solr
# create a connection to a solr server
s = solr.SolrConnection('http://localhost:8083/solr')
# add a document to the index
s.add(id=1, title='Lucene in Action', author=['Erik Hatcher', 'Otis Gospodnetic'])
s.commit()
# do a search
response = s.query('title:lucene')
for hit in response.results:
print hit['title']
it is throwing Socket error: Errno 10061. Can anyone please help me in resolving this issue.
TCP Error 10061 means No connection could be made because the target machine actively refused it. So you have to check the program can connect localhost:8083. Checking your Jetty or other web container (ex. tomcat).

Could not write message to OutputStream: com.ctc.wstx.exc.WstxIOException: Connection timed out

I am getting this error when we move our database to new server. The application at the new server and the database at older server runs fine. But when we move the database to new server the server log shows this error.
Below is the server log. We are using jboss-5.1.0.GA.
2013-02-22 01:02:31,336 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]] (main) StandardWrapper.Throwable
org.springframework.ws.soap.saaj.SaajSoapMessageException: Could not write message to OutputStream: com.ctc.wstx.exc.WstxIOException: Connection timed out: connect; nested exception is javax.xml.soap.SOAPException: com.ctc.wstx.exc.WstxIOException: Connection timed out: connect
at org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(SaajSoapMessage.java:169)