Gitlab: Disallowed command


#1

Hi,

we are trying to configure GitLab to work with dvc. Git lfs is enabled for the repository yet. I installed dvc client on a local machine. Ran dvc init, dvc add, git push and when I try to run dvc push I’ve got an error:

roman@vs-roman:~/dev/project$ dvc push
Preparing to upload data to 'ssh://git@gitlab.cvanalytics.pro:/home/git/gitlab/shared/lfs-objects/box/box.neuro.git'
Preparing to collect status from ssh://git@gitlab.cvanalytics.pro:/home/git/gitlab/shared/lfs-objects/box/box.neuro.git
[#########                     ] 30% Collecting information/usr/lib/dvc/paramiko/ecdsakey.py:164: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
/usr/lib/dvc/paramiko/kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
/usr/lib/dvc/paramiko/kex_ecdh_nist.py:96: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
/usr/lib/dvc/paramiko/kex_ecdh_nist.py:111: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
Error: failed to push data to the cloud - ssh command 'find /box/box.neuro.git -type f -follow -print' finished with non-zero return code 1': GitLab: Disallowed command

Where to find instructions for server installation?
What should I do to fix the problem?

UPD: changed url after port reconfiguration according to this topic


#2

Hi @RomanS !

Could you pelase run that same command with -v added (e.g. dvc push -v) and show us the logs?

Thanks,
Ruslan


#3

I would prefer to attach text file but forum denied txt format. So, here it is

roman@vs-roman:~/dev/box.neuro$ dvc push -v
Debug: PRAGMA user_version;
Debug: fetched: [(3,)]
Debug: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
Debug: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
Debug: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
Debug: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
Debug: PRAGMA user_version = 3;
Preparing to upload data to 'ssh://git@gitlab.cvanalytics.pro:/home/git/gitlab/shared/lfs-objects/box/box.neuro.git'
Preparing to collect status from ssh://git@gitlab.cvanalytics.pro:/home/git/gitlab/shared/lfs-objects/box/box.neuro.git
[#########                     ] 30% Collecting informationDebug: Establishing ssh connection with 'gitlab.cvanalytics.pro' through port '2222' as user 'git'
/usr/lib/dvc/paramiko/ecdsakey.py:164: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
/usr/lib/dvc/paramiko/kex_ecdh_nist.py:39: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
/usr/lib/dvc/paramiko/kex_ecdh_nist.py:96: CryptographyDeprecationWarning: Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point
/usr/lib/dvc/paramiko/kex_ecdh_nist.py:111: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
Debug: SELECT count from state_info WHERE rowid=1
Debug: fetched: [(1,)]
Debug: UPDATE state_info SET count = 1 WHERE rowid = 1
Error: failed to push data to the cloud - ssh command 'find /home/git/gitlab/shared/lfs-objects/box/box.neuro.git -type f -follow -print' finished with non-zero return code 1': GitLab: Disallowed command

------------------------------------------------------------
Traceback (most recent call last):
  File "dvc/command/data_sync.py", line 55, in do_run
  File "dvc/project.py", line 889, in push
  File "dvc/data_cloud.py", line 129, in push
  File "dvc/remote/local.py", line 677, in push
  File "dvc/remote/local.py", line 654, in _process
  File "dvc/remote/local.py", line 574, in status
  File "dvc/remote/base.py", line 301, in cache_exists
  File "dvc/remote/base.py", line 254, in all
  File "dvc/remote/ssh.py", line 387, in list_cache_paths
  File "dvc/remote/ssh.py", line 183, in _exec
RemoteCmdError: ssh command 'find /home/git/gitlab/shared/lfs-objects/box/box.neuro.git -type f -follow -print' finished with non-zero return code 1': GitLab: Disallowed command

------------------------------------------------------------

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
Debug: Analytics is enabled.
Debug: Trying to spawn '['/usr/lib/dvc/dvc', u'daemon', u'-q', u'analytics', '/tmp/tmpVrp5iK']' with env '{'LC_NUMERIC': 'ru_RU.UTF-8', 'QT4_IM_MODULE': 'xim', 'GJS_DEBUG_OUTPUT': 'stderr', 'COLORTERM': 'truecolor', 'XDG_CURRENT_DESKTOP': 'ubuntu:GNOME', 'XDG_SESSION_TYPE': 'x11', 'QT_IM_MODULE': 'xim', 'LOGNAME': 'roman', 'USER': 'roman', 'PATH': '/usr/local/cuda-10.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'XDG_VTNR': '2', 'HOME': '/home/roman', 'DISPLAY': ':1', 'SSH_AGENT_PID': '3148', 'LANG': 'en_US.UTF-8', 'TK_LIBRARY': '/usr/lib/dvc/tk', 'TERM': 'xterm-256color', 'SHELL': '/bin/bash', 'XAUTHORITY': '/run/user/1000/gdm/Xauthority', 'LANGUAGE': 'en_US', 'SESSION_MANAGER': 'local/vs-roman:@/tmp/.ICE-unix/3071,unix/vs-roman:/tmp/.ICE-unix/3071', 'LC_MEASUREMENT': 'ru_RU.UTF-8', 'CLUTTER_IM_MODULE': 'xim', 'LD_LIBRARY_PATH': '/usr/local/cuda-10.0/lib64', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'QT_ACCESSIBILITY': '1', 'WINDOWPATH': '2', 'XMODIFIERS': '@im=ibus', 'GIO_LAUNCHED_DESKTOP_FILE_PID': '14126', 'GPG_AGENT_INFO': '/run/user/1000/gnupg/S.gpg-agent:0:1', 'LC_MONETARY': 'ru_RU.UTF-8', 'USERNAME': 'roman', 'XDG_SESSION_DESKTOP': 'ubuntu', 'GIO_LAUNCHED_DESKTOP_FILE': '/usr/share/applications/guake-prefs.desktop', 'XDG_RUNTIME_DIR': '/run/user/1000', 'LC_IDENTIFICATION': 'ru_RU.UTF-8', 'LC_ADDRESS': 'ru_RU.UTF-8', 'PYTHONPATH': '/home/roman/dev/box.neuro', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'VTE_VERSION': '5202', 'TCL_LIBRARY': '/usr/lib/dvc/tcl', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '2', 'LC_TIME': 'ru_RU.UTF-8', 'TEXTDOMAINDIR': '/usr/share/locale/', 'GNOME_SHELL_SESSION_MODE': 'ubuntu', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'XDG_SESSION_ID': '3', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', '_': '/usr/bin/dvc', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/etc/xdg', 'GTK_MODULES': 'gail:atk-bridge', 'GUAKE_TAB_UUID': 'f2dfbc28-6b49-476d-a06c-498f0c95405f', 'OLDPWD': '/home/roman/.local/share/Trash/files', 'LC_TELEPHONE': 'ru_RU.UTF-8', 'PAPERSIZE': 'a4', 'SHLVL': '1', 'PWD': '/home/roman/dev/box.neuro', 'LC_PAPER': 'ru_RU.UTF-8', 'TEXTDOMAIN': 'im-config', 'LC_NAME': 'ru_RU.UTF-8', 'XDG_MENU_PREFIX': 'gnome-', 'LD_LIBRARY_PATH_ORIG': '/usr/local/cuda-10.0/lib64', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'GJS_DEBUG_TOPICS': 'JS ERROR;JS LOG', 'XDG_SEAT': 'seat0'}'
Debug: Spawned '['/usr/lib/dvc/dvc', u'daemon', u'-q', u'analytics', '/tmp/tmpVrp5iK']'

#4

Thanks! I’ve noticed that you are using a pretty strange remote directory: ssh://git@gitlab.cvanalytics.pro:/home/git/gitlab/shared/lfs-objects/box/box.neuro.git . It seems like there is a confusion. Why are you trying to store dvc cache under lfs-objects? Also, is box.neuro.git a file? Mind that dvc doesn’t use git-lfs in any way. What you should do instead is to simply create a directory on your server and specify it as a dvc remote location, that dvc will push its cache to.


#5

I’m not very strong in server management, so I used url given by my colleague. It was folder over lfs. We fixed it and now everything is fine. Thank you!


#6

@RomanS Glad to hear it works! :slight_smile: