Nextcloud – Error modifying files or folders: locked error



Yesterday I came across a problem in which I tried to modify (rename, delete, …) a folder and it returned an error.

Nextcloud logs (/var/www/nextcloud/data/nextcloud.log) showed the following:

"reqId":"Pf4KW9q1WDVe1YdmG0Mt","level":3,"time":"2019-09-10T16:36:53+00:00","remoteAddr":"63.223.129.127","user":"user1","app":"no app in context","method":"DELETE","url":"\/remote.php\/dav\/files\/user1\/ALBUMS\/New%20folder","message":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files\/8010dab5adf49336ecdaf75a2008d5ab\" is locked","Code":0,"Trace":[{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Files\/Storage\/Common.php","line":779,"function":"changeLock","class":"OC\\Lock\\DBLockingProvider","type":"->","args":["files\/8010dab5adf49336ecdaf75a2008d5ab",2]},{"file":"\/var\/www\/html\/nextcloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php","line":615,"function":"changeLock","class":"OC\\Files\\Storage\\Common","type":"->","args":["Nueva carpeta",2,{"__class__":"OC\\Lock\\DBLockingProvider"}

Solution

Enter maintenance mode

sudo -u www-data php occ maintenance:mode --on

Then, all entries of the table oc_file_locks … Read more

Security   Security – List available cipher suite using nmap



If you are in process of securing your web server or site, there are some tools and online resources that can help us a lot (in one of the following posts will show you some of them).

But simply using the command the fantastic nmap tool, another interesting feature is listing the available cipher suite certain site offers using the … Read more

Security   Security – View HTTP headers using tcpdump



If you need to trace the HTTP request and response headers by capturing the related packets, you can use tcpdump in this way:

 tcpdump -i ens192 -A -s 10240 'tcp port 80' | grep -v IP | egrep --line-buffered "..(GET |\.HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " |sed -r 's/..(GET |HTTP\/|POST |HEAD )/\n\n\1/g'

For example, filtering tcp port 80 and 192.168.10.100 IP address:… Read more

Home Server icon   Home Server (7) – Install Linux Debian virtual machine in ESX



In this 7th post of the Home Server series, after having configured a SSD drive, a working ESX environment and the RAID disks, let’s create our first virtual machine based on Debian Linux.

For the goal we want to achieve (hosting a web server, our personal files, personal streaming server, …) we do not even need the graphic … Read more

Icinga icon   Icinga – How to configure passive checks made easy (2)



In the previous post I explained what is the difference between Icinga active and passive checks, why can be interesting to use passive checks, what is the result format Icinga is expecting when processing those checks and the way I use to send those results (instead of using snmp traps).

Now it is time to show how to configure it … Read more

Icinga icon   Icinga – How to configure passive checks made easy (1)



As I posted long time ago for Nagios (Nagios – Using passive checks without agent), it is time to show an easy way to configure Icinga to perform passive checks (without using SNMP traps).

This is the first of two posts. In this I only want to make some theoretical explanations and then in the second I will … Read more

Security   Security – Create self signed SAN certificate with OpenSSL



This post explains how to generate self signed certificates with SAN – Subject Alternative Names using openssl. It is a common but not very funny task, only a minute is needed when using this method.

The example below generates a certificate with two SubAltNames: mydomain.com and www.mydomain.com

Create openssl configuration file

Create configuration file for openssh (In a Linux … Read more

Icinga icon   Icinga – Cannot login to Grafana. Forgot admin password



It is not the first time my Icinga suddenlty, stops showing the grafana graphs.
Icinga when cannot show Grafana graphs

Problem

If trying to log to Grafana, admin password is not accepted. I am pretty sure i have not changed the password but I am unable to login to Grafana.
Invalid username or password when login to Grafana
And even worse, given that I still have not configured Grafana SMTP section / admin … Read more

Icinga icon   Icinga2 – Understanding checks and notification types



Here I am trying to present (I hope in an easy way to understand) some Icinga concepts (maybe also applicable in Nagios) like active and passive checks, enabling and disabling freshness checks, soft and hard states,… and the related parameters to configure them.

ACTIVE and PASSIVE services

There are two types of services:

  • ACTIVE: Check initiated by the Icinga
Read more

Linux   Linux – Exim: Authenticated and TLS mail through smarthost



Exim is a very flexible and common MTA (mail transfer agent) in Unix systems.
This posts shows the way to configure Exim as client to send authenticated and encrypted (TLS) emails through a smarthost.

Lets suppose the smarthost email server is listening on port 587 for secure outgoing SMTP…

Configure exim to use the smarthost

To configure exim In … Read more