Django Celery RabbitMQ access denied (403) ACCESS_REFUSED - django

I have a django project with heroku with celery integrated. I've got the rabbitmq add-on through heroku and have tested my task locally to success. The issue I'm having is connecting my remote server to rabbitmq/cloudamqp.
I believe the credentials I'm using are the culprit of the problem, but I'm unsure where I'm going wrong. I'm using the credentials provided to me via the cloudamqp dashboard. This includes:
AMQP URL
User & Vhost
Password
In my settings.py I have:
CELERY_BROKER_URL= "amqp://{User}:{Password}#{AMQP URL}:5672/"
I've tried a variety of other forms with similar results. The latest error output is:
amqp.exceptions.AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.
Am I using the right credentials? Do I need to create a rabbitmq user through the command line and not the admin dashboard?

It seems that AMQP URL has all details (this is for service cloudamqp).
CELERY_BROKER_URL= "{AMQP URL}"

Related

WSO2 Api Manager Control Plane not starting JMS server

I have a wso2apimanager-4.1.0 with the role of control-plane. In the wso2carbon.log, the following stack trace keeps appearing, especially when I try to deploy an API change. The main errors are "Caused by: org.wso2.andes.AMQConnectionFailureException: Server did not respond in a timely fashion [error code 408: Request Timeout]" and "ERROR {org.wso2.andes.client.AMQConnection} - Throwable Received but no listener set. org.wso2.andes.AMQDisconnectedException: Server closed connection and reconnection not permitted."
error_1
error_2
Despite these errors, the gateway-workers can connect to the control-plane on startup pulling all the APIs deployed on the API Manager ecosystem. Although, when I deploy a new version of an API, the gateways are not notified (because the JMS is down) and they do not pull the changes until they are rebooted.
I've already reviewed the jndi.properties, user-mgt.xml and all the superuser username and password are correct (they are pulled from deployment.toml correctly). The JMS port exists when the control-plane service starts and is not being blocked by any firewall, also the superuser password doesn't have special characters like '#'.
I've migrated the control-plane from version 4.0.0 to version 4.1.0 recently, the error did not occur in 4.0.0. The config file (deployment.toml) is the same.
Has anyone come across this problem? How can I resolve this error?

Channel error on connection rabbitmq, celery and django

=ERROR REPORT==== 18-Aug-2018::11:38:19 === Channel error on connection <0.17949.0> (IP:50872 -> IP:5672, vhost: 'myhost', user: 'myuser'), channel 1: {amqp_error,access_refused, "access to exchange 'celeryev' in vhost 'myhost' refused for user 'user'", 'exchange.declare'}
Following above is the error i am facing right now.
I had already running AWS instance, took a snapshot and put new django code over it. Run the celery task over it and facing this error in the rabbitmq server logs.
When check the snapshot there was no user and vhost. So i added the exact same name and password user and vhost. and set the permissions as administrator. And still keep facing this issue.
Any help in this regard would be much appreciated.
So what was my problem, actually the permissions were not set accurately. What i did from rabbitmq web interface i set the same permissions as the guest login, and it just start working fine.

Google Oauth2 redirects after 2.1 minutes on login

The problem with my Django App is that the Google Oath2 Redirect takes 2 minutes to login. I am using uwsgi + nginx on the server-side. It only happens on the login request.I had earlier tried using Nginx + Gunicorn,
nginx error logs said something about Connection reset by peer(104).But i don't think the error is with nginx. It still doesn't work even if I disable nginx.
The stack trace when running the server on django dev server:
The Google Oauth2 Takes 2.1 minutes of time.
Any Suggestions? Pointers?
I had the same issue on a server 2 weeks ago. In my case, the server was resolving all URLs using ipv6. It would take 2 minutes to resolve each URL. So, I just turned off ipv6.
Try disabling it.

upload an app twice in app server and meet errors

