MacWarrior / clipbucket-v5

Open source video hosting with PHP
Other
70 stars 45 forks source link

An SQL error occured : Invalid default value for 'datecreated' #198

Closed rems25000 closed 2 years ago

rems25000 commented 2 years ago

Hello, I'm on a clean Ubuntu 18.04 build. I used the script for Ubuntu 18.04, it ran smoothly. Once on the page to import the database I have an error.

` Creating Database Tables and Importing data

An SQL error occured : Invalid default value for 'datecreated'SQL : CREATE TABLE cb_video ( videoid bigint(20) NOT NULL, videokey mediumtext NOT NULL, video_password varchar(255) NOT NULL DEFAULT '', video_users text NOT NULL, username text NULL DEFAULT NULL, userid int(11) NULL DEFAULT NULL, title text DEFAULT NULL, file_name varchar(32) NOT NULL DEFAULT '', file_type int(10) NOT NULL DEFAULT 0, file_directory varchar(25) NOT NULL DEFAULT '', description text DEFAULT NULL, tags mediumtext NOT NULL, category VARCHAR(3) NULL DEFAULT NULL, category_parents text NULL DEFAULT NULL, broadcast varchar(10) NOT NULL DEFAULT '', location mediumtext DEFAULT NULL, datecreated date NOT NULL DEFAULT CURRENT_TIMESTAMP, country mediumtext DEFAULT NULL, blocked_countries text NULL DEFAULT NULL, sprite_count int(11) NOT NULL DEFAULT 0, allow_embedding char(3) NOT NULL DEFAULT '', rating int(15) NOT NULL DEFAULT 0, rated_by varchar(20) NOT NULL DEFAULT '0', voter_ids mediumtext NOT NULL, allow_comments char(3) NOT NULL DEFAULT '', comment_voting char(3) NOT NULL DEFAULT '', comments_count int(15) NOT NULL DEFAULT 0, last_commented datetime DEFAULT NULL, featured char(3) NOT NULL DEFAULT 'no', featured_date datetime DEFAULT NULL, featured_description mediumtext NOT NULL, allow_rating char(3) NOT NULL DEFAULT '', active char(3) NOT NULL DEFAULT '0', favourite_count varchar(15) NOT NULL DEFAULT '0', playlist_count varchar(15) NOT NULL DEFAULT '0', views bigint(22) NOT NULL DEFAULT 0, last_viewed datetime NOT NULL DEFAULT '1000-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP, date_added datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, flagged varchar(3) NOT NULL DEFAULT 'no', duration varchar(20) NOT NULL DEFAULT '00', status enum('Successful','Processing','Failed') NOT NULL DEFAULT 'Processing', failed_reason enum('none','max_duration','max_file','invalid_format','invalid_upload') NOT NULL DEFAULT 'none', default_thumb int(3) NOT NULL DEFAULT 1, aspect_ratio varchar(10) NOT NULL DEFAULT '', embed_code text NULL DEFAULT NULL, refer_url text NULL DEFAULT NULL, downloads bigint(255) NOT NULL DEFAULT 0, uploader_ip varchar(20) NOT NULL DEFAULT '', unique_embed_code varchar(50) NOT NULL DEFAULT '', remote_play_url text NULL DEFAULT NULL, video_files tinytext NULL DEFAULT NULL, server_ip varchar(20) NOT NULL DEFAULT '', file_server_path text NULL DEFAULT NULL, files_thumbs_path text NULL DEFAULT NULL, process_status bigint(30) NOT NULL DEFAULT 0, video_version varchar(30) NOT NULL DEFAULT '5.5.0', thumbs_version varchar(5) NOT NULL DEFAULT '5.5.0', re_conv_status tinytext NULL DEFAULT NULL, is_castable tinyint(1) NOT NULL DEFAULT 0, bits_color tinyint(4) DEFAULT NULL, subscription_email enum('pending','sent') NOT NULL DEFAULT 'pending' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; loading Creating database structure... `

impossible to go further in the installation process. Help me :/

MacWarrior commented 2 years ago

Hi @rems25000,

Thanks for report ; I'll fix this asap ! (Tonight or tomorrow 😉)

Best regards, MacWarrior.

rems25000 commented 2 years ago

Hi MacWarrior, How nice. I wouldn't hesitate to tell you about any bugs I encounter. Thank you.

rems25000 commented 2 years ago

datecreated date NOT NULL DEFAULT CURRENT_TIMESTAMP, TO datecreated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,

PASS

Hwilliams8548 commented 2 years ago

I was having this same problems! I hope it gets fixed.

rems25000 commented 2 years ago

