Linux error reading lock file

Содержание
  1. Unable to Edit fstab: [ Error reading lock file /etc/.fstab.swp: Not enough data read ]
  2. SawKyrom
  3. bbgeek17
  4. SawKyrom
  5. [Solved] Error reading lock file /etc/.profile.swp not enough data read.
  6. Before you get into this article, you may find here are the most frequent solved problems here it is .
  7. This article covers a detailed step by step solution and there are significant reasons this content serves your purpose. Success
  8. I’m happy to share the piece of tip here that worked for me and saved my time a lot.
  9. Let’s begin now,
  10. Introduction
  11. Before begin, a bit to describe my development work here is the project developed in PHP Laravel Framework with LAMP (Linux Apache, MySQL and Php). The completed Php project is deployed in AWS Server instance in where Linux Ubuntu 18.4 OS installed.
  12. Over a period of time, php project captures error logs increased size and occupied disk space in server instance.
  13. As you may have encountered these terms like error writing lock file no space left on device, swp: Not enough data read, .swp file. There could be lot of reasons why we encounter » Not enough space left «.
  14. Similarly here are the most frequent search terms as you and me searched a lot to get here.
  15. As said above .swp file may be the one causing the error. In your case .swp could be profile or default or local.
  16. Problem Description
  17. This is what happened in my case,
  18. I logged into server instance where my php project is deployed which is Ubuntu 18.4, and opened command Terminal ( Ctrl + Alt + T ). I navigated to project folder.
  19. When exactly this error thrown?
  20. There was a random common error in php project, if you are php background I’m sure you know it .env file and its purposes.
  21. As said in above box, I actually did not configure correctly, setting to APP_DEBUG=true in .env file is fine for development.
  22. Whereas when you deploy your project in server it is highly not recommended to set as true. It should be set to false as below
  23. Why setting to false is important?
  24. Its because when you set APP_Debug = true in .env file means when you encounter error in application the exception thrown in browser along with whole .env file expose everything as plain text.
  25. Imagine anyone sees the error can also read your database user name and password.
  26. Apart from above suggested let’s get into the main problem description,
  27. In the project folder .env file resides in root folder, now I try to open it (to change APP_DEBUG=false) in command line editor in terminal with this command $ sudo nano .env
  28. After executing the command error show as » Error reading lock file ./..env.swp not enough data read «. This is because any file you open with any editor .swp file gets created. And in here, log file size huge and space on device is insufficient to open the file in editor.
  29. If you have searched google many sites suggested different approach that did not help as much, that’s the only reason I’m providing helping hand, explore more here
  30. Get Set Solution helps everyone with details steps with google search.
  31. So how I get rid of not enough data read on device? Let’s move to solution section.
  32. Solution
  33. The simple solution is provided in image below.
  34. These are the 4 steps to do
  35. STEP 1 : Navigate to your Project Folder
  36. I have placed my project folder in /home/ubuntu/projects/generator.
  37. /home is home directory
  38. /ubuntu is user account
  39. /projects is the folder name
  40. /generator is the actual php application
  41. STEP : 2 Find if you have hidden .swp files
  42. As circled 1 in image, execute this command find . -name «*.swp»
  43. the result will be as below as circled 2 list of .swp files available in my project
  44. STEP 3 : Delete the .swp files
  45. As circled 3 in image, execute the command find . -name «*.swp» -delete
  46. After executing command, you find all the .swp files are deleted
  47. STEP 4: Ensure you have deleted .swp files are not
  48. Just execute the same command find . -name «*.swp» this takes to next line that indicates you have deleted .swp files successfully
  49. If you have missed all 4 steps, you can refer to below image described.
  50. So what’s next move?
  51. Now you can proceed to open .env file using this command, that’s all done.
  52. $ sudo nano .env
  53. Summary
  54. So far, this article explains the problem detailed, development environment software, what caused error and solutions step by step that helps everyone.
  55. The solution is applicable for Linux Ubuntu OS, helps to find .swp files to remove.
  56. You may like these posts
  57. Post a Comment
  58. 1 Comments
  59. Recent Posts
  60. Tags
  61. Get Set Solution
Читайте также:  Перезапустить службу звука linux

Unable to Edit fstab: [ Error reading lock file /etc/.fstab.swp: Not enough data read ]

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

SawKyrom

New Member

Any attempt to edit the /etc/fstab file in Proxmox VE 6.4-13 with nano results in [ Error reading lock file /etc/.fstab.swp: Not enough data read ]. The file is empty and will not save any changes.

Screenshot (324).png

Please see following file status information:

cat etc/fstab #      /dev/pve/root / ext4 errors=remount-ro 0 1 UUID=A7B3-7337 /boot/efi vfat defaults 0 1 /dev/pve/swap none swap sw 0 0 proc /proc proc defaults 0 0

I’ve check the read/write permissions and did a CHMOD 644

root@proxmox:/etc# ls -al /etc/fstab -rw-r--r-- 1 root root 207 Jun 2 20:04 /etc/fstab
root@proxmox:/etc# lsattr /etc/fstab --------------e---- /etc/fstab
root@proxmox:/etc# find . -name "*.swp" ./.fstab.swp

I’m sure this is a simple fix. Should I just cp the fstab file to fstabbackup and remake the file with the cat output and edits? Or will that cause a boot error.

bbgeek17

Famous Member

Are you out of space by chance?

Ultra low latency all-NVME shared storage for Proxmox — https://www.blockbridge.com/proxmox

SawKyrom

New Member

@bbgeek17 Thank you for the reply. There is plenty of storage space on all drives, but you bring up a good point. There was an episode previously where syslog file overfilled the boot SSD with errors from an USB device. I deleted the syslog file, removed the device and all was forgotten. I wonder if the fstab.swp was created during this time and is a remnant of that issue? Based on your google search article, it sounds like the correct action is to rm the fstab.swp file. I will give it another 24hrs for other replies before I dare to delete an important system file and then report back to you.

I also attempted to edit etc/fstab with vi and received the following error thus supporting idea of fstab.swp file conflicting with fstab:

