ldap server unreachable cause plone/zope server down - ldap

I have a plone installation (4.2.5) with plone.app.ldap add-on. There is a site with plone-ldap enabled and our ldap server was changed to another domain/IP. So on, zope server downs on plone-ldap retrieving ldap information. Nothing more works even root ZMI.
Any request to server doesn't load anything few seconds after plone restart. Therefore I can't reconfigure our new ldap server neither by our site or ZMI interface.
In such case, How can I proceed to reconfigure the new ldap server on plone-ldap component? Is there some script application similar to ZMI to do this? Is it a known bug?
Some logs:
1) Zeoserver.log
2016-06-06T15:52:04 new connection ('127.0.0.1', 40051): <ManagedServerConnection ('127.0.0.1', 40051)>
2016-06-06T15:52:04 (127.0.0.1:40049) received handshake 'Z3101'
2016-06-06T15:52:04 (unconnected) disconnected
2016-06-06T15:52:04 (unconnected) disconnected
2016-06-06T15:52:08 new connection ('127.0.0.1', 40052): <ManagedServerConnection ('127.0.0.1', 40052)>
2016-06-06T15:52:08 new connection ('127.0.0.1', 40053): <ManagedServerConnection ('127.0.0.1', 40053)>
2016-06-06T15:52:08 new connection ('127.0.0.1', 40054): **<ManagedServerConnection ('127.0.0.1', 40054)>
2016-06-06T15:52:08 (127.0.0.1:40052) received handshake 'Z3101'
2016-06-06T15:52:08 (unconnected) disconnected
2016-06-06T15:52:08 (unconnected) disconnected**
2) client1/event.log
2016-06-06T15:53:12 ERROR event.LDAPDelegate {'desc': "Can't contact LDAP server"}
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.26-py2.7.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 366, in search
connection = self.connect(bind_dn=bind_dn, bind_pwd=bind_pwd)
File "/usr/local/Plone/buildout-cache/eggs/Products.LDAPUserFolder-2.26-py2.7.egg/Products/LDAPUserFolder/LDAPDelegate.py", line 265, in connect
raise e
**SERVER_DOWN: {'desc': "Can't contact LDAP server"}**

Backup first
Disclaimer - I never seen before an LDAP configuration that freeze also the root-level admin ZMI access to the Plone site.
What I can quickly suggest you is to delete the ldap plugin from the site's acl_users and starts from scratch.
As ZMI is not usable you must use the console access.
For doing this run a zope instance as follow:
$ bin/instance debug
(where "instance" is one of your instances)
The you can delete the ldap plugin:
del app.Plone.acl_users['ldap-plugin-id']
Where Plone is the is of your site and ldap-plugin-id the is of the LDAP plugin.
If you don't remember it, look for it in this set:
app.Plone.acl_users.objectValues()
Finally you must persist your changes:
import transaction;transaction.commit()
...then exit using CTRL+D
Now you must be able to access ZMI and you must create and reconfigure a new plugin.
Please note: when configuring an LDAP or AD plugin always set a "Connection timout" and an "Operation timeout". This is probably why your access attempt totally freeze the instance.

Related

mbsync authentication failed

I was able to configure mbsync and mu4e in order to use my gmail account (so far everything works fine). I am now in the process of using mu4e-context to control multiple accounts.
I cannot retrieve emails from my openmailbox account whereas I receive this error
Reading configuration file .mbsyncrc
Channel ombx
Opening master ombx-remote...
Resolving imap.ombx.io... ok
Connecting to imap.ombx.io (*.*.10*.16*:*9*)...
Opening slave ombx-local...
Connection is now encrypted
Logging in...
IMAP command 'LOGIN <user> <pass>' returned an error: NO [AUTHENTICATIONFAILED] Authentication failed.
In other posts I've seen people suggesting AuthMechs Login or PLAIN but mbsync doesn't recognizes the command. Here is my .mbsyncrc file
IMAPAccount openmailbox
Host imap.ombx.io
User user#openmailbox.org
UseIMAPS yes
# AuthMechs LOGIN
RequireSSl yes
PassCmd "echo ${PASSWORD:-$(gpg2 --no-tty -qd ~/.authinfo.gpg | sed -n 's,^machine imap.ombx.io .*password \\([^ ]*\\).*,\\1,p')}"
IMAPStore ombx-remote
Account openmailbox
MaildirStore ombx-local
Path ~/Mail/user#openmailbox.org/
Inbox ~/Mail/user#openmailbox.org/Inbox/
Channel ombx
Master :ombx-remote:
Slave :ombx-local:
# Exclude everything under the internal [Gmail] folder, except the interesting folders
Patterns *
Create Slave
Expunge Both
Sync All
SyncState *
I am using Linux Mint and my isync is version 1.1.2
Thanks in advance for any help
EDIT: I have run a debug option and I have upgraded isync to version 1.2.1
This is what the debug returned:
Reading configuration file .mbsyncrc
Channel ombx
Opening master store ombx-remote...
Resolving imap.ombx.io... ok
Connecting to imap.ombx.io (*.*.10*.16*:*9*)...
Opening slave store ombx-local...
pattern '*' (effective '*'): Path, no INBOX
got mailbox list from slave:
Connection is now encrypted
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Openmailbox is ready to
handle your requests.
Logging in...
Authenticating with SASL mechanism PLAIN...
>>> 1 AUTHENTICATE PLAIN <authdata>
1 NO [AUTHENTICATIONFAILED] Authentication failed.
IMAP command 'AUTHENTICATE PLAIN <authdata>' returned an error: NO [AUTHENTICATIONFAILED] Authentication failed.
My .msyncrc file now contains these options instead
SSLType IMAPS
SSLVersions TLSv1.2
AuthMechs PLAIN
At the end, the solution was to use the correct password. Since openmailbox uses an application password for third-party e-mail clients I was using the wrong (original) password instead of the application password.

Use network charge to import files PST in Office 365 - unable to read data from the transport connection