Once the installation is done and a test video uploaded. nothing more happens.

video log:

16422703854aa57.log

MacWarrior commented 2 years ago

@Hwilliams8548, @rems25000 : Which version of MySQL/MariaDB are you using ?

@rems25000 : You should have a PHP error, can you :

Then retry to import file and check for PHP errors

Best regards, MacWarrior.

Hwilliams8548 commented 2 years ago

@MacWarrior I am not home right now but when I get home I will check

rems25000 commented 2 years ago

mysql Ver 15.1 Distrib 10.1.48-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

rems25000 commented 2 years ago

I have no errors PHP in développer mode. Upload OK the video is stored in files/conversion_queue A log file is generated without error and without the start of conversion. The video is displayed on the main page of the site but does not played

rems25000 commented 2 years ago

in error.log: PHP Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/clipbucket/upload/includes/classes/conversion/ffmpeg.class.php on line 5

MacWarrior commented 2 years ago

"Required : MySQL 5.6+ / MariaDB 10.3+"

I've tested newer versions but It's been a long time since Ă  tried old ones !

MacWarrior commented 2 years ago

What is your PHP version ?

rems25000 commented 2 years ago

PHP 7.2.24-0ubuntu0.18.04.10 (cli) (built: Oct 25 2021 17:47:59) ( NTS )

MacWarrior commented 2 years ago

in error.log: PHP Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/clipbucket/upload/includes/classes/conversion/ffmpeg.class.php on line 5

Ok, I have this one.... Latest edits I made on ffmpeg require PHP 7.4+... Fix will come in minutes...

MacWarrior commented 2 years ago

PHP error is now fixed with last commit But you should really consider upgrading your PHP version to 7.4 at least Cf. PHP Supported version : https://www.php.net/supported-versions.php

rems25000 commented 2 years ago

in script: apt-get install php7.2 apache2 mariadb-server php-curl ffmpeg php7.2-mysql php7.2-xml php7.2-mbstring php7.2-gd sendmail mediainfo --yes > /dev/null 2>&1

MacWarrior commented 2 years ago

in script: apt-get install php7.2 apache2 mariadb-server php-curl ffmpeg php7.2-mysql php7.2-xml php7.2-mbstring php7.2-gd sendmail mediainfo --yes > /dev/null 2>&1

PHP 7.2 is the default version available with Ubundu 18.04 And for now, I want CB5 compatible with PHP 7.0+ so the PHP error you met was on me 😄 In all cases, you should consider upgrading your PHP version to a supported one (By PHP themself) before going live

Current dev version (5.5.0) will stay compatible with PHP 7.0-7.3 but I think I will update PHP minimum version to 7.4 with version 5.6 and then will stay correlated with PHP supported version In this situation, I'll update installation script

But for now, let's focus on the SQL error... I should have some old Ubuntu 18.04 VM somewhere...

rems25000 commented 2 years ago

currently : PHP 7.4.27 (cli) (built: Dec 20 2021 21:27:56) ( NTS ) Server version: 10.3.32-MariaDB-1:10.3.32+maria~bionic mariadb.org binary distribution I put the installation folder and I start from zero.

rems25000 commented 2 years ago

Creating database structure... PASS!

rems25000 commented 2 years ago

but after importing the video no conversion

MacWarrior commented 2 years ago

Did you updated to last revision ? Re-check for php errors ?

rems25000 commented 2 years ago

the video stays in temp and does not go to the convert folder.

MacWarrior commented 2 years ago

You are missing PHP libraries :

apt install php7.4-mysql php7.4-xml php7.4-mbstring php7.4-gd

rems25000 commented 2 years ago

it works....

rems25000 commented 2 years ago

But, conversion finished, it's the video that asks to wait.

MacWarrior commented 2 years ago

Can you provide logs or screenshots ?

rems25000 commented 2 years ago

submit button now don't redirect. just validation message. 1642286319d77d4.log image

MacWarrior commented 2 years ago

Video conversion seems to have failed ; can you check conversion log ?

rems25000 commented 2 years ago

in my previous comment the .log file if there is another log please tell me the path.

MacWarrior commented 2 years ago

Conversion log from 4h ago was generated with a PHP error I fixed since ; you have to re-upload your video to make a new import test

Conversion log is also available from admin area > Videos > Videos manager : your video

rems25000 commented 2 years ago

Raw Conversion Log

========================================== Pre-Check Configurations

File to be converted

Initializing File 1642291238bd6b1.mp4 and pre checking configurations...

Temporary Uploading

File Uploaded to Temp directory successfully and video conversion file is being executed !

