Curl in --def exec - Getting: sh: 1: curl: not found

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
mrm1st3r
Posts: 7
Joined: 25 Oct 2016, 09:06

Curl in --def exec - Getting: sh: 1: curl: not found

Post by mrm1st3r »

I think this might be a Linux permission or path problem, rather than a Filebot one, but I figured I'd try here, seeing as I've really got no idea at this point.

My error:

Code: Select all

sh: 1: curl: not found
I installed Filebot 4.7.8 using the software manager on Ubuntu 16.04 LTS. Curl is working perfectly when called (without Filebot) in shell, and in other bash scripts. I've also tried putting my curl command in a script and calling that in Filebot, but I get the same error.

This is the command I'm using, pasting directly into shell. Curling google at this point for testing - will be an API when its working:

Code: Select all

filebot -script fn:amc --action move -non-strict "/home/<USER>/Downloads/complete" --conflict auto --def deleteAfterExtract=y --def exec="curl www.google.com"
Getting this output:

Code: Select all

Run script [fn:amc] at [Thu Mar 23 20:28:30 AEDT 2017]
Parameter: exec = curl www.google.com
Argument[0]: /home/<USER>/Downloads/complete
Input: /home/<USER>/Downloads/complete/New Girl - S01E01 - Pilot.mp4
xattr: [New Girl - S01E01 - Pilot.mp4] => [New Girl - 1x01 - Pilot]
Group: [tvs:new girl] => [New Girl - S01E01 - Pilot.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [New Girl]
Fetching episode data for [New Girl]
[MOVE] From [/home/<USER>/Downloads/complete/New Girl - S01E01 - Pilot.mp4] to [/home/<USER>/Downloads/complete/TV Shows/New Girl/Season 01/New Girl - S01E01 - Pilot.mp4]
Processed 1 files
Execute: curl www.google.com
sh: 1: curl: not found
Done ヾ(@⌒ー⌒@)ノ
Seems like sh can't see curl...A path issue? "whereis curl" outputs:

Code: Select all

curl: /usr/bin/curl /usr/include/curl /usr/share/man/man1/curl.1.gz

If I replace "curl" with "/usr/bin/curl" I still get the same error:

Code: Select all

sh: 1: /usr/bin/curl: not found
Any help or suggestions would be awesome - Starting to chase my tail, for what I bet is a very simple thing I'm missing.
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Curl in --def exec - Getting: sh: 1: curl: not found

Post by rednoah »

I'd start by narrowing down the problem:

Do other commands work?

Code: Select all

--def exec="date; whoami"
Is curl in the $PATH?

Code: Select all

--def exec="which curl"
What is the $PATH?

Code: Select all

--def exec="printenv"
:idea: Please read the FAQ and How to Request Help.
mrm1st3r
Posts: 7
Joined: 25 Oct 2016, 09:06

Re: Curl in --def exec - Getting: sh: 1: curl: not found

Post by mrm1st3r »

date; whoami

Code: Select all

Execute: date; whoami
Thu Mar 23 22:25:42 AEDT 2017
sh: 1: whoami: Permission denied
Done ヾ(@⌒ー⌒@)ノ
which curl

Code: Select all

Processed 1 files
Execute: which curl
Done ヾ(@⌒ー⌒@)ノ
printenv - I've replaced my username with "<USER>"

Code: Select all

Execute: printenv
LESSOPEN=| /usr/bin/lesspipe %s
GNOME_KEYRING_PID=
USER=<USER>
SNAP_COMMON=/var/snap/filebot/common
LANGUAGE=en_AU:en
UPSTART_INSTANCE=
GIO_MODULE_DIR=/home/<USER>/snap/filebot/8/.cache/gio-modules
FONTCONFIG_PATH=/snap/filebot/8/etc/fonts/conf.d
XDG_SEAT=seat0
SESSION=ubuntu
APP_DATA=/home/<USER>/snap/filebot/8/data
XDG_SESSION_TYPE=x11
COMPIZ_CONFIG_PROFILE=ubuntu
LD_LIBRARY_PATH=/snap/filebot/8:/var/lib/snapd/lib/gl:/var/lib/snapd/void:/snap/filebot/8/usr/lib/x86_64-linux-gnu:/snap/filebot/8/usr/lib/x86_64-linux-gnu/mesa:/snap/filebot/8/usr/lib/x86_64-linux-gnu/pulseaudio:/snap/filebot/8/usr/lib/x86_64-linux-gnu/mesa-egl:/snap/filebot/8/usr/lib/x86_64-linux-gnu/mesa::/snap/filebot/8/lib:/snap/filebot/8/usr/lib:/snap/filebot/8/lib/x86_64-linux-gnu:/snap/filebot/8/usr/lib/x86_64-linux-gnu:/snap/filebot/8/usr/lib/x86_64-linux-gnu/mesa:/snap/filebot/8/usr/lib/x86_64-linux-gnu/mesa-egl:/snap/filebot/8/usr/lib/x86_64-linux-gnu/dri:/var/lib/snapd/lib/gl:/snap/filebot/8/usr/lib/x86_64-linux-gnu/libunity:/snap/filebot/8/usr/lib/x86_64-linux-gnu/pulseaudio
SHLVL=2
XDG_CACHE_HOME=/home/<USER>/snap/filebot/8/.cache
SNAP_LIBRARY_PATH=/var/lib/snapd/lib/gl:/var/lib/snapd/void
HOME=/home/<USER>/snap/filebot/8
QT4_IM_MODULE=xim
APP_ROOT=/snap/filebot/8
SNAP_USER_DATA=/home/<USER>/snap/filebot/8
DESKTOP_SESSION=ubuntu
GTK_PATH=/snap/filebot/8/usr/lib/x86_64-linux-gnu/gtk-2.0
GI_TYPELIB_PATH=/snap/filebot/8/usr/lib/girepository-1.0:/snap/filebot/8/usr/lib/x86_64-linux-gnu/girepository-1.0
GTK_IM_MODULE_FILE=/home/<USER>/snap/filebot/8/.cache/immodules/immodules.cache
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
GTK_MODULES=gail:atk-bridge:unity-gtk-module
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
INSTANCE=
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-kRwDmAzC4x
SNAP_REVISION=8
GNOME_KEYRING_CONTROL=
GST_PLUGIN_SCANNER=/snap/filebot/8/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner
QT_QPA_PLATFORMTHEME=appmenu-qt5
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
IM_CONFIG_PHASE=1
SESSIONTYPE=gnome-session
UPSTART_JOB=unity7
XKB_CONFIG_ROOT=/snap/filebot/8/usr/share/X11/xkb
LOGNAME=<USER>
GTK_IM_MODULE=ibus
WINDOWID=71309103
_=/snap/filebot/8/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
SNAP_VERSION=4.7.8
XDG_SESSION_ID=c1
TERM=xterm-256color
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
SNAP_DID_REEXEC=1
GTK2_MODULES=overlay-scrollbar
PATH=/snap/filebot/8/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:/snap/filebot/8/usr/sbin:/snap/filebot/8/usr/bin:/snap/filebot/8/sbin:/snap/filebot/8/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
GDM_LANG=en_AU
GST_PLUGIN_SYSTEM_PATH=/snap/filebot/8/usr/lib/x86_64-linux-gnu/gstreamer-1.0
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
SNAP_DATA=/var/snap/filebot/8
XDG_RUNTIME_DIR=/run/user/1000/snap.filebot
LOCPATH=:/snap/filebot/8/usr/lib/locale
APP_CACHE=/home/<USER>/snap/filebot/8/cache
COMPIZ_BIN_PATH=/usr/bin/
DISPLAY=:0
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=Unity
XDG_DATA_HOME=/home/<USER>/snap/filebot/8/.local/share
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:*.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:*.jpg=01;35:*.jpeg=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:
XMODIFIERS=@im=ibus
XDG_SESSION_DESKTOP=ubuntu
XAUTHORITY=/home/<USER>/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<USER>
SNAP_USER_COMMON=/home/<USER>/snap/filebot/common
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SNAP_ARCH=amd64
GDK_PIXBUF_MODULEDIR=/snap/filebot/8/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders
SHELL=/bin/bash
MIR_SOCKET=/run/user/1000/mir_socket
GST_PLUGIN_PATH=/snap/filebot/8/usr/lib/x86_64-linux-gnu/gstreamer-1.0
APP_PREFS=/home/<USER>/snap/filebot/8/prefs
SNAP_REEXEC=
QT_ACCESSIBILITY=1
GDMSESSION=ubuntu
MIR_CLIENT_PLATFORM_PATH=/snap/filebot/8/usr/lib/x86_64-linux-gnu/mir/client-platform
FONTCONFIG_FILE=/snap/filebot/8/etc/fonts/fonts.conf
SNAP_NAME=filebot
LESSCLOSE=/usr/bin/lesspipe %s %s
UPSTART_EVENTS=xsession started
GPG_AGENT_INFO=/home/<USER>/.gnupg/S.gpg-agent:0:1
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1288
GDK_PIXBUF_MODULE_FILE=/home/<USER>/snap/filebot/8/.cache/gdk-pixbuf-loaders.cache
XDG_VTNR=7
QT_IM_MODULE=ibus
SNAP_LAUNCHER_ARCH_TRIPLET=x86_64-linux-gnu
LC_ALL=en_US.UTF-8
PWD=/home/<USER>
JAVA_HOME=/snap/filebot/8/usr/lib/jvm/java-8-openjdk-amd64
CLUTTER_IM_MODULE=xim
XDG_CONFIG_DIRS=/snap/filebot/8/etc/xdg:/snap/filebot/8/usr/xdg:/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
XDG_DATA_DIRS=/home/<USER>/snap/filebot/8/.local/share:/home/<USER>/snap/filebot/8:/snap/filebot/8/usr/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
SNAP=/snap/filebot/8
VTE_VERSION=4205
LIBGL_DRIVERS_PATH=/snap/filebot/8/usr/lib/x86_64-linux-gnu/dri
JOB=unity-settings-daemon
Done ヾ(@⌒ー⌒@)ノ
Output of printenv for normal terminal (/home/<USER>)

Code: Select all

printenv
XDG_VTNR=7
XDG_SESSION_ID=c1
CLUTTER_IM_MODULE=xim
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<USER>
SESSION=ubuntu
GPG_AGENT_INFO=/home/<USER>/.gnupg/S.gpg-agent:0:1
TERM=xterm-256color
SHELL=/bin/bash
XDG_MENU_PREFIX=gnome-
VTE_VERSION=4205
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
WINDOWID=71305430
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1288
GNOME_KEYRING_CONTROL=
GTK_MODULES=gail:atk-bridge:unity-gtk-module
USER=<USER>
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:*.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:*.jpg=01;35:*.jpeg=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:
QT_ACCESSIBILITY=1
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SESSION_MANAGER=local/<USER>-htpc:@/tmp/.ICE-unix/1577,unix/<USER>-htpc:/tmp/.ICE-unix/1577
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
PATH=/home/<USER>/bin:/home/<USER>/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
DESKTOP_SESSION=ubuntu
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=appmenu-qt5
XDG_SESSION_TYPE=x11
JOB=dbus
PWD=/home/<USER>
XMODIFIERS=@im=ibus
GNOME_KEYRING_PID=
LANG=en_AU.UTF-8
GDM_LANG=en_AU
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
IM_CONFIG_PHASE=1
COMPIZ_CONFIG_PROFILE=ubuntu
GDMSESSION=ubuntu
SESSIONTYPE=gnome-session
GTK2_MODULES=overlay-scrollbar
XDG_SEAT=seat0
HOME=/home/<USER>
SHLVL=1
LANGUAGE=en_AU:en
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
XDG_SESSION_DESKTOP=ubuntu
LOGNAME=<USER>
QT4_IM_MODULE=xim
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-kRwDmAzC4x
LESSOPEN=| /usr/bin/lesspipe %s
INSTANCE=
XDG_RUNTIME_DIR=/run/user/1000
DISPLAY=:0
XDG_CURRENT_DESKTOP=Unity
GTK_IM_MODULE=ibus
LESSCLOSE=/usr/bin/lesspipe %s %s
XAUTHORITY=/home/<USER>/.Xauthority
OLDPWD=/usr/bin
_=/usr/bin/printenv
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Curl in --def exec - Getting: sh: 1: curl: not found

Post by rednoah »

Now I'd try to figure out why date works and why whoami doesn't:

Code: Select all

Thu Mar 23 22:25:42 AEDT 2017
sh: 1: whoami: Permission denied
:idea: printenv tells me you're using snap. How come you didn't mention that in your OP?

:idea: Please run filebot -script fn:sysinfo and post the output.

@see viewtopic.php?f=3&t=1868
:idea: Please read the FAQ and How to Request Help.
mrm1st3r
Posts: 7
Joined: 25 Oct 2016, 09:06

Re: Curl in --def exec - Getting: sh: 1: curl: not found

Post by mrm1st3r »

I mentioned I installed Filebot with Ubuntu Software - it must have installed the snap package. Just assumed it was part of filebot, not a package thing - I'm obviously new to linux. If there's a preferred way to install on Linux that might be easier to get working, I'm all for it.

filebot -script fn:sysinfo

Code: Select all

FileBot 4.7.8 (r4847)
JNA Native: 5.1.0
MediaInfo: 0.7.82
7-Zip-JBinding: 9.20
Chromaprint: 1.2.0
Extended Attributes: OK
Unicode Filesystem: OK
GVFS: OK
Script Bundle: 2017-03-20 (r484)
Groovy: 2.4.8
JRE: OpenJDK Runtime Environment 1.8.0_121
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 4 Core / 857 MB Max Memory / 16 MB Used Memory
OS: Linux (amd64)
Package: SNAP
Data: /home/<USER>/snap/filebot/8/data
uname: Linux <USER>-htpc 4.8.0-41-generic #44~16.04.1-Ubuntu SMP Fri Mar 3 17:11:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Thanks for the help, it's much appreciated.
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Curl in --def exec - Getting: sh: 1: curl: not found

Post by rednoah »

I see. Didn't know that snap packages are listed in the Software Center yet. Since snap packages are self-contained and isolated from the system in many ways, some things may not work as expected. You'll have to ask the snap developers how to give isolated snap packages more access to the system.

You won't get these kind of issues with the debian package, since it won't be running in an isolated security context.
:idea: Please read the FAQ and How to Request Help.
mrm1st3r
Posts: 7
Joined: 25 Oct 2016, 09:06

Re: Curl in --def exec - Getting: sh: 1: curl: not found

Post by mrm1st3r »

Debian package did the trick. Curl is working, as are the other commands.

Additionally, Filebot will now read and write to my drives mounted in /media/<USER>, as I was running into permission issues there as well, but managed to get around it by mounting the drives somewhere else. So that's a bonus.

Thanks so much for the help!
Post Reply