I am using a network charge to import files PST in Office 365 follow this link:
https://support.office.com/es-es/article/Usar-la-carga-en-la-red-para-importar-archivos-PST-en-Office-365-103f940c-0468-4e1a-b527-cc8ad13a5ea6?ui=es-ES&rs=es-ES&ad=ES
The transfer start, but in the end display (for the detail in every mailbox) the next:
"The transfer failed: Unable to connect to the remote server"
"The transfer failed: Unable to write data to the transport
connection: An existing connection was forcibly closed by the remote
host"
I have a user administrator and a file shared with all Access: to read and write, i don`t know if i need something special permission or disable something service?
Please your help!
Best Regards,
Verónica Muentes
"The transfer failed: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host"
The error is often caused by following 2 reasons.
Azure storage request either using http or https. That means it send requests through ports 80 or 443. So you need to make sure these ports are open to the internet.
Please double check whether you used a proxy on your machine. If yes, you need to disable the proxy or create a configuration file named 'AzCopy.exe.config' to the following location 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\'.
In this file you will need to add the following XML:
<configuration>
<system.net>
<defaultProxy>
<!--PROXY_ADDRESS: Is the proxy address used to connect to the internet, e.g. myproxy.company.com
PORT_NUMBER: Is the port number used to connect to the proxy, e.g. 8080-->
<proxy proxyaddress="http://PROXY_ADDRESS:PORT_NUMBER" bypassonlocal="true" />
</defaultProxy>
</system.net>
</configuration>

Weblogic Admin Server Start issue - DataSource passwords got exparied

We are trying to use one of the existing weblogic 12c domain and It's DataSource passwords been expired.
Since AdminServer is not responding correctly I tried to re-start AdminServer as well, Now I have changed the DB passwords and wanted to set the new passwords starting the AdminServer, but I cant start AdminServer it's failing complaining passwords are expired. (I could have get a way with this issue if i keep the admin server running and set the new passwords)
I can see DataSources are targeted to Admin Server and I thought if I untarget DS from AdminServer I could start AdminServer correctly. hence I removed the AdminServer as a target from config.xml and tried o start the Admin but it's still failing complaining passwords are expired. Is Config cached anywhere , looks like I am Admin is still using the old config file ? by the way I have tried removing the tmp folder as well.
Also, I tried encrypting the new password and placing on JDBC config files, Probably the way I encrypted was wrong. These are the steps I used to encrypt
1. Connect to WLST offline ( because Admin is not up)
2. Read domain
3. Call encrypt function for new password
4. Print the encrypt password
Anything wrong ? Appreciate any suggestion to resolve this issue.
Error is starting like this ,
Jun 22, 2015 4:38:04 PM oracle.security.jps.JpsStartup start
INFO: Jps initializing.
Jun 22, 2015 4:38:07 PM org.hibernate.validator.util.Version <clinit>
INFO: Hibernate Validator 12.1.3.0.0
Jun 22, 2015 4:38:07 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
[EL Severe]: ejb: 2015-06-22 16:38:11.173--ServerSession(143991231)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
Error Code: 1017
Jun 22, 2015 4:38:11 PM oracle.security.jps.internal.common.config.AbstractSecurityStore getSecurityStoreVersion
WARNING: Unable to get the Version from Store returning the default oracle.security.jps.service.policystore.PolicyStoreException: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
Error Code: 1017
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.processJPAException(JpsDBDataManager.java:2180)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.init(JpsDBDataManager.java:1028)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.jpsObjectBaseQuery(JpsDBDataManager.java:3089)
at oracle.security.jps.internal.policystore.rdbms.JpsDBDataManager.queryBaseObjects(JpsDBDataManager.java:5761)
at oracle.security.jps.internal.common.config.AbstractSecurityStore.getSecurityStoreVersion(AbstractSecurityStore.java:211)
at oracle.security.jps.internal.common.config.AbstractSecurityStore.getSecurityStoreVersion(AbstractSecurityStore.java:195)
at oracle.security.jps.internal.common.config.AbstractSecurityStore.<init>(AbstractSecurityStore.java:99)
at oracle.security.jps.internal.credstore.AbstractCredentialStore.<init>(AbstractCredentialStore.java:104)
at oracle.security.jps.internal.credstore.ldap.LdapCredentialStore.<init>(LdapCredentialStore.java:130)
at oracle.security.jps.internal.credstore.ldap.LdapCredentialStoreProvider.getInstance(LdapCredentialStoreProvider.java:235)
at oracle.security.jps.internal.credstore.rdbms.DbmsCredentialStoreProvider.getInstance(DbmsCredentialStoreProvider.java:101)
at oracle.security.opss.internal.runtime.ServiceContextManagerImpl.createContextInternal(ServiceContextManagerImpl.java:432)
Thanks.
First take backup of complete config folder inside domain.It looks like you are using rdbms policy store inside domain.So check for security-realm tag in config.xml there you will able to find encrypted password change the same using newly encrypted password and your admin server should start.

Spring AMQP + RabbitMQ 3.3.5 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN

I am getting below exception
org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
Configuration: RabbitMQ 3.3.5 on windows
On Config file in %APPDATA%\RabbitMQ\rabbit.config
I have done below change as per https://www.rabbitmq.com/access-control.html
[{rabbit, [{loopback_users, []}]}].
I also tried creating a user/pwd - test/test doesn't seem to make it work.
Tried the Steps from this post.
Other Configuration Details are as below:
Tomcat hosted Spring Application Context:
<!-- Rabbit MQ configuration Start -->
<!-- Connection Factory -->
<rabbit:connection-factory id="rabbitConnFactory" virtual-host="/" username="guest" password="guest" port="5672"/>
<!-- Spring AMQP Template -->
<rabbit:template id="rabbitTemplate" connection-factory="rabbitConnFactory" routing-key="ecl.down.queue" queue="ecl.down.queue" />
<!-- Spring AMQP Admin -->
<rabbit:admin id="admin" connection-factory="rabbitConnFactory"/>
<rabbit:queue id="ecl.down.queue" name="ecl.down.queue" />
<rabbit:direct-exchange name="ecl.down.exchange">
<rabbit:bindings>
<rabbit:binding key="ecl.down.key" queue="ecl.down.queue"/>
</rabbit:bindings>
</rabbit:direct-exchange>
In my Controller Class
#Autowired
RmqMessageSender rmqMessageSender;
//Inside a method
rmqMessageSender.submitToECLDown(orderInSession.getOrderNo());
In My Message sender:
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
#Component("messageSender")
public class RmqMessageSender {
#Autowired
AmqpTemplate rabbitTemplate;
public void submitToRMQ(String orderId){
try{
rabbitTemplate.convertAndSend("Hello World");
} catch (Exception e){
LOGGER.error(e.getMessage());
}
}
}
Above exception Block gives below Exception
org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
Error Log
=ERROR REPORT==== 7-Nov-2014::18:04:37 ===
closing AMQP connection <0.489.0> (10.1.XX.2XX:52298 -> 10.1.XX.2XX:5672):
{handshake_error,starting,0,
{amqp_error,access_refused,
"PLAIN login refused: user 'guest' can only connect via localhost",
'connection.start_ok'}}
Pls find below the pom.xml entry
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
<version>1.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-amqp</artifactId>
<version>4.0.4.RELEASE</version>
</dependency>
Please let me know if you have any thoughts/suggestions
I am sure what Artem Bilan has explained here might be one of the reasons for this error:
Caused by: com.rabbitmq.client.AuthenticationFailureException:
ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN.
For details see the
but the solution for me was that I logged in to rabbitMQ admin page (http://localhost:15672/#/users) with the default user name and password which is guest/guest then added a new user and for that new user I enabled the permission to access it from virtual host and then used the new user name and password instead of default guest and that cleared the error.
To complete #cpu-100 answer,
in case you don't want to enable/use web interface, you can create a new credentials using command line like below and use it in your code to connect to RabbitMQ.
$ rabbitmqctl add_user YOUR_USERNAME YOUR_PASSWORD
$ rabbitmqctl set_user_tags YOUR_USERNAME administrator
$ rabbitmqctl set_permissions -p / YOUR_USERNAME ".*" ".*" ".*"
user 'guest' can only connect via localhost
That's true since RabbitMQ 3.3.x. Hence you should upgrade to the same version the client library, or just upgrade Spring AMQP to the latest version (if you use dependency managent system).
Previous version of client used 127.0.0.1 as default value for the host option of ConnectionFactory.
The error
ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
can occur if the credentials that your application is trying to use to connect to RabbitMQ are incorrect or missing.
I had this happen when the RabbitMQ credentials stored in my ASP.NET application's web.config file had a value of "" for the password instead of the actual password string value.
To allow guest access remotely, write this
[{rabbit, [{loopback_users, []}]}].
to here
c:\Users\[your user name]\AppData\Roaming\RabbitMQ\rabbitmq.config
then restart the rabbitmq windows service (Source https://www.rabbitmq.com/access-control.html)
On localhost , By default use 'amqp://guest:guest#localhost:5672'
So on a remote or hosted RabbitMQ. Let's say you have the following credentials
username: niceboy
password: notnice
host: goxha.com
port : 1597
then the uri you should pass will be
amqp://niceboy:notnice#goxha.com:1597
following the template amqp://user:pass#host:10000
if you have a vhost you can do amqp://user:pass#host:10000/vhost where the trailing vhost will be the name of your vhost
New solution:
The node module can't handle : in a password properly. Even url encoded, like it would work normally, it does not work.
Don't use typicalspecial characters from an URL in the password!
Like one of the following: : . ? + %
Original, wrong answer:
The error message clearly complains about using PLAIN, it does not mean the crendentials are wrong, it means you must use encrypted data delivery (TLS) instead of plaintext.
Changing amqp:// in the connection string to amqps:// (note the s) solves this.
just add login password to connect to RabbitMq
CachingConnectionFactory connectionFactory =
new CachingConnectionFactory("rabbit_host");
connectionFactory.setUsername("login");
connectionFactory.setPassword("password");
For me the solution was simple: the user name is case sensitive. Failing to use the correct caps will also lead to the error.
if you use the number as your password, maybe you should try to change your password using string.
I can login using deltaqin:000000 on the website, but had this while running the program. then change the password to deltaiqn. and it works.
I made exactly what #grepit made.
But I had to made some changes in my Java code:
In Producer and Receiver project I altered:
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("your-host-ip");
factory.setUsername("username-you-created");
factory.setPassword("username-password");
Doing that, you are connecting an specific host as the user you have created.
It works for me!
In my case I had this error, cuz of wrongly set password (I tried to use 5672, when the actual one in my system was 5676).
Maybe this will help someone to double check ports...
I was facing this issue due to empty space at the end of the password(spring.rabbitmq.password=rabbit ) in spring boot application.properties got resolved on removing the empty space. Hope this checklist helps some one facing this issue.
For C# coder, I tried below code and It worked, may be this can help someone so posting here.
scenario- RabbitMQ queue is running on another system in local area network but I was having same error.
by default there is a "guest" user exists. but you can not access remote server's queue (rabbitMq) using "guest" user so you need to create new user, Here I created "tester001" user to access data of remote server's queue.
ConnectionFactory factory = new ConnectionFactory();
factory.UserName = "tester001";
factory.Password = "testing";
factory.VirtualHost = "/";
factory.HostName = "192.168.1.101";
factory.Port = AmqpTcpEndpoint.UseDefaultPort;
If you tried all of these answers for your issue but you still got "ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN", maybe you should remove rabbitmq and install it with a newer version.
Newer version worked for me.
Add one user and pass and connect to them. You can add 1 user via env variables (e.g., useful when Rabbit initializes in a Docker): RABBITMQ_DEFAULT_USER and RABBITMQ_DEFAULT_PASS. See more details here:
https://stackoverflow.com/a/70676040/1200914
set ConnectionFactory or Connection hostname to localhost

Raven.Server.exe Failed to grant rights for listening to http

I have installed RavenDB 2.5.0 as Windows Service.
When I try to run Raven.Server.exe as Administrator or not I receive this:
Trying to revoke rights for http.sys
runas netsh http delete urlacl url=https://+:8080/
Trying to grant rights for http.sys
runas netsh http add urlacl url=http://+:8080/ user="Endri-PC\Endri"
Failed to grant rights for listening to http, exit codes: (1 and 1)
A critical error occurred while starting the server. Please see the exception de
tails bellow for more details:
System.InvalidOperationException: Could not write to location: C:\RavenDB\Databa
se\System. Make sure you have read/write permissions for this path. ---> Microso
ft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot access file, the fi
le is locked or in use
at Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator uuidGen
erator, OrderedPartCollection`1 documentCodecs)
--- End of inner exception stack trace ---
at Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator uuidGen
erator, OrderedPartCollection`1 documentCodecs)
at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configura
tion, TransportState transportState)
at Raven.Server.RavenDbServer..ctor(InMemoryRavenConfiguration settings)
at Raven.Server.Program.RunServerInDebugMode(RavenConfiguration ravenConfigur
ation, Boolean launchBrowser)
at Raven.Server.Program.RunInDebugMode(Nullable`1 anonymousUserAccessMode, Ra
venConfiguration ravenConfiguration, Boolean launchBrowser, Boolean noLog)
at Raven.Server.Program.<>c__DisplayClass34.<InteractiveRun>b__1b()
at Raven.Server.Program.InteractiveRun(String[] args)
at Raven.Server.Program.Main(String[] args)
Press any key to continue...
Any idea what to do ?
I just had this same problem while I was following the "Basic Concepts" section of the RavenDB documentation, with the following output:
C:\RavenDB>Raven.Server.exe
Trying to grant rights for http.sys
runas netsh http add urlacl url=http://+:8080/ user="User-PC\User"
Failed to grant rights for listening to http, exit codes: (0 and 1)
A critical error occurred while starting the server. Please see the exception details bellow for more details:
System.InvalidOperationException: Could not write to location: C:\RavenDB\Data.
Make sure you have read/write permissions for this path. ---> Microsoft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot access file, the file is locked or in use
<stack trace follows>
The issue was that the RavenDB installer had automatically started the RavenDB Server as a Windows Service, preventing the command-line Raven.Server.exe from being able to access the right directory. I just opened the Services control panel (Start menu -> services.msc) and stopped the RavenDB service. After that, starting Raven.Server.exe from the command line worked as demonstrated in the documentation.
Note that this is running on a Windows 7 x64 Professional machine in Development mode with RavenDB 2.5.2851.
You have neither the permission to access port 8080 nor the database folder. If you want to run RavenDB on your account, give yourself permissions for the folder C:\RavenDB\Database\System and run this command in an elevated console:
netsh http add urlacl url=http://+:8080/