Failed to authenticate on SMTP server with username "XXXXX#roadsprep.com" using 3 possible authenticators - laravel-5.4

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_NAME= 'NAME'
MAIL_USERNAME=XXXXX#roadsprep.com
MAIL_PASSWORD="XXXXXXXXXXXX"
MAIL_ENCRYPTION=tls
This is in my .env file.
(1/1) Swift_TransportException Failed to authenticate on SMTP server with username "XXXXX#roadsprep.com" using 3 possible authenticators
in AuthHandler.php (line 181)
at Swift_Transport_Esmtp_AuthHandler->afterEhlo(object(Swift_SmtpTransport))
in EsmtpTransport.php (line 332)
at Swift_Transport_EsmtpTransport->_doHeloCommand()
in AbstractSmtpTransport.php (line 118)
at Swift_Transport_AbstractSmtpTransport->start()
in Mailer.php (line 79)
at Swift_Mailer->send(object(Swift_Message), array())
in Mailer.php (line 443)
at Mailer->sendSwiftMessage(object(Swift_Message))
in Mailer.php (line 217)
This error showing me in my home desktop but this same setting perfectly running in my office machine. Both from localhost.

Related

Google Cloud Function error "OperationError: code=3, message=Function failed on loading user code"

I get an error from time to time when deploying nodejs10 cloud functions to GCP. The error seems to go away on it's own, I just redeploy the same thing a few times. Anyone know what causes it? He's the log:
command: gcloud beta functions deploy exchangeIcon --verbosity debug --runtime nodejs10 --memory 128 --region europe-west1 --timeout 5 --trigger-http --set-env-vars=FUNCTION_REGION=europe-west1,BUILD_DATE=2019-05-09T10:01:05.497Z --entry-point app
DEBUG: Running [gcloud.beta.functions.deploy] with arguments: [--entry-point: "app", --memory: "134217728", --region: "europe-west1", --runtime: "nodejs10", --set-env-vars: "OrderedDict([(u'FUNCTION_REGION', u'europe-west1'), (u'BUILD_DATE', u'2019-05-09T10:01:05.497Z')])", --timeout: "5", --trigger-http: "True", --verbosity: "debug", NAME: "exchangeIcon"]
INFO: Not using a .gcloudignore file.
INFO: Not using a .gcloudignore file.
Deploying function (may take a while - up to 2 minutes)...
..........................................................................failed.
DEBUG: (gcloud.beta.functions.deploy) OperationError: code=3, message=Function failed on loading user code. Error message:
Traceback (most recent call last):
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 985, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 795, in Run
resources = command_instance.Run(args)
File "/Users/me/Downloads/google-cloud-sdk/lib/surface/functions/deploy.py", line 231, in Run
enable_vpc_connector=True)
File "/Users/me/Downloads/google-cloud-sdk/lib/surface/functions/deploy.py", line 175, in _Run
return api_util.PatchFunction(function, updated_fields)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/util.py", line 300, in CatchHTTPErrorRaiseHTTPExceptionFn
return func(*args, **kwargs)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/util.py", line 356, in PatchFunction
operations.Wait(op, messages, client, _DEPLOY_WAIT_NOTICE)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/operations.py", line 126, in Wait
_WaitForOperation(client, request, notice)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/operations.py", line 101, in _WaitForOperation
sleep_ms=SLEEP_MS)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 219, in RetryOnResult
result = func(*args, **kwargs)
File "/Users/me/Downloads/google-cloud-sdk/lib/googlecloudsdk/api_lib/functions/operations.py", line 65, in _GetOperationStatus
raise exceptions.FunctionsError(OperationErrorToString(op.error))
FunctionsError: OperationError: code=3, message=Function failed on loading user code. Error message:
ERROR: (gcloud.beta.functions.deploy) OperationError: code=3, message=Function failed on loading user code.
In my Stackdriver Logging I just see INVALID_ARGUMENT, but nothing else.
The problem stems from your terminal commands not being properly formatted.
--verbosity=debug
is the proper way to type this. Also same thing with your runtime.

Airflow: Cannot assign requested address error while using emailoperator

Unable to receive email on task failure or even using EmailOperator
Hi Guys,
I am unable to receive email from my box even after adding required parameters to send one.
Below is how my default args looks like --
default_args = {
'owner': 'phonrao',
'depends_on_past': False,
#'start_date': datetime(2019, 3, 28),
'start_date': airflow.utils.dates.days_ago(2),
'email': ['phonrao#gmail.com'],
'email_on_failure': True,
'email_on_retry': True,
'retries': 1,
'retry_delay': timedelta(minutes=5),
#'on_failure_callback': report_failure,
#'end_date': datetime(2020,4 ,1),
#'schedule_interval': '#hourly',
}
I have few HttpsOperator task in between -- those are working good and are a success, but they do not send email on error(I purposely tried to introduce an error to check if they send any email). Below is an example of my task.
t1 = SimpleHttpOperator(
task_id='t1',
http_conn_id='http_waterfall',
endpoint='/update_data',
method='POST',
headers={"Content-Type":"application/json"},
xcom_push=True,
log_response=True,
dag=dag,
)
and this is my EmailOperator task
t2 = EmailOperator(
dag=dag,
task_id="send_email",
to='phonrao#gmail.com',
subject='Success',
html_content="<h3>Success</h3>"
)
t2 >> t1
Below is the error from Logs:
[2019-04-02 15:28:21,305] {{base_task_runner.py:101}} INFO - Job 845: Subtask send_email [2019-04-02 15:28:21,305] {{cli.py:520}} INFO - Running <TaskInstance: schedulerDAG.send_email 2019-04-02T15:23:08.896589+00:00 [running]> on host a47cd79aa987
[2019-04-02 15:28:21,343] {{logging_mixin.py:95}} INFO - [2019-04-02 15:28:21,343] {{configuration.py:255}} WARNING - section/key [smtp/smtp_user] not found in config
[2019-04-02 15:28:21,343] {{models.py:1788}} ERROR - [Errno 99] Cannot assign requested address
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 1657, in _run_raw_task
result = task_copy.execute(context=context)
File "/usr/local/lib/python3.6/site-packages/airflow/operators/email_operator.py", line 78, in execute
mime_subtype=self.mime_subtype, mime_charset=self.mime_charset)
File "/usr/local/lib/python3.6/site-packages/airflow/utils/email.py", line 55, in send_email
mime_subtype=mime_subtype, mime_charset=mime_charset, **kwargs)
File "/usr/local/lib/python3.6/site-packages/airflow/utils/email.py", line 101, in send_email_smtp
send_MIME_email(smtp_mail_from, recipients, msg, dryrun)
File "/usr/local/lib/python3.6/site-packages/airflow/utils/email.py", line 121, in send_MIME_email
s = smtplib.SMTP_SSL(SMTP_HOST, SMTP_PORT) if SMTP_SSL else smtplib.SMTP(SMTP_HOST, SMTP_PORT)
File "/usr/local/lib/python3.6/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/local/lib/python3.6/smtplib.py", line 336, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/local/lib/python3.6/smtplib.py", line 307, in _get_socket
self.source_address)
File "/usr/local/lib/python3.6/socket.py", line 724, in create_connection
raise err
File "/usr/local/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
OSError: [Errno 99] Cannot assign requested address
[2019-04-02 15:28:21,351] {{models.py:1817}} INFO - All retries failed; marking task as FAILED
Below is my airflow.cfg
[email]
email_backend = airflow.utils.email.send_email_smtp
[smtp]
# If you want airflow to send emails on retries, failure, and you want to use
# the airflow.utils.email.send_email_smtp function, you have to configure an
# smtp server here
smtp_host = localhost
smtp_starttls = True
smtp_ssl = False
# Uncomment and set the user/pass settings if you want to use SMTP AUTH
# smtp_user = airflow
# smtp_password = airflow
smtp_port = 25
smtp_mail_from = airflow#example.com
Has anyone encounter this issue and any suggestions on how do I resolve this?
If your airflow running on Kubernetes (installed by helm chart), you should take a look in "airflow-worker-0" pod, and make sure the environment variable of SMTP_HOST or SMTP_USER ... available in the config. Simply debugging, access to the container of airflow-worker and then run python, then trying these commands to make sure it works correctly.
import airflow
airflow.utils.email.send_email('example#gmail.com', 'Airflow TEST HERE', 'This is airflow status success')
I have the same issues, by resolving the environment variable of SMTP. Now it works.

FIWARE IDM installation error

I tried to install Fiware IDM in Ubuntu 12.04 from scratch (just only Ubuntu 12.04 was installed, no any more packages). I have followed the guide https://github.com/ging/fi-ware-idm/wiki/Installation-guide
Installation finished OK, but when I try to start fi-lab home page, http://localhost:8000, I've got the following error:
DeprecationWarning: The oslo namespace package is deprecated. Please use oslo_config instead.
DeprecationWarning: The oslo namespace package is deprecated. Please use oslo_config instead.
Validating models...
0 errors found
July 09, 2015 - 13:17:37
Django version 1.6.11, using settings 'openstack_dashboard.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
DEBUG:idm_logger:Creating a new internal keystoneclient connection to https://127.0.0.1:5000/v3.
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
WARNING:py.warnings:InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Recoverable error: SSL exception connecting to https://127.0.0.1:5000/v3/auth/tokens
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
return self.application(environ, start_response)
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
self.load_middleware()
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 47, in load_middleware
mw_instance = mw_class()
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/middleware/locale.py", line 24, in __init__
for url_pattern in get_resolver(None).url_patterns:
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 365, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 360, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/home/juan/idm/horizon/.venv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/home/juan/idm/horizon/openstack_dashboard/urls.py", line 36, in <module>
from openstack_dashboard.dashboards.idm_admin.user_accounts \
File "/home/juan/idm/horizon/openstack_dashboard/dashboards/idm_admin/user_accounts/views.py", line 27, in <module>
from openstack_dashboard.dashboards.idm_admin.user_accounts \
File "/home/juan/idm/horizon/openstack_dashboard/dashboards/idm_admin/user_accounts/forms.py", line 202, in <module>
class UpdateAccountForm(forms.SelfHandlingForm, UserAccountsLogicMixin, fiware_auth.TemplatedEmailMixin):
File "/home/juan/idm/horizon/openstack_dashboard/dashboards/idm_admin/user_accounts/forms.py", line 209, in UpdateAccountForm
choices=get_account_choices())
File "/home/juan/idm/horizon/openstack_dashboard/dashboards/idm_admin/user_accounts/forms.py", line 179, in get_account_choices
use_idm_account=True),
File "/home/juan/idm/horizon/openstack_dashboard/fiware_api/keystone.py", line 783, in get_basic_role
exceptions.handle(request)
File "/home/juan/idm/horizon/horizon/exceptions.py", line 324, in handle
messages.error(request, message or log_entry)
File "/home/juan/idm/horizon/horizon/messages.py", line 83, in error
fail_silently=fail_silently)
File "/home/juan/idm/horizon/horizon/messages.py", line 41, in add_message
if not horizon_message_already_queued(request, message):
File "/home/juan/idm/horizon/horizon/messages.py", line 28, in horizon_message_already_queued
if request.is_ajax():
AttributeError: 'NoneType' object has no attribute 'is_ajax'
Does anybody know whether we should install additional packages?
For development purposes, change this variable
from
OPENSTACK_KEYSTONE_URL = "https://%s:5000/v3" % OPENSTACK_HOST to
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
inside idm/horizon/openstack_dashboard/loca/local_settings.py (arround 130th line)

DAL connection string for Web2Py to MySQL on TurnkeyLinux

On TurnkeyLinux I have tried to connect a Web2Py app to the MySQL instance (which is up and running) with the following DAL statement (in db.py):
db = DAL('mysql://root:pwd2sql#web2py/dbname', fake_migrate_all=True)
It doesn't work and throws the following ticket:
Failure to connect, tried 5 times: Traceback (most recent call last): File "/var/www/web2py/gluon/dal.py", line 7562, in init self.adapter = ADAPTERSself._dbname File "/var/www/web2py/gluon/dal.py", line 2572, in __init_ if do_connect: self.reconnect() File "/var/www/web2py/gluon/dal.py", line 606, in reconnect self.connection = f() File "/var/www/web2py/gluon/dal.py", line 2570, in connector return self.driver.connect(*driver_args) File "/usr/lib/python2.7/dist-packages/MySQLdb/init.py", line 81, in Connect return Connection(args, *kwargs) File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in init super(Connection, self).init(args, **kwargs2) OperationalError: (2003, "Can't connect to MySQL server on 'web2py' (111)")
Does anybody have a connection string sample I can use ?

MySQLdb in Python: "Can't connect to MySQL server on 'localhost'"

I have installed MySQLdb for Python and I am able to import MySQLdb. Now I try to connect to the MySQL Community Server on my local machine, using this code:
db=MySQLdb.connect(
host="localhost",
user="br_admin",
passwd="blabla",
db="br_brain"
)
This code fails with this error:
Traceback (most recent call last):
File "<pyshell#22>", line 5, in <module>
db="brainse_brain"
File "C:\Python27\lib\site-packages\MySQLdb\__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)")
How do I resolve this error?
Make sure to provide the proper host and port:
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'yourdbname',
'USER': 'root',
'PASSWORD': 'your password',
'HOST': '127.0.0.1',
'PORT': '3306',
},
This is my settings.py file config for my django app.
Same for you please take host "127.0.0.1" and port "3306".
This might solve your problem.
And for python idle I've tested like...
>>> import MySQLdb
>>> Con = MySQLdb.Connect(host="127.0.0.1", port=3306, user="yoruname", passwd="yourpwd", db="test")
>>> Cursor = Con.cursor()
>>> sql = "SELECT * FROM test.testing"
>>> Cursor.execute(sql)
2L
I had the same trouble too, I'm working on a Windows of 64 bits, and the solution just was changing the host variable value. I had set "localhost" when the correct value have to be "127.0.0.1". However, when I'm working on Windows of 32 bits. I can set "localhost" or "127.0.0.1" in the host variable value and no matter, my django's project runs perfectly.
This will work fine :
db = MySQLdb.connect(host="127.0.0.1",user="db_username",passwd="db_password",db="db_name")
or
db= MySQLdb.connect("127.0.0.1","db_username","db_password","db_name")
In Windows 32, if you set host as 127.0.01 it gives the down error:
OperationalError: (2005, "Unknown MySQL server host '127.0.01' (0)")
But if you set host as 127.0.0.1 then you get no error.
If you are using windows you should specify the IP to "127.0.0.1", using "localhost" will give you that error 2003. On Ubuntu I had no problem.
1.Go to MySQL workbench
2.On the task bar above, click on server->and then click on Startup/Shutdown
3.On the screen, click on Start the server and you will get logs of server starting and running
- DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dataflair',
'USER':'root',
'PASSWORD':'',
'HOST':'127.0.0.1',
'PORT':'3306',
'OPTIONS':{
'init_command':"SET sql_mode=STRICT_TRANS_TABLES" }