xbenjii / torrentexpander

Automatically exported from code.google.com/p/torrentexpander
0 stars 0 forks source link

Understand why torrentexpander-CSI don't work #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Over 100 download of working version.
Only few search on scraper.
The users is not the problem. It can't be.
So...what's the problem?

1) First problem:
tar issue on A100 devices.
http://www.networkedmediatank.com/showthread.php?tid=56777&pid=527543#pid527543
I will solve it now. I know how to do.

2) (hypothesis) Missing depandancies.
How to solve?
Add self-check of all TorrentExpander required software (cat, cp, mv, unrar, 
unzip, ...). If something is missing, add to torrentexpander_debug.

3) Users are lazy
They don't report if the program don't works. We could add an 'send error 
report by email' future? (Enabled by default)

Original issue reported on code.google.com by login...@gmail.com on 14 Dec 2011 at 5:15

GoogleCodeExporter commented 8 years ago
Give this one liner a try
path_backup="$PATH"; PATH="/bin"; initial_path=":$PATH:"; new_path="$PATH"; for 
test_path in $(echo -e 
"/usr/local/sbin\n/usr/local/bin\n/usr/sbin\n/usr/bin\n/sbin\n/bin\n/usr/games\n
/usr/bin\n/bin\n/usr/sbin\n/sbin\n/usr/local/bin\n/usr/X11/bin\n/Applications\n/
opt/syb/sigma/bdj/jvm/bin\n/usr/bin/X11\n/opt/syb/app/bin\n/opt/syb/app/sbin\n/o
pt/syb/sigma/bin\n/nmt/apps"); do if [[ -d "$test_path" && "$initial_path" != 
*:$test_path:* ]]; then new_path="$new_path:$test_path"; fi; done; 
PATH="$new_path"; echo -e "Here is your new PATH :\n$PATH"; PATH="$path_backup"

It works on all my OS. The previous one did too, but this one is cleaner
I'll add it to the build I'm gonna upload tonight

Let me know how it works for you

Original comment by addicted...@gmail.com on 3 Jan 2012 at 10:23

GoogleCodeExporter commented 8 years ago
Ok, this line works, but changes path only 'inside' the script. It does not 
change system path. Yes, we can use it anyway, but 'global' change would be 
better.

SCRIPT LOG
Information: adding /nmt/apps to your paths list
Here is your new PATH :
/opt/syb/sigma/bdj/jvm/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local
/bin:/opt/syb/app/bin:/opt/syb/app/sbin:/opt/syb/sigma/bin:/nmt/apps

SYSTEM OUTPUT (echo $PATH)
/opt/syb/sigma/bdj/jvm/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local
/bin:/opt/syb/app/bin:/opt/syb/app/sbin:/opt/syb/sigma/bin

TESTED CODES
    # Try to correct paths
    path_backup="$PATH"; 
    initial_path=":$PATH:"; 
    new_path="$PATH"; 
    for test_path in $(echo -e "/usr/local/sbin\n/usr/local/bin\n/usr/sbin\n/usr/bin\n/sbin\n/bin\n/usr/games\n/usr/bin\n/bin\n/usr/sbin\n/sbin\n/usr/local/bin\n/usr/X11/bin\n/Applications\n/opt/syb/sigma/bdj/jvm/bin\n/usr/bin/X11\n/opt/syb/app/bin\n/opt/syb/app/sbin\n/opt/syb/sigma/bin\n/nmt/apps"); do 
        if [[ -d "$test_path" && "$initial_path" != *:$test_path:* ]]; then 
            STRING="Information: adding $test_path to your paths list"
            echo "$STRING";
            new_path="$new_path:$test_path"; 
        fi
    done 
    PATH="$new_path"; 
    echo -e "Here is your new PATH :\n$PATH";
    export PATH="$PATH"

Original comment by login...@gmail.com on 4 Jan 2012 at 1:26

GoogleCodeExporter commented 8 years ago
Once you export PATH="$new_path", then it is global until you export 
PATH="$path_backup" or reboot
I think this is much better that way.
I've added this line to torrentexpander. You should do the same with your 
install script

Thanks for finding that out

Original comment by addicted...@gmail.com on 4 Jan 2012 at 5:27

GoogleCodeExporter commented 8 years ago
So, this is the problem: 'export PATH' do not work on my device. 

In latest torrentexpander.sh you have not put ' PATH="$new_path"; ', i suspect 
that script do not work without it if 'export PATH' fails.

Original comment by login...@gmail.com on 5 Jan 2012 at 12:04

GoogleCodeExporter commented 8 years ago
Stable-5 is out

Original comment by login...@gmail.com on 5 Jan 2012 at 12:17

GoogleCodeExporter commented 8 years ago
I do not understand your comment 54
I notice in the last line of your comment 52 : export PATH="$PATH"
The correct line is PATH="$new_path". You already made that change in the new 
installer.
Everything seems fine

Thanks

Original comment by addicted...@gmail.com on 5 Jan 2012 at 6:01

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Run the setup.sh install

What is the output? 
Information: this is your current paths list:
/opt/syb/sigma/bdj/jvm/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local
/bin:/opt/syb/app/bin:/opt/syb/app/sbin:/opt/syb/sigma/bin:/nmt/apps

What do you see instead?
When scripts ends, i type echo $PATH and i expect same output. I get old $PATH 
instead.

Original comment by login...@gmail.com on 5 Jan 2012 at 11:01

GoogleCodeExporter commented 8 years ago
Take a look at the last lines of the script.
There is a revert line on the initial $PATH value. And I really think we should 
keep it

Original comment by addicted...@gmail.com on 5 Jan 2012 at 12:38

GoogleCodeExporter commented 8 years ago
Nice, but comment 57 refers to setup.sh only. I have disabled revert lines for 
this report.

Original comment by login...@gmail.com on 5 Jan 2012 at 1:22

GoogleCodeExporter commented 8 years ago
I have no idea why this happens. It's probably linked to NMT CSI.
Anyway, we don't want to fuck up the user's setup by adding exotic directories 
to the user's $PATH unless required

Original comment by addicted...@gmail.com on 7 Jan 2012 at 1:51

GoogleCodeExporter commented 8 years ago
NEW CSi version soon.

Original comment by login...@gmail.com on 9 Jan 2012 at 12:40

GoogleCodeExporter commented 8 years ago
I suggest you try this line this time
sed -i 's/^\( *\)\"script-torrent-done-filename\"\: 
.*$/\1\"script-torrent-done-filename\"\: 
\"\/share\/Apps\/TorrentExpander\/bin\/torrentexpander.sh\"\,/g' 
/share/Apps/Transmission/config/settings.json

Thanks

Original comment by addicted...@gmail.com on 9 Jan 2012 at 8:03

GoogleCodeExporter commented 8 years ago
What should i write about these directive?

all_files_script="incorrect_or_not_set"
processed_torrent_script="incorrect_or_not_set"
all_files_script_enabled="no"
processed_torrent_script_enabled="no"

Original comment by login...@gmail.com on 9 Jan 2012 at 12:14

GoogleCodeExporter commented 8 years ago
For now, I suggest you keep these lines as is

Original comment by addicted...@gmail.com on 9 Jan 2012 at 2:48

GoogleCodeExporter commented 8 years ago
New csi version. 
I hope all problem is fixed.

Original comment by login...@gmail.com on 10 Jan 2012 at 9:22

GoogleCodeExporter commented 8 years ago
Oh, god. What's wrong now?

http://www.networkedmediatank.com/showthread.php?tid=56777&pid=535240#pid535240

Original comment by login...@gmail.com on 13 Jan 2012 at 11:53

GoogleCodeExporter commented 8 years ago
Hi

Based on his logs, the line that fails for this user is this one
if [[ -d "$test_path" && "$initial_path" != *:$test_path:* ]]; then 

The line is correct and it shouldn't happen. I've experienced weird issues like 
that with my NMT. After a reboot, everything was running smoothly.

I don't see any other explanation

Original comment by addicted...@gmail.com on 14 Jan 2012 at 12:27

GoogleCodeExporter commented 8 years ago
found other problem:

/usr/bin/unzip: invalid option -- 'j'

I must force unzip_bin="/usr/local/bin/unzip" on settings file.

Original comment by login...@gmail.com on 14 Jan 2012 at 1:24

GoogleCodeExporter commented 8 years ago
This is a problem beacuse nmt-a100 series do not have unzip-opkg package 
(/usr/local/bin/unzip), but have only unzip bin (/usr/bin/unzip) from busybox.

Original comment by login...@gmail.com on 14 Jan 2012 at 1:42

GoogleCodeExporter commented 8 years ago
Hi

In the latest SVN, I've prioritized the /usr/local/bin/ path when 
torrentexpander searches for unzip, unrar and so on.

As it appears, it does not solve our problem.
Are you sure there is no way to get on the NMT-A110 a version of Unzip that 
supports the -j argument ?
I can't deal with junk paths without major rewrites (and I have no idea how to 
deal with that)

Thanks

Original comment by addicted...@gmail.com on 14 Jan 2012 at 11:16

GoogleCodeExporter commented 8 years ago
We have to wait for Siriam release of unzip. I have already asked for it.

Original comment by login...@gmail.com on 15 Jan 2012 at 11:28

GoogleCodeExporter commented 8 years ago
On A100 series do not work.
This is output when run manually:

/bin/sh: ./torrentexpander.sh: not found

same with absolute path

Original comment by login...@gmail.com on 24 Jan 2012 at 5:51

GoogleCodeExporter commented 8 years ago

From debeli75's logs, we now know :

The /share/Apps/Transmission directory exists, so the /share/Apps/ directory 
does exist
The TorrentExpander.tar was unpacked ; if not, the installer wouldn't have 
started

We don't have logs in the install routine but my guess is simply that the 
TorrentExpander.tar archive was expanded in an unknown directory.

If I look into the appinit.cgi, NMTAPPS_LOCATION is set to /mnt/syb8634
I trust Teunis and I'm sure he knows his stuff. But are we sure unrar is 
available in this path ?
/mnt/syb8634/bin/unrar

We may need to ask a A100 series owner to try this command :
find / -name torrentexpander.sh

If we don't get any result, we'll probably need to add some debug to the 
install routine in the installer.

This is really getting complicated

Original comment by addicted...@gmail.com on 24 Jan 2012 at 9:27

GoogleCodeExporter commented 8 years ago
This is my output
/opt/sybhttpd/localhost.drives/HARD_DISK # find / -name torrentexpander.sh
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh
/opt/sybhttpd/localhost.drives/HARD_DISK #

Original comment by debel...@gmail.com on 25 Jan 2012 at 8:00

GoogleCodeExporter commented 8 years ago
Thanks for getting us on the right track

Can you see a TorrentExpander directory in the /share/Apps/ directory ?

Can you see a settings.json file in this directory :
/share/Apps/Transmission/config/

Can you confirm where Transmission downloads its files ?
- /share/Download/
- /share/Downloads/
- /opt/sybhttpd/localhost.drives/HARD_DISK/Download/
or
- /opt/sybhttpd/localhost.drives/HARD_DISK/Downloads/

Can you send us the results of all of these lines :
which unrar
which unzip
which wget
which basename
which cat
which chmod
which chown
which date
which dirname
which du
which echo
which egrep
which expr
which find
which grep
which id
which ls
which mkdir
which mv
which rm
which sed
which touch
which vi
which wc

With those informations we may be able to build a new installer that works on 
A1XX series

Thanks

Original comment by addicted...@gmail.com on 25 Jan 2012 at 12:57

GoogleCodeExporter commented 8 years ago
Here You are...

Can you see a TorrentExpander directory in the /share/Apps/ directory ?
- Yes

Can you see a settings.json file in this directory :
/share/Apps/Transmission/config/
- Yes, and inside is
"script-torrent-done-enabled": true, 
    "script-torrent-done-filename": "/share/Apps/TorrentExpander/bin/torrentexpander.sh", 

Can you confirm where Transmission downloads its files ?
- /share/Download

/opt/sybhttpd/localhost.drives/HARD_DISK # which unrar
/usr/local/bin/unrar
/opt/sybhttpd/localhost.drives/HARD_DISK # which unzip
/usr/bin/unzip
/opt/sybhttpd/localhost.drives/HARD_DISK # which wget
/bin/wget
/opt/sybhttpd/localhost.drives/HARD_DISK # which basename
/usr/bin/basename
/opt/sybhttpd/localhost.drives/HARD_DISK # which cat
/bin/cat
/opt/sybhttpd/localhost.drives/HARD_DISK # which chmod
/bin/chmod
/opt/sybhttpd/localhost.drives/HARD_DISK # which chown
/bin/chown
/opt/sybhttpd/localhost.drives/HARD_DISK # which date
/bin/date
/opt/sybhttpd/localhost.drives/HARD_DISK # which dirname
/usr/bin/dirname
/opt/sybhttpd/localhost.drives/HARD_DISK # which du
/usr/bin/du
/opt/sybhttpd/localhost.drives/HARD_DISK # which echo
/bin/echo
/opt/sybhttpd/localhost.drives/HARD_DISK # which egrep
/bin/egrep
/opt/sybhttpd/localhost.drives/HARD_DISK # which expr
/usr/bin/expr
/opt/sybhttpd/localhost.drives/HARD_DISK # which find
/usr/bin/find
/opt/sybhttpd/localhost.drives/HARD_DISK # which grep
/bin/grep
/opt/sybhttpd/localhost.drives/HARD_DISK # which id
/usr/bin/id
/opt/sybhttpd/localhost.drives/HARD_DISK # which ls
/bin/ls
/opt/sybhttpd/localhost.drives/HARD_DISK # which mkdir
/bin/mkdir
/opt/sybhttpd/localhost.drives/HARD_DISK # which mv
/bin/mv
/opt/sybhttpd/localhost.drives/HARD_DISK # which rm
/bin/rm
/opt/sybhttpd/localhost.drives/HARD_DISK # which sed
/bin/sed
/opt/sybhttpd/localhost.drives/HARD_DISK # which touch
/bin/touch
/opt/sybhttpd/localhost.drives/HARD_DISK # which vi
/bin/vi
/opt/sybhttpd/localhost.drives/HARD_DISK # which wc
/usr/bin/wc

Original comment by debel...@gmail.com on 25 Jan 2012 at 6:05

GoogleCodeExporter commented 8 years ago
Thanks Debeli75

We now know everything we need to build a test installer with a custom settings 
file and a different sed command to edit Transmission json file.

Out of curiosity, can you try to run torrentexpander manually with this command 
:
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh
if not, try this, then try again the previous command :
chmod +x 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh

Does it spit out any error ? If you select a torrent to process and a directory 
where to expand it, does it work correctly ?

Thanks

Original comment by addicted...@gmail.com on 26 Jan 2012 at 5:28

GoogleCodeExporter commented 8 years ago
Here is output

/opt/sybhttpd/localhost.drives/HARD_DISK # 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh
/bin/sh: 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh: not found
/opt/sybhttpd/localhost.drives/HARD_DISK # chmod +x /opt/sybhttpd/localhost.driv
es/HARD_DISK/Apps/TorrentExpander/bin/torrentexpander.sh
/opt/sybhttpd/localhost.drives/HARD_DISK # /opt/sybhttpd/localhost.drives/HARD_D
ISK/Apps/TorrentExpander/bin/torrentexpander.sh
/bin/sh: /opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torre
ntexpander.sh: not found
/opt/sybhttpd/localhost.drives/HARD_DISK # /share/Apps/TorrentExpander/bin/torre
ntexpander.sh /share/Download/natures.weirdest.events.s01e02.720p.hdtv.x264-ftp
/bin/sh: /share/Apps/TorrentExpander/bin/torrentexpander.sh: not found
/opt/sybhttpd/localhost.drives/HARD_DISK #

Original comment by debel...@gmail.com on 26 Jan 2012 at 8:11

GoogleCodeExporter commented 8 years ago
This is getting weirder by the minute. Actually this is driving me nuts !

According to the find command, the file is in one place, according to shell, it 
isn't !

Is there any chance your hard drive got disconnected or non responsive during 
the install and/or when you used the command 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh ?

Can you see script content when you use either of these two commands ?
vi 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh
vi /share/Apps/TorrentExpander/bin/torrentexpander.sh

Now I'm out of ideas. Would it be possible for me to get access to your NMT for 
an hour or so this week-end ?

Thanks

Original comment by addicted...@gmail.com on 26 Jan 2012 at 8:41

GoogleCodeExporter commented 8 years ago
as i remember, when i have got access to his nmt, program worked. Another user 
(nmt a100) has reported to me same problem.

Original comment by login...@gmail.com on 26 Jan 2012 at 10:40

GoogleCodeExporter commented 8 years ago
I now what you mean... I see script when I connect from my windows xp, I am 
connecting to popcorn as a network drive with standard user name and password 
but somehow popcorn cant find that script. Maybe one thing... When I install 
torrentexpander from CSI, and I tray it maybe 20-30 times, most of the time it 
takes few hours, like 5-6 hours to CSI to finish installation, dont now why

Is there any chance your hard drive got disconnected or non responsive during 
the install and/or when you used the command 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh
- I got response immediately to command

Can you see script content when you use either of these two commands ?
vi 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh
vi /share/Apps/TorrentExpander/bin/torrentexpander.sh
- I can see content with both commands

Now I'm out of ideas. Would it be possible for me to get access to your NMT for 
an hour or so this week-end ?
- No problem, just tell me how on my mail

Original comment by debel...@gmail.com on 26 Jan 2012 at 12:09

GoogleCodeExporter commented 8 years ago
Debeli75

Regarding the delay while installing torrentexpander, it looks like php5server 
took a long while to quit, according to your logs, but that's all we know for 
now
I've done some research and it seems to be a permission issue. Not specifically 
to the script but to one of the directories above.
Can you use the following command to know what user you're currently logged in 
as :
id

I think I may have some time on saturday. I'll send you a mail asking you for 
access to your NMT on saturday between 10AM and 4PM CET

Thanks

Original comment by addicted...@gmail.com on 27 Jan 2012 at 6:17

GoogleCodeExporter commented 8 years ago
Thanks to Debeli75's help we now know what happened
bash is not available on the NMT 100 series (A110 actually)

opkg update
opkg install bash
Package bash fails because it wants wants to install file 
/share/Apps/local/share/info/dir, already installed by wget
opkg remove wget
opkg install bash
wget cannot install after bash for the same reason
/usr/local/bin/bash 
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh works
/opt/sybhttpd/localhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpande
r.sh doesn't

With 100 series, we may need to change transmission settings line to :
"script-torrent-done-filename": "/usr/local/bin/bash 
/share/Apps/TorrentExpander/bin/torrentexpander.sh",

We need a workaround for wget in order to make it play nice with bash package

Original comment by addicted...@gmail.com on 28 Jan 2012 at 10:37

GoogleCodeExporter commented 8 years ago
Fine, you must force bash install, we have to change setup.sh
please do a uname -a on nmt A100, we have to parse this information.

Original comment by login...@gmail.com on 28 Jan 2012 at 11:07

GoogleCodeExporter commented 8 years ago
Let's simply reuse this from appinit.cgi

#SET C200 or A/B variables
echo -n "Found hardware type: "
if [ -e "/nmt/apps" ]; then
   echo "Popcorn Hour C200"
   ...
else
   echo "Syabas A/B type"
   ...
fi

Original comment by addicted...@gmail.com on 28 Jan 2012 at 11:17

GoogleCodeExporter commented 8 years ago
Ah ok.

Original comment by login...@gmail.com on 28 Jan 2012 at 11:36

GoogleCodeExporter commented 8 years ago
Here is 2 day after Toitoinou aka Addictedtoscreens work on my a-110 report:
- there is nothing in my Expanded folder
- no error file in TorrentExpander/bin folder
- when manually start torrentexpander got this:

/opt/sybhttpd/localhost.drives/HARD_DISK # /usr/local/bin/bash /opt/sybhttpd/loc
alhost.drives/HARD_DISK/Apps/TorrentExpander/bin/torrentexpander.sh /share/Downl
oad/Man.Woman.Wild.S02E11.Croatian.Cave.Odyssey.720p.HDTV.x264-MOMENTUM

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

WELCOME TO TORRENTEXPANDER

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

Select Destination Folder :

/

0  -  Select current folder
1  -  ..
2  -  USB_DRIVE_A-1
3  -  bin
4  -  dev
5  -  etc
6  -  home
7  -  init
8  -  lib
9  -  linuxrc
10  -  mnt
11  -  modules
12  -  opt
13  -  proc
14  -  root
15  -  sbin
16  -  share
17  -  share_thumbnails
18  -  sys
19  -  tmp
20  -  upnp
21  -  usr
22  -  var

Type the ID of the Destination Folder :

Original comment by debel...@gmail.com on 30 Jan 2012 at 7:59

GoogleCodeExporter commented 8 years ago
When running torrentexpander manually, everything runs the way it should.
It seems that using /usr/local/bin/bash in transmission does not work. It may 
be because transmission is run by the nmt user. I was worried about that, I 
must admit.
Right now I'm out of ideas

I'll need to do some research. Loginbug, any idea ?

Thanks

Original comment by addicted...@gmail.com on 30 Jan 2012 at 8:41

GoogleCodeExporter commented 8 years ago
I don't know, and i'm really busy this week.

Original comment by login...@gmail.com on 30 Jan 2012 at 10:06

GoogleCodeExporter commented 8 years ago
latest setup file

Original comment by login...@gmail.com on 2 Feb 2012 at 1:47

Attachments:

GoogleCodeExporter commented 8 years ago
Stable-8 is out, i have not updated svn files.

Original comment by login...@gmail.com on 2 Feb 2012 at 2:09

GoogleCodeExporter commented 8 years ago
Nice job
Unfortunately, transmission does not seem to be able to trigger 
torrentexpander.sh on 100 series.
I have browsed many forums but all the scripts I found for 100 series were 
shell scripts.
We're almost there...

Original comment by addicted...@gmail.com on 2 Feb 2012 at 2:27

GoogleCodeExporter commented 8 years ago
oh god

Original comment by login...@gmail.com on 2 Feb 2012 at 2:41

GoogleCodeExporter commented 8 years ago
Sorry, but I cannot investigate this issue

I'm closing it. C100 has been EOL for some time now

Original comment by addicted...@gmail.com on 2 Dec 2012 at 8:48