Video Conversion File Execution

Video Converson File executed successfully with Target File > !1642291238bd6b1.mp4

========================================== Starting Conversion Log

Getting Arguments

Filename : 1642291238bd6b1.mp4 File directory : 2022/01/16 Log file : /var/www/clipbucket/upload/files/logs/2022/01/16/1642291238bd6b1.log

Conversion queue

Getting the file information from the queue for conversion

Conversion queue

File has been moved from temporary dir to Conversion Queue

Starting Conversion

Started on 2022-01-16 00:00:43 - 2022 Jan 16

Checking File... File : /var/www/clipbucket/upload/files/conversion_queue/1642291238bd6b1.mp4

Preparing file...

video_wh_ratio : 1.7777777777778 video_color : N/A path : /var/www/clipbucket/upload/files/conversion_queue/1642291238bd6b1.mp4 format : mov,mp4,m4a,3gp,3g2,mj2 duration : 62.28 bitrate : 1347820 video_bitrate : 959963 video_width : 1280 video_height : 720 bits_per_raw_sample : 8 video_codec : h264 video_rate : 25 size : 10498677 audio_codec : aac audio_bitrate : 383727 audio_rate : 48000 audio_channels : 6 rotation : 0

Thumbs Generation

====== End : Thumbs Generation =======

Conversion Ouput

Converting Video file 240 @ 2022-01-16 00:00:52

Files resolution : 240

== Conversion Command ==

/usr/local/bin/ffmpeg -i /var/www/clipbucket/upload/files/conversion_queue/1642291238bd6b1.mp4 -y -hide_banner -vcodec libx264 -preset medium -r 25 -pix_fmt yuv420p -max_muxing_queue_size 1024 -start_at_zero -vb 240000 -s 428x240 -aspect 16/9 -b:a 128000 -ar 22050 -c:a aac -profile:a aac_low -ac 2 -map 0:0 -map 0:1 -c:s mov_text -f mp4 -movflags faststart /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-240.mp4 2> /var/www/clipbucket/upload/files/temp/1642291252deb17.tmp End resolutions @ 2022-01-16 00:01:00

OutPut Details

video_wh_ratio : 1.7833333333333 video_color : N/A path : /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-240.mp4 format : mov,mp4,m4a,3gp,3g2,mj2 duration : 62.28 bitrate : 361143 video_bitrate : 227579 video_width : 428 video_height : 240 bits_per_raw_sample : 8 video_codec : h264 video_rate : 25 size : 2815202 audio_codec : aac audio_bitrate : 128867 audio_rate : 22050 audio_channels : 2 rotation : 0

Conversion Ouput

Converting Video file 360 @ 2022-01-16 00:01:00

Files resolution : 360

== Conversion Command ==

/usr/local/bin/ffmpeg -i /var/www/clipbucket/upload/files/conversion_queue/1642291238bd6b1.mp4 -y -hide_banner -vcodec libx264 -preset medium -r 25 -pix_fmt yuv420p -max_muxing_queue_size 1024 -start_at_zero -vb 400000 -s 640x360 -aspect 16/9 -b:a 128000 -ar 22050 -c:a aac -profile:a aac_low -ac 2 -map 0:0 -map 0:1 -c:s mov_text -f mp4 -movflags faststart /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-360.mp4 2> /var/www/clipbucket/upload/files/temp/164229126013125.tmp End resolutions @ 2022-01-16 00:01:12

OutPut Details

video_wh_ratio : 1.7777777777778 video_color : N/A path : /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-360.mp4 format : mov,mp4,m4a,3gp,3g2,mj2 duration : 62.28 bitrate : 511535 video_bitrate : 378235 video_width : 640 video_height : 360 bits_per_raw_sample : 8 video_codec : h264 video_rate : 25 size : 3987549 audio_codec : aac audio_bitrate : 128867 audio_rate : 22050 audio_channels : 2 rotation : 0

Conversion Ouput

Converting Video file 480 @ 2022-01-16 00:01:13

Files resolution : 480

== Conversion Command ==

/usr/local/bin/ffmpeg -i /var/www/clipbucket/upload/files/conversion_queue/1642291238bd6b1.mp4 -y -hide_banner -vcodec libx264 -preset medium -r 25 -pix_fmt yuv420p -max_muxing_queue_size 1024 -start_at_zero -vb 700000 -s 854x480 -aspect 16/9 -b:a 128000 -ar 22050 -c:a aac -profile:a aac_low -ac 2 -map 0:0 -map 0:1 -c:s mov_text -f mp4 -movflags faststart /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-480.mp4 2> /var/www/clipbucket/upload/files/temp/16422912739522a.tmp End resolutions @ 2022-01-16 00:01:31

