Cannot get past sqlite error


#1

Using the following command on new fresh ubuntu server install;

curl -sL https://raw.github.com/rtCamp/media-node/master/install.sh | sudo bash

Cannot get past the following error.

TypeError: Cannot read property ‘transaction_id’ of undefined
at /root/media-node/ffmpeg_server.js:70:15
at Statement. (/root/media-node/node_modules/sqlite3/lib/sqlite3.js:17:41)
–> in Database#each(‘SELECT * FROM transactions WHERE status = 1 OR status = 2’, [Function])
at reQueueFiles (/root/media-node/ffmpeg_server.js:68:5)
at Object. (/root/media-node/ffmpeg_server.js:77:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Error: SQLITE_ERROR: duplicate column name: duration
Error: SQLITE_ERROR: duplicate column name: thumbs

Tried on a fresh Centos server and got the same exact results after fighting my way through many broken things. Any input would be very welcome.

Thanks.


#2

Can you please restart media node using following command

kill -9  $(ps aux | grep ' ffmpeg_server.js' | awk '{print $2}')  

node /root/media-node/ffmpeg_server.js >> /var/log/ffmpeg_server.log &

#3

I don’t even know where to start to give you feedback. This simply doesn’t work, not with Centos or Ubuntu. I’ve tried working through the countless problems trying to install this but each problem I solve only leads to another.

Let me know what to give you for feedback I guess and I will.

Centos 6.4

kill -9 $(ps aux | grep ’ ffmpeg_server.js’ | awk ‘{print $2}’)

12373 killed

node /root/media-node/ffmpeg_server.js >> /var/log/ffmpeg_server.log &

[1] 12379
[root@mnode new]#
module.js:340
throw err;
^
Error: Cannot find module ‘sqlite3’
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/root/media-node/ffmpeg_server.js:6:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

Ubuntu (latest error)

media-node/.git/hooks/applypatch-msg.sample’ ->/root/media-node/.git/hooks/applypatch-msg.sample’
media-node/.git/hooks/pre-commit.sample’ ->/root/media-node/.git/hooks/pre-commit.sample’
media-node/.git/hooks/commit-msg.sample’ ->/root/media-node/.git/hooks/commit-msg.sample’
media-node/.git/HEAD’ ->/root/media-node/.git/HEAD’
media-node/.git/packed-refs’ ->/root/media-node/.git/packed-refs’
media-node/.git/description’ ->/root/media-node/.git/description’
media-node/.git/index’ ->/root/media-node/.git/index’
media-node/.git/config’ ->/root/media-node/.git/config’
media-node/.git/info’ ->/root/media-node/.git/info’
media-node/.git/info/exclude’ ->/root/media-node/.git/info/exclude’
media-node/.git/branches’ ->/root/media-node/.git/branches’
root@mnode:/new#
module.js:340
throw err;
^
Error: Cannot find module ‘sqlite3’
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/root/media-node/ffmpeg_server.js:6:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)


#4

Ubuntu error above, then your commands;

root@mnode:/new# kill -9 $(ps aux | grep ’ ffmpeg_server.js’ | awk ‘{print $2}’)
-bash: kill: (15133) - No such process
root@mnode:/new# node /root/media-node/ffmpeg_server.js >> /var/log/ffmpeg_server.log &
[1] 15136
root@mnode:/new#
module.js:340
throw err;
^
Error: Cannot find module ‘sqlite3’
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/root/media-node/ffmpeg_server.js:6:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)


#5

Each time I post an update in your forums, I get a blank page with the following;

{“media_id”:null,“activity_id”:-1,“redirect_url”:"",“permalink”:"",“cover_art”:null}

I am starting to rethink buying your products.


#6

Since the build always stops at sqlite, I looked around and found a fix which was;

#npm install sqlite3 --build-from-source

After it failed, but npm was installed, I ran the above instead of

#npm install sqlite3

which is what your script calls for. However, STILL get the same problem! It dies at the same spot again.

TypeError: Cannot read property ‘transaction_id’ of undefined

at /root/media-node/ffmpeg_server.js:70:15  
at Statement.<anonymous> (/root/media-node/node_modules/sqlite3/lib/sqlite3.js:17:41)  

–> in Database#each(‘SELECT * FROM transactions WHERE status = 1 OR status = 2’, [Function])
at reQueueFiles (/root/media-node/ffmpeg_server.js:68:5)
at Object. (/root/media-node/ffmpeg_server.js:77:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Error: SQLITE_ERROR: duplicate column name: duration
Error: SQLITE_ERROR: duplicate column name: thumbs

How can I get past this??


#7

How long does it take to get a reply? I’ve been at this for two days and cannot get part the never ending problems. I could use some help! :slight_smile:

kill -9 $(ps aux | grep ’ ffmpeg_server.js’ | awk ‘{print $2}’)

-bash: kill: (3537) - No such process

node /root/media-node/ffmpeg_server.js >> /var/log/ffmpeg_server.log &

[1] 3539
root@mnode:/new# TypeError: Cannot read property ‘transaction_id’ of undefined
at /root/media-node/ffmpeg_server.js:70:15
at Statement. (/root/media-node/node_modules/sqlite3/lib/sqlite3.js:17:41)
–> in Database#each(‘SELECT * FROM transactions WHERE status = 1 OR status = 2’, [Function])
at reQueueFiles (/root/media-node/ffmpeg_server.js:68:5)
at Object. (/root/media-node/ffmpeg_server.js:77:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Error: SQLITE_ERROR: duplicate column name: duration
Error: SQLITE_ERROR: duplicate column name: thumbs


#8

PS, this is the result on both centos 6.4 and Ubuntu server latest version.


#9

Sorry for inconvenience but i install it on ubuntu without any issue.

Can you send me your server detail to faishal.saiyed@rtcamp.com so i can check.


#10

It’s a fresh Ubuntu Server and fresh Centos 6.4 install. I don’t know how both could fail the same way. It is certainly not something I’m doing wrong because there have been numerous problems along the way.

I cannot see how you could get it any better than I could without any problems. Why don’t you spell out how you went about it then. I can’t give you the details because both servers are on the LAN at the moment.


#11

I just install it on ubuntu to check and its working. you might a facing problem in node module installation which are compiled on local that why sqlite3 module giving an error

Try following after login as root might fix this issue

cd /root/media-node  
git pull origin master  
mv db.sqlite db.sqlite.bak  
npm install  
kill -9  $(ps aux | grep ' ffmpeg_server.js' | awk '{print $2}')  
node /root/media-node/ffmpeg_server.js >> /var/log/ffmpeg_server.log &

#12

Do you mean before running the main script, or after?
Do you mean after it breaks, before it breaks?


#13

After it breaks. Look like sqlite db issue (not accessible or corrupt).

your ffmpeg is installed correctly no need to reinstall it.The issue is with media-node node.js script.

That why its not starting (On startup of media node it is going to get all pending task and at that time error is thrown )


#14

So, assuming you mean after the initial script crashes otherwise, there is no media-node directory since it would not have been downloaded yet. So here is the results of what you sent.

root@mnode:~# cd /root/media-node
root@mnode:~/media-node# git pull origin master
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 2 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/rtCamp/media-node


#15

check status of the media node server by following command
curl http://127.0.0.1:1203/status


#16

The script crashes here

npm install sqlite3

So, just to see what would happen, I copied the ubuntu.sh script to u.sh and took out everything already completed, so that it would continue from the following point on.

Copy Media Node Files

#clear
#cd $MNDIR
#cp -rv $BASEDIR/* . || OwnError “Unable To Copy Media Node Files :(”
#cp -rv $BASEDIR/.* . || OwnError “Unable To Copy Media Node Files :(”
clear
cd /tmp
git clone git://github.com/rtCamp/media-node.git
cp -rv media-node/* $MNDIR/ || OwnError “Unable To Copy Media Node Files :(”
cp -rv media-node/.git $MNDIR/ || OwnError “Unable To Copy Media Node Files :(”

Fix libx264.so.x

echo “/usr/local/lib” >> /etc/ld.so.conf.d/media-node.conf || OwnError “Unable To Set Library For Media-Node”
ldconfig || OwnError “Unable To Execute ldconfig”

Adding Crontab Entry

echo “PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin” >> /var/spool/cron/crontabs/root || OwnError “Unable To Install Crontabs :(”
echo “@reboot cd $MNDIR && node ffmpeg_server.js >> /var/log/ffmpeg_server.log &” >> /var/spool/cron/crontabs/root || OwnError "Unable To Install Crontabs :frowning:
"

Start Node

cd $MNDIR && node ffmpeg_server.js >> /var/log/ffmpeg_server.log & #|| OwnError “Unable To Start Node Server :(”

This didn’t work either. Here is the results.

root@mnode:/new# sh u.sh
fatal: destination path ‘media-node’ already exists and is not an empty directory.
DISTRIB_RELEASE=12.04
DISTRIB_DESCRIPTION=“Ubuntu 12.04.3 LTS”
media-node/README.md’ ->/README.md’
media-node/ffmpeg_server.js’ ->/ffmpeg_server.js’
media-node/install.sh’ ->/install.sh’
media-node/package.json’ ->/package.json’
media-node/setup’ ->/setup’
media-node/setup/debian.sh’ ->/setup/debian.sh’
media-node/setup/redhat5.sh’ ->/setup/redhat5.sh’
media-node/setup/ubuntu.sh’ ->/setup/ubuntu.sh’
media-node/setup/redhat.sh’ ->/setup/redhat.sh’
media-node/setup/check.sh’ ->/setup/check.sh’
media-node/setup/update.sh’ ->/setup/update.sh’
media-node/.git’ ->/.git’
media-node/.git/refs’ ->/.git/refs’
media-node/.git/refs/remotes’ ->/.git/refs/remotes’
media-node/.git/refs/remotes/origin’ ->/.git/refs/remotes/origin’
media-node/.git/refs/remotes/origin/HEAD’ ->/.git/refs/remotes/origin/HEAD’
media-node/.git/refs/heads’ ->/.git/refs/heads’
media-node/.git/refs/heads/master’ ->/.git/refs/heads/master’
media-node/.git/refs/tags’ ->/.git/refs/tags’
media-node/.git/logs’ ->/.git/logs’
media-node/.git/logs/refs’ ->/.git/logs/refs’
media-node/.git/logs/refs/heads’ ->/.git/logs/refs/heads’
media-node/.git/logs/refs/heads/master’ ->/.git/logs/refs/heads/master’
media-node/.git/logs/HEAD’ ->/.git/logs/HEAD’
media-node/.git/objects’ ->/.git/objects’
media-node/.git/objects/info’ ->/.git/objects/info’
media-node/.git/objects/pack’ ->/.git/objects/pack’
media-node/.git/objects/pack/pack-0c422c712651bc3a509848b127386b0a3bd9fb29.pack’ ->/.git/objects/pack/pack-0c422c712651bc3a509848b127386b0a3bd9fb29.pack’
media-node/.git/objects/pack/pack-0c422c712651bc3a509848b127386b0a3bd9fb29.idx’ ->/.git/objects/pack/pack-0c422c712651bc3a509848b127386b0a3bd9fb29.idx’
media-node/.git/hooks’ ->/.git/hooks’
media-node/.git/hooks/post-update.sample’ ->/.git/hooks/post-update.sample’
media-node/.git/hooks/pre-rebase.sample’ ->/.git/hooks/pre-rebase.sample’
media-node/.git/hooks/update.sample’ ->/.git/hooks/update.sample’
media-node/.git/hooks/pre-applypatch.sample’ ->/.git/hooks/pre-applypatch.sample’
media-node/.git/hooks/prepare-commit-msg.sample’ ->/.git/hooks/prepare-commit-msg.sample’
media-node/.git/hooks/applypatch-msg.sample’ ->/.git/hooks/applypatch-msg.sample’
media-node/.git/hooks/pre-commit.sample’ ->/.git/hooks/pre-commit.sample’
media-node/.git/hooks/commit-msg.sample’ ->/.git/hooks/commit-msg.sample’
media-node/.git/HEAD’ ->/.git/HEAD’
media-node/.git/packed-refs’ ->/.git/packed-refs’
media-node/.git/description’ ->/.git/description’
media-node/.git/index’ ->/.git/index’
media-node/.git/config’ ->/.git/config’
media-node/.git/info’ ->/.git/info’
media-node/.git/info/exclude’ ->/.git/info/exclude’
media-node/.git/branches’ ->/.git/branches’
root@mnode:/new#
module.js:340
throw err;
^
Error: Cannot find module ‘/root/ffmpeg_server.js’
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3


#17

root@mnode:/new# curl http://127.0.0.1:1203/status

Remaining Queue
[]
Currently Processing
[]
Completed
[]
Current Parallel Processes:
0
Max Parallel Processes:


#18

PS: Same exact things on the Centos server as I am testing both as we talk here.

On Centos 6.4;

[root@mnode new]# cd /root/media-node
[root@mnode media-node]# git pull origin master
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 2 (delta 0)
Unpacking objects: 100% (3/3), done.
From git://github.com/rtCamp/media-node

Remaining Queue

[]

Currently Processing

[]

Completed

[]

Current Parallel Processes:

0

Max Parallel Processes:

1[2]+ Done node /root/media-node/ffmpeg_server.js >> /var/log/ffmpeg_server.log


#19

So what next?


#20

media-node server is running now. just you need to check that ffpmpeg is working or not. for that you need ffmpeg add-on or you can check by opening http://127.0.0.1:1203/ in a browser (if it is server then you can do it by ssh tunnel proxy from your laptop/pc having browser).