Error reading lock file /etc/weewx/.weewx.conf.swp: Not enough data read

2,124 views
Skip to first unread message

Kimberly Olsen

unread,
Apr 6, 2018, 10:48:18 PM4/6/18
to weewx-user
I've been attempting to get ftp working this morning and suddenly when attempting to edit weewx.conf, I get the message below

This is when I am ssh-ing in from my Mac.
When I attempt to edit the file directly on the pi, I cannot save it

Any ideas ?

Error reading lock file /etc/weewx/.weewx.conf.swp: Not enough data read 

Kimberly Olsen

unread,
Apr 6, 2018, 10:49:50 PM4/6/18
to weewx-user
I should have added I have stopped WeeWX before editing but that makes no difference

Glenn McKechnie

unread,
Apr 6, 2018, 11:25:47 PM4/6/18
to weewx...@googlegroups.com
Close the editor and delete that swap file --  /etc/weewx/.weewx.conf.swp
Then try opening weewx.conf again.
ie; see if it's a problem with the swap file

Which editor? nano? and vi (vim)?

It won't matter if weewx is running or not. weewx.conf can be edited at any time. Any changes made won't take affect until you restart weewx .





Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

On 7 April 2018 at 12:49, Kimberly Olsen <kimberly...@gmail.com> wrote:
I should have added I have stopped WeeWX before editing but that makes no difference

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vince

unread,
Apr 7, 2018, 1:52:03 PM4/7/18
to weewx-user
You're running into the classic problem almost all new pi users run into.  The account you're using is almost certainly 'pi' which is a non-privlieged account.  You are trying to edit a file in a location that only root has privileges for.   Run "sudo vi /etc/weewx/weewx.conf" so that your vi session is running as root.

Same for your other post about trying to save a skin.  You're trying to save the skin to a root-owned directory, using a non-privileged account.   Again, preface your commands there with 'sudo'.
Message has been deleted

Kimberly Olsen

unread,
Apr 7, 2018, 3:24:03 PM4/7/18
to weewx-user
I am using the command sudo nano /etc/weewx/weewx.conf which resulted in the error
I am not unfamiliar with Linux basics having used some Unix in the past

Unfortunately I started with a fresh install, got new skins installed and despite being able to edit weewx.conf all day, again now it fails

K

Kimberly Olsen

unread,
Apr 7, 2018, 3:39:29 PM4/7/18
to weewx-user
If I attempt to edit weewx.conf in vi rather than nano, I get informed that the file is open and that the swap file is newer etc etc

Kimberly Olsen

unread,
Apr 7, 2018, 3:44:22 PM4/7/18
to weewx-user
and when I look for weewx.conf.swp, it doesn't exist...no nothing strange here ;-)



On Saturday, 7 April 2018 12:48:18 UTC+10, Kimberly Olsen wrote:

Pete Geenhuizen

unread,
Apr 7, 2018, 6:33:09 PM4/7/18
to weewx...@googlegroups.com, Kimberly Olsen

When you edit a file with  vi, which is actually a link to vim, it creates a backup file in your case .weewx.conf.swp.  because it has a dot in front of the name the best way to see it is by using ls -la

When you save the file and exit vi the .filename.swp is removed, if however you kill the vi session or exit it any other abnormal way the .filename.swp file won't be removed.

You have 2 options simply remove the file or if you have some changes in the file that you want to recover then the best option is to recover the file which will have all the changes that you made in your last edit.  To recover the last edits use vi -r save the file exit vi and then remove the .filename.swp file.

Like I said, to avoid this from happening always properly end the vi session.

Other than that it sounds like you are dealing with permission/ownership error, in that case check both the original file and the .filename.swp ownership.

I hope that this helps

Pete

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
Unencumbered by the thought process.  
 -- Click and Clack the Tappet brothers 

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Kimberly Olsen

unread,
Apr 8, 2018, 12:13:14 AM4/8/18
to weewx-user
I absolutely did end the nano session (i prefer nano) properly every time- so there must be another explanation.
Yesterday I was editing from SSH and was experiencing extreme lag. I am betting the two things are related

K


On Saturday, 7 April 2018 12:48:18 UTC+10, Kimberly Olsen wrote:

Kimberly Olsen

unread,
Apr 8, 2018, 12:16:08 AM4/8/18
to weewx-user
Glenn,

I can see no swap file despite vi insisting there is. No amount of ls -la will find one

K

On Saturday, 7 April 2018 12:48:18 UTC+10, Kimberly Olsen wrote:

Glenn McKechnie

unread,
Apr 8, 2018, 1:45:59 AM4/8/18
to weewx...@googlegroups.com
Apparently an older version of nano would return that error at
seemingly random times, possibly due to file corruption.
If you were suffering extreme lag in the connection then perhaps it is
related to that.
Check your version of nano, or update it if you feel it's an older one.
I really can't help much more with nano as I don't use it.

vi (vim)
In the absence of a suitable user config file, the default action is
to place it in the same directory as the file you are editiing, so in
this case it would be in /etc/weewx
If you ignore the lock file warning and decide to edit the file
anyway, you'll create another swp file - ending as .swo . Rinse repeat
for the next letter.
if vi is giving no clues about the swap files location then try using find.

sudo find /etc/weewx -name *.sw[nop]
If that fails to return anything, broaden the search to...
sudo find / -name *.sw[nop]


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie


Kimberly Olsen

unread,
Apr 8, 2018, 3:31:13 AM4/8/18
to weewx-user
Hi Glenn


Yep did all of that. No sign of a swap file. I edited weewx.conf and all is fine

K

On Saturday, 7 April 2018 12:48:18 UTC+10, Kimberly Olsen wrote:

Andrew Milner

unread,
Apr 8, 2018, 3:31:20 AM4/8/18
to weewx-user
if you are working on a local network there should be no noticeable lag at all when editing a file - perhaps you should investigate the cause of the lag.

do ensure all your rpi sw is up to date though

i use putty to ssh into all my pis and pizeros - and have never had an issue with lag even when weewx is running together with web server and MySQL or a gui is running to display on a touchscreen - never any issues at all, although on two of the rpi's I do use a hard disk rather than the sd.
Reply all
Reply to author
Forward
0 new messages