OutPut Details

video_wh_ratio : 1.7791666666667 video_color : N/A path : /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-480.mp4 format : mov,mp4,m4a,3gp,3g2,mj2 duration : 62.28 bitrate : 795379 video_bitrate : 662255 video_width : 854 video_height : 480 bits_per_raw_sample : 8 video_codec : h264 video_rate : 25 size : 6200182 audio_codec : aac audio_bitrate : 128867 audio_rate : 22050 audio_channels : 2 rotation : 0

Conversion Ouput

Converting Video file 720 @ 2022-01-16 00:01:32

Files resolution : 720

== Conversion Command ==

/usr/local/bin/ffmpeg -i /var/www/clipbucket/upload/files/conversion_queue/1642291238bd6b1.mp4 -y -hide_banner -vcodec libx264 -preset medium -r 25 -pix_fmt yuv420p -max_muxing_queue_size 1024 -start_at_zero -vb 2500000 -s 1280x720 -aspect 16/9 -b:a 128000 -ar 22050 -c:a aac -profile:a aac_low -ac 2 -map 0:0 -map 0:1 -c:s mov_text -f mp4 -movflags faststart /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-720.mp4 2> /var/www/clipbucket/upload/files/temp/16422912924e0e3.tmp End resolutions @ 2022-01-16 00:02:08

OutPut Details

video_wh_ratio : 1.7777777777778 video_color : N/A path : /var/www/clipbucket/upload/files/videos/2022/01/16/1642291238bd6b1-720.mp4 format : mov,mp4,m4a,3gp,3g2,mj2 duration : 62.28 bitrate : 2465734 video_bitrate : 2335194 video_width : 1280 video_height : 720 bits_per_raw_sample : 8 video_codec : h264 video_rate : 25 size : 19221016 audio_codec : aac audio_bitrate : 128867 audio_rate : 22050 audio_channels : 2 rotation : 0

Conversion Completed

Time Took : 84.8525 seconds Conversion_status : completed

MacWarrior commented 2 years ago

Conversion_status : completed

And everything looks fine, video should be playing well...

rems25000 commented 2 years ago

no, the player systematically displays the black video.

MacWarrior commented 2 years ago

Even from admin area player ?

rems25000 commented 2 years ago

image image

MacWarrior commented 2 years ago

Je parlais plutÎt de la page d'édition de la vidéo qui propose également un player Le sous-menu visionner redirige vers la page du front office

Il semble également y avoir un soucis avec le type de vidéo ; peux-tu vérifier dans la configuration (General > Website Configurations > Conversion si le format MP4 est bien sélectionné ? image

rems25000 commented 2 years ago

la config actuelle: image je ne trouve pas de page qui permet de visionner autrement que avec watch_video.php

MacWarrior commented 2 years ago

Via le sous-menu Editer :

image

Ou directement en cliquant sur le titre de la vidéo depuis l'espace d'administration

MacWarrior commented 2 years ago

Ce qui n'est pas normal, c'est le "0" affiché sur les vidéos :

image

Il devrait afficher "MP4" ou "HLS" selon le type de conversion sélectionné

rems25000 commented 2 years ago

image

rems25000 commented 2 years ago

image

MacWarrior commented 2 years ago

Je confirme que le soucis viens du champ file_type de la table video qui doit contenir "0" (dans ta situation) au lieu de "MP4"

J'investigue sur le sujet, mais ne pourrai probablement pas corriger ce soir !

rems25000 commented 2 years ago

si je modifier directement en sql j'ai sa: Incorrect integer value: 'MP4' for column clipbucket.cb_video.file_type at row 1 si je met 1 sa ne fonctionne pas.

rems25000 commented 2 years ago

la case ne prend que des nombres.

MacWarrior commented 2 years ago

Ok, j'ai trouvé ! La colonne file_type n'a pas le bon type lors de la création ; je corrige !

ALTER TABLE `{tbl_prefix}video`
    MODIFY COLUMN `file_type` VARCHAR(3) NULL DEFAULT NULL;

En remplaçant le prĂ©fixe de la table, cette requĂȘte mettra Ă  jour la structure de la table qui pose problĂšme

rems25000 commented 2 years ago

image

rems25000 commented 2 years ago

maintenant au moment de faire "bubmit now" j'ai Video does not exist

MacWarrior commented 2 years ago

Pas de soucis de mon cÎté ; une erreur PHP ?

rems25000 commented 2 years ago

non erreur chaise, clavier. :)

rems25000 commented 2 years ago

image