I am testing the JNDI datasource with sample downloaded from url [1]. I upload the app as a tenant, and register the datasource in the context.xml of the app.
upload the app to AS, with no version number, click go to URl and find the app is working, and achieve the data from database; delete the app from the console, upload the app to AS, with version number 0.1.2
then the back-end console show some errors:
[2013-12-17 17:18:13,816] ERROR {org.wso2.carbon.tomcat.internal.CarbonTomcat} - Webapp StandardContext[/carbonDSwebApp/0.1.2] failed to deploy
[2013-12-17 17:18:13,817] ERROR {org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer} - Error while deploying webapp: StandardContext[carbonDSwebApp#0.1.2.war].File[F:\OPENSO~1\WSO2\WSO2AS~1.0\bin..\repository\deployment\server\webapps\carbonDSwebApp#0.1.2.war]
org.wso2.carbon.tomcat.CarbonTomcatException: Webapp failed to deploy
Caused by: java.lang.NullPointerException: no !/ in spec
then no matter how many times of deletion and upload, this app is no longer able to be ploaded.
[1] http://dinushasblog.blogspot.com/2011/12/how-to-access-carbon-data-source-from.html

WSO2 API Key Manager

I am configuring our API Manager, but running into troubles authenticating via OAuth, seems to be an issue with the API Key Manager. I haven't dug into it yet, but does this come with the API Manager (as I have assumed) or is this a separate installation?
I had the same issue when using the wso2 api manager on a Amazon hosted machine, turn out that Thrift was not working correctly because some problem with multicasting and broadcasting.
What I did to get it working was to switch from ThriftClient to WSClient. If you have a huge amount of requests coming in then Thrift is the recommended solution from wso2 but in any "normal" case you will not have any differences between thrift and WS.
Here is how you switch:
Shut down the API Manager
Open up <api manager install dir>\repository\conf\api-manager.xml
Find ThriftClient
Change this to
<KeyValidatorClientType>WSClient</KeyValidatorClientType>
Start the API Manager
You may get some Warnings while starting up but, try it before you jump to the conclusion that it doesn't work.
Hope it helps!
you can use APIM manager product in a distributed setup as keymanger,gateway,store,publisher..but all functionality come in a single distribution.. ..
Go through the documentation for further guides
I was facing the same issue. Everything started when I created my own jks in order to use SSL without a self-signed certificate. I successfully created the jks and changed it in the carbon file. When I started the server, everything seemed ok; but when I used SOAPUI to test an API call, I got this (in the logs of the api manager):
APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
I started digging what was the problem by enabling Debug level in the log4j.properties file, and then tried again a tested with SOAPUI and I got:
APISecurityException: Could not connect to <my api ip address> on port 10397
Then, I read the comment of OneMuppet and I checked that file and I found that the Thrift config has a host option, so I uncommented it:
<KeyValidatorClientType>ThriftClient</KeyValidatorClientType>
<ThriftClientPort>10397</ThriftClientPort>
<ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
<ThriftServerPort>10397</ThriftServerPort>
This Line --> <ThriftServerHost>localhost</ThriftServerHost>
<EnableThriftServer>true</EnableThriftServer>
Save, restarted the server and everything start working correctly.
I got the same below issue after my installation, when i try to invoke the api service it is throwing below error:
900900 Unclassified Authentication Failure Error while accessing backend services for API key validation
After some random checks i have seen the axis2.xml file in /repository/conf/axis2 there it is refering a differnt ip's instead. I change these ip's to my local ip and restarted. The issue is resolved now.
I was facing the same issue. when I was trying to setup API Manager as an API Gateway in a different machine as per the steps given here,
https://docs.wso2.com/display/AM250/Publish+through+Multiple+API+Gateways
Once the setup is done and when I am trying to use this gateway URL, I was getting the below response,
{"fault":{"code":900900,"message":"Unclassified Authentication Failure","description":"Error while accessing backend services for API key validation"}}
After changing the KeyValidatorClientType value to WSClient from ThriftClient on the <api manager install dir>\repository\conf\api-manager.xml
It started working fine. And I was able to get the expected response.
If you changed the admin password, then you also have to update the repository/conf/api-manager.xml file with the new password. The 2 places I have changed (so far) are:
<AuthManager>
and
<APIKeyManager>
but there are other admin usernames in that file. No doubt, I'll get to them....