E325: ATTENTION Found a swap file by the name "/etc/.fstab.swp" owned by: root dated: Mon Jul 12 21:34:36 2021 [cannot be read] While opening file "/etc/fstab" dated: Wed Jun 2 20:04:31 2021 (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/fstab" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/.fstab.swp" to avoid this message. "/etc/fstab" 5 lines, 207 characters

In the end, I think your articles recommendation to delete .fstab.swp is the most logical. Maybe a mv command versus rm to start. Incidentally, I did a DuckDuckGo search and that article did not appear. Maybe I should start using Google again.

Читайте также:  Which linux desktop environment is best

Источник

[Solved] Error reading lock file /etc/.profile.swp not enough data read.

Before you get into this article, you may find here are the most frequent solved problems here it is .

This article covers a detailed step by step solution and there are significant reasons this content serves your purpose. Success

I’m happy to share the piece of tip here that worked for me and saved my time a lot.

Let’s begin now,

Introduction

Before begin, a bit to describe my development work here is the project developed in PHP Laravel Framework with LAMP (Linux Apache, MySQL and Php). The completed Php project is deployed in AWS Server instance in where Linux Ubuntu 18.4 OS installed.

Over a period of time, php project captures error logs increased size and occupied disk space in server instance.

  • Software Involved
  • Linux — Ubuntu 18.4
  • Linux Command Terminal
  • PHP — Laravel Framework
  • MySQL

As you may have encountered these terms like error writing lock file no space left on device, swp: Not enough data read, .swp file. There could be lot of reasons why we encounter » Not enough space left «.

As said above .swp file may be the one causing the error. In your case .swp could be profile or default or local.

Problem Description

This is what happened in my case,

I logged into server instance where my php project is deployed which is Ubuntu 18.4, and opened command Terminal ( Ctrl + Alt + T ). I navigated to project folder.

When exactly this error thrown?

There was a random common error in php project, if you are php background I’m sure you know it .env file and its purposes.

As said in above box, I actually did not configure correctly, setting to APP_DEBUG=true in .env file is fine for development.

Whereas when you deploy your project in server it is highly not recommended to set as true. It should be set to false as below

Why setting to false is important?

Its because when you set APP_Debug = true in .env file means when you encounter error in application the exception thrown in browser along with whole .env file expose everything as plain text.

Imagine anyone sees the error can also read your database user name and password.

Apart from above suggested let’s get into the main problem description,

In the project folder .env file resides in root folder, now I try to open it (to change APP_DEBUG=false) in command line editor in terminal with this command $ sudo nano .env

After executing the command error show as » Error reading lock file ./..env.swp not enough data read «. This is because any file you open with any editor .swp file gets created. And in here, log file size huge and space on device is insufficient to open the file in editor.

If you have searched google many sites suggested different approach that did not help as much, that’s the only reason I’m providing helping hand, explore more here

Get Set Solution helps everyone with details steps with google search.

Solve Error reading lock file

So how I get rid of not enough data read on device? Let’s move to solution section.

Solution

The simple solution is provided in image below.

These are the 4 steps to do

  • 1. Navigate to your Project folder
  • 2. Find if you have hidden .swp files in folder
  • 3. Delete the .swp files
  • 4. Ensure you have deleted or not
Читайте также:  Вывод содержимого директории linux

STEP 1 : Navigate to your Project Folder

I have placed my project folder in /home/ubuntu/projects/generator.

/home is home directory

/ubuntu is user account

/projects is the folder name

/generator is the actual php application

STEP : 2 Find if you have hidden .swp files

As circled 1 in image, execute this command find . -name «*.swp»

the result will be as below as circled 2 list of .swp files available in my project

.swp files

STEP 3 : Delete the .swp files

As circled 3 in image, execute the command find . -name «*.swp» -delete

After executing command, you find all the .swp files are deleted

STEP 4: Ensure you have deleted .swp files are not

Just execute the same command find . -name «*.swp» this takes to next line that indicates you have deleted .swp files successfully

If you have missed all 4 steps, you can refer to below image described.

Solved Error reading lock file not enough space on disk

So what’s next move?

Now you can proceed to open .env file using this command, that’s all done.

$ sudo nano .env

Summary

So far, this article explains the problem detailed, development environment software, what caused error and solutions step by step that helps everyone.

The solution is applicable for Linux Ubuntu OS, helps to find .swp files to remove.

You may like these posts

Post a Comment

1 Comments

Recent Posts

Tags

  • .NET Core 22
  • Architecture 7
  • Artifical Intelligence 2
  • C# 50
  • ChatBot 1
  • Cloud Computing 11
  • Conference 4
  • GitHub 1
  • Google 8
  • Linked Server 1
  • Microsoft 31
  • Mobile Development 3
  • MVC 5 Interview Q&A 1
  • MySQL 7
  • Power BI 4
  • SEO 1
  • SignalR 1
  • SQL 10
  • SQL Server 2017 7
  • Technology 26
  • TFS Server 2
  • Visual Studio 21
  • Visual Studio 2017 11
  • Visual Studio 2017 Features 2
  • Visual Studio 2019 15
  • Visual Studio Code 8
  • Widgets 2
  • Xamarin iOS 3
Get started
About us
Support
Why GetSetSolution?

A completely free knowledge sharing center about software technologies Microsoft C#, Visual Studio, .NET, ASP.NET, MVC, .NET Core, Mobile Development, Cloud Computing, Power BI,SQL Server, MySQL, Laravel PHP, sample project codes, Top most companies free interview questions and answers, Application Development Errors resolved step by step.

Get Set Solution

Источник

Оцените статью
Adblock
detector