3

update

I submitted a bug report and the conclusion is that the nano version that's available through ipkg is 3 years outdated, and has been incorrectly modified or a dependency is broken.

Unfortunately the community-made package managers are either abandoned (ipkg) or incompatible (opkg). I suspect I'll run into similar problems if I keep trying to use the Synology for development so I'll try a different platform - but I'll leave this question up.

original

When I open any file in nano and line numbers are enabled, the line numbers are completely wrong, and appear on the wrong side!

This happens with any file. Here's one example:

nano with wrong line numbers

The actual file seems correct:

actual file contents

➜ ngnix-proxy-manager cat -A docker-compose.yml version: "3"$ services:$ app:$ image: 'jc21/nginx-proxy-manager:latest'$ restart: unless-stopped$ ports:$ # Public HTTP Port:$ - '80:80'$ # Public HTTPS Port:$ - '443:443'$ # Admin Web Port:$ - '81:81'$ # Add any other Stream port you want to expose$ # - '21:21' # FTP$ environment:$ # These are the settings to access your db$ DB_MYSQL_HOST: "db"$ DB_MYSQL_PORT: 3306$ DB_MYSQL_USER: "npm"$ DB_MYSQL_PASSWORD: "npm"$ DB_MYSQL_NAME: "npm"$ # If you would rather use Sqlite uncomment this$ # and remove all DB_MYSQL_* lines above$ # DB_SQLITE_FILE: "/data/database.sqlite"$ # Uncomment this if IPv6 is not enabled on your host$ # DISABLE_IPV6: 'true'$ volumes:$ - ./data:/data$ - ./letsencrypt:/etc/letsencrypt$ depends_on:$ - db$ db:$ image: 'jc21/mariadb-aria:latest'$ restart: unless-stopped$ environment:$ MYSQL_ROOT_PASSWORD: 'npm'$ MYSQL_DATABASE: 'npm'$ MYSQL_USER: 'npm'$ MYSQL_PASSWORD: 'npm'$ volumes:$ - ./data/mysql:/var/lib/mysql$ ➜ ngnix-proxy-manager od -c docker-compose.yml 0000000 v e r s i o n : " 3 " \n s e r 0000020 v i c e s : \n a p p : \n 0000040 i m a g e : ' j c 2 1 / n 0000060 g i n x - p r o x y - m a n a g 0000100 e r : l a t e s t ' \n r 0000120 e s t a r t : u n l e s s - s 0000140 t o p p e d \n p o r t s 0000160 : \n # P u b l i c 0000200 H T T P P o r t : \n 0000220 - ' 8 0 : 8 0 ' \n 0000240 # P u b l i c H T T P S 0000260 P o r t : \n - ' 0000300 4 4 3 : 4 4 3 ' \n # 0000320 A d m i n W e b P o r t : 0000340 \n - ' 8 1 : 8 1 ' 0000360 \n # A d d a n y 0000400 o t h e r S t r e a m p o 0000420 r t y o u w a n t t o e 0000440 x p o s e \n # - 0000460 ' 2 1 : 2 1 ' # F T P \n 0000500 e n v i r o n m e n t : \n 0000520 # T h e s e a r e 0000540 t h e s e t t i n g s t o 0000560 a c c e s s y o u r d b \n 0000600 D B _ M Y S Q L _ H 0000620 O S T : " d b " \n 0000640 D B _ M Y S Q L _ P O R T : 3 0000660 3 0 6 \n D B _ M Y S 0000700 Q L _ U S E R : " n p m " \n 0000720 D B _ M Y S Q L _ P A 0000740 S S W O R D : " n p m " \n 0000760 D B _ M Y S Q L _ N A M 0001000 E : " n p m " \n # 0001020 I f y o u w o u l d r a 0001040 t h e r u s e S q l i t e 0001060 u n c o m m e n t t h i s \n 0001100 # a n d r e m o v 0001120 e a l l D B _ M Y S Q L _ * 0001140 l i n e s a b o v e \n 0001160 # D B _ S Q L I T E _ F 0001200 I L E : " / d a t a / d a t a 0001220 b a s e . s q l i t e " \n 0001240 # U n c o m m e n t t 0001260 h i s i f I P v 6 i s n 0001300 o t e n a b l e d o n y o 0001320 u r h o s t \n # 0001340 D I S A B L E _ I P V 6 : ' t 0001360 r u e ' \n v o l u m e s 0001400 : \n - . / d a t a 0001420 : / d a t a \n - . 0001440 / l e t s e n c r y p t : / e t 0001460 c / l e t s e n c r y p t \n 0001500 d e p e n d s _ o n : \n 0001520 - d b \n d b : \n 0001540 i m a g e : ' j c 2 1 / 0001560 m a r i a d b - a r i a : l a t 0001600 e s t ' \n r e s t a r t 0001620 : u n l e s s - s t o p p e d 0001640 \n e n v i r o n m e n t 0001660 : \n M Y S Q L _ R O 0001700 O T _ P A S S W O R D : ' n p 0001720 m ' \n M Y S Q L _ D 0001740 A T A B A S E : ' n p m ' \n 0001760 M Y S Q L _ U S E R : 0002000 ' n p m ' \n M Y S 0002020 Q L _ P A S S W O R D : ' n p 0002040 m ' \n v o l u m e s : \n 0002060 - . / d a t a / m 0002100 y s q l : / v a r / l i b / m y 0002120 s q l \n 0002124 

Versions:

  • Synology DSM 6.2.4-25556
  • GNU nano, version 3.1

I've tried different combinations of shells and clients - the same problem occurs:

  • GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
  • zsh 5.2 (x86_64-buildroot-linux-gnu)
  • ohmyzsh - latest master
  • OS X Terminal
  • Windows Terminal 1.9.1942.0, with profile Powershell 7.1.3

I've tried reinstalling sudo /opt/bin/ipkg install nano --force-reinstall

nano correctly reads the nanorc file

> more $XDG_CONFIG_HOME/nano/nanorc set linenumbers 

Once I even got a crash:

> nano docker-compose.yml.save Sorry! Nano crashed! Code: 11. Please report a bug. 

The line number changes when I edit the content of a line: https://gfycat.com/unripeoblongafricanhornbill

  1. 211 - line-number-changes-0
  2. 225 - line-number-changes-1
  3. 239 - line-number-changes-2

When line numbers are disabled, nano works correctly. Here I've commented out the setting, and re-opened nanorc:

no-line-numbers-and-correct

Updated to DSM 7

I updated my Synology to DSM 7 and tried using nano again. Again, without set linenumbers, the output is garbled. Also, I get some nice error messages:

Badness: tried to display a line on row -1851878901 -- please report a bug

enter image description here

The row number changes a few times as the file is loaded, before I get this error:

Further warnings were suppressed

enter image description here

6
  • 2
    Does that happen with every file or just that one? If you look at the file with cat -A docker-compose.yaml, or even od -c docker-compose.yaml, is there anything odd in there, like stray escape codes? In any case, that does sound a bit like something that would be a bug in nano, and you might get better answers from its developers. Commented Aug 23, 2021 at 10:19
  • It happens with all files. Thanks for the commands, I've put the output in the question. I should also clarify that I'm using Windows Terminal / Powershell to ssh in. Thinking about it now I realise that it is a bit ridiculous that I'm using Terminal+Powershell+ssh+omz+zsh and 2 different OSes - something in this chain could be going wrong? Commented Aug 23, 2021 at 10:35
  • Update: I've ssh'd in with a Macbook and the exact same problem occurs, down to the same problem with the line numbers. It's something local to the Synology environment. Commented Aug 23, 2021 at 11:06
  • Ok, yeah, the file seems normal. I don't know anything about Synology, so I can't say anything about that. Just reminds me of an issue with GNU screen, if you fumble line wrapping off. Unclean terminal emulation can do strange stuff. Commented Aug 23, 2021 at 12:00
  • Welcome to Unix & Linux! I rolled back your recent edit adding an answer to the question in the text of the question. If you have a solution then consider adding that solution as a separate answer and accept it later. Accepting an answer will mark the question as resolved. Please see unix.stackexchange.com/help/someone-answers and unix.stackexchange.com/help/self-answer Commented Aug 29, 2021 at 9:25

1 Answer 1

0

[Copied from the question so that it's an answer. This is from the original poster]

I submitted a bug report and the conclusion is that the nano version that's available through ipkg is 3 years outdated, and has been incorrectly modified or a dependency is broken.

Unfortunately the community-made package managers are either abandoned (ipkg) or incompatible (opkg). I suspect I'll run into similar problems if I keep trying to use the Synology for development so I'll try a different platform - but I'll leave this question up.

10
  • This is an update, not an answer, as the issue is not resolved or identified and has no workaround. Commented Aug 29, 2021 at 5:11
  • 1
    @aSemy an answer explaining there is no solution is a valid answer Commented Aug 29, 2021 at 7:37
  • My update does not specify there is no solution. It indicates potential causes and impediments. Commented Aug 29, 2021 at 8:03
  • @aSemy It seems to me that this text resolves the issue for now. It may not be a good resolution, but it's currently the best one. Whenever the bug report is acted upon (or not), the answer could be updated. Commented Aug 29, 2021 at 9:35
  • "Here is a potential cause and also it is difficult to resolve" is not a resolution. I would be irritated if I had this problem, came to a site for a solution, and there is no solution. Commented Aug 29, 2021 at 10:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.