Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#12868 closed Bug Report - General (fixed)

!!NoTrans: SQL Error: Column 'inetref' cannot be null [#1048]!!

Reported by: mythtvBugs@… Owned by: Stuart Auchterlonie
Priority: minor Milestone: 0.28.1
Component: Plugin - MythWeb Version: 0.28.0
Severity: medium Keywords:
Cc: Ticket locked: no

Description

On a fresh install of mythbuntu 16 with the latest 0.28 installed, when I click on 'Never Record' for a show, I get a Fatal Error of:

datetime: 2016-09-01 20:20:44 (MDT) errornum: 256

error type: User Error

error string: !NoTrans: SQL Error: Column 'inetref' cannot be null #1048!!

filename: /usr/share/mythtv/mythweb/classes/Database/Query/mysqlicompat.php

error line: 98

==========================================================================

Backtrace:

file: /usr/share/mythtv/mythweb/classes/Database/Query/mysqlicompat.php line: 98

class:

function: trigger_error

type: args: Array

(

[0] => SQL Error: Column 'inetref' cannot be null #1048 [1] => 256

)

file: /usr/share/mythtv/mythweb/classes/Database.php line: 261

class: Database_Query_mysqlicompat

function: execute

type: -> args: Array

(

[0] => Array ( )

)

file: /usr/share/mythtv/mythweb/modules/tv/classes/Program.php line: 650

class: Database

function: query

type: -> args: Array

(

[0] => REPLACE INTO oldrecorded (chanid,starttime,endtime,title,subtitle,description,season,episode,category,seriesid,programid,inetref,recordid,station,rectype,recstatus,duplicate,generic) VALUES ('1519',NOW(),NOW(),'The Hitchhiker\'s Guide to the Galaxy',,'A human (Martin Freeman) and his extraterrestrial friend (Mos Def) begin an interstellar journey after the destruction of Earth.','0','0','Science fiction',,'MV001568250000',NULL,'0','ACMAXHD','0',11,1,0)

)

file: /usr/share/mythtv/mythweb/modules/tv/detail.php line: 264

class: Program

function: rec_never_record

type: -> args: Array ( ) file: /usr/share/mythtv/mythweb/modules/tv/handler.php line: 82

class:

function: require_once

type: args: Array

(

[0] => /usr/share/mythtv/mythweb/modules/tv/detail.php

)

file: /usr/share/mythtv/mythweb/mythweb.php line: 35

class:

function: require_once

type: args: Array

(

[0] => /usr/share/mythtv/mythweb/modules/tv/handler.php

)

==========================================================================

$_GET: Array (

[never_record] => yes [chanid] => 1519 [starttime] => 1472854200 [manualid] => 0

)

==========================================================================

$_SESSION: Array (

[cache_engine] => Cache_Null [stream] => Array

(

[include_user_and_password] =>

)

[prefer_channum] => 1 [recorded_pixmaps] => 1 [guide_favonly] => [timeslot_size] => 300 [num_time_slots] => 72 [timeslot_blocks] => 12 [timeslotbar_skip] => 10 [max_stars] => 4 [star_character] => ★ [show_popup_info] => 1 [show_channel_icons] => 1 [sortby_channum] => 1 [recorded_paging] => null [genre_colors] => 1 [show_video_covers] => 1 [settings] => Array

(

[screens] => Array

(

[tv] => Array

(

[upcoming recordings] => Array

(

[title] => on [channel] => on [record date] => on [length] => on

)

)

)

[last] => Array

(

[0] => video [1] => settings

)

[host] => mythtv16

)

[backend] => Array

(

[127.0.0.1] => Array

(

[proto_version] => Array

(

[last_check_version] => 88 [last_check_time] => 1472778711

)

)

[timezone] => Array

(

[value] => America/Denver? [last_check_time] => 1472778711

)

)

[language] => English [date_statusbar] => %a %b %e, %Y, %I:%M %p [date_scheduled] => %a %b %e, %Y (%I:%M %p) [date_scheduled_popup] => %a %b %e, %Y [date_recorded] => %a %b %e, %Y (%I:%M %p) [date_search] => %a %b %e, %Y, %I:%M %p [date_listing_key] => %a %b %e, %Y, %I:%M %p [date_listing_jump] => %a %b %e, %Y [date_channel_jump] => %a %b %e, %Y [date_job_status] => %a %b %e, %Y, %I:%M %p [time_format] => %I:%M %p [tv] => Array

(

[last] => Array

(

[0] => detail [1] => 1519 [2] => 1472854200

)

)

[recorded_sortby] => Array

(

[0] => Array

(

[field] => airdate [reverse] => 1

)

[1] => Array

(

[field] => title [reverse] =>

)

)

[] => Array ( ) [list_time] => 1472868874 [search] => Array

(

[type] => q [s] => Shanghai Noon$ [ctype] => Array

(

[0] => [1] => movie

)

[categories] => Array ( ) [stars_gt] => 0.875 [stars_lt] => 0.875 [starttime] => now [endtime] => + 2 weeks [as] => Array

(

[0] =>

)

[af] => Array

(

[0] => Array

(

[0] => title

)

)

[aj] => Array

(

[0] => AND

)

[hd] => 1 [commfree] => [unwatched] => [scheduled] => [generic] => [distinctTitle] => [airdate_start] => [airdate_end] =>

)

[search_sortby] => Array

(

[0] => Array

(

[field] => airdate [reverse] =>

)

[1] => Array

(

[field] => title [reverse] =>

)

)

[recording_details] => Array

(

[show_Conflict] => 1 [show_PreviousRecording] => 1 [show_EarlierShowing] => 1 [show_CurrentRecording] => 1 [show_WillRecord] => 1

)

[file_url_override] => [scheduled_recordings] => Array

(

[disp_scheduled] => 1 [disp_duplicates] => [disp_deactivated] => [disp_conflicts] => 1

)

[scheduled_sortby] => Array

(

[0] => Array

(

[field] => airdate [reverse] =>

)

[1] => Array

(

[field] => title [reverse] =>

)

)

)

==========================================================================

$_SERVER: Array (

[REDIRECT_STATUS] => 200 [HTTP_HOST] => 10.200.1.20 [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5 [HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_REFERER] => http://10.200.1.20/mythweb/tv/detail/1519/1472854200 [HTTP_COOKIE] => mythweb_id=3o8ts2b9k336dk1ct5nc98k7v1 [HTTP_CONNECTION] => keep-alive [HTTP_UPGRADE_INSECURE_REQUESTS] => 1 [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [SERVER_SIGNATURE] => <address>Apache/2.4.18 (Ubuntu) Server at 10.200.1.20 Port 80</address>

[SERVER_SOFTWARE] => Apache/2.4.18 (Ubuntu) [SERVER_NAME] => 10.200.1.20 [SERVER_ADDR] => 10.200.1.20 [SERVER_PORT] => 80 [REMOTE_ADDR] => 10.200.1.2 [DOCUMENT_ROOT] => /var/www/html [REQUEST_SCHEME] => http [CONTEXT_PREFIX] => [CONTEXT_DOCUMENT_ROOT] => /var/www/html [SERVER_ADMIN] => webmaster@localhost [SCRIPT_FILENAME] => /var/www/html/mythweb/mythweb.php [REMOTE_PORT] => 57182 [REDIRECT_URL] => /mythweb/tv/detail/1519/1472854200 [REDIRECT_QUERY_STRING] => never_record=yes [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => never_record=yes [REQUEST_URI] => /tv/detail/1519/1472854200?never_record=yes [SCRIPT_NAME] => /mythweb/mythweb.php [PATH_INFO] => /tv/detail/1519/1472854200 [PATH_TRANSLATED] => /var/www/html/tv/detail/1519/1472854200 [PHP_SELF] => /mythweb/mythweb.php/tv/detail/1519/1472854200 [REQUEST_TIME_FLOAT] => 1472782844.48 [REQUEST_TIME] => 1472782844 [STATUS] => 200 [URL] => /mythweb/tv/detail/1519/1472854200 [HTTP_X_FORWARDED_PROTO] => [HTTPS] => [HTTP_PORT] => 80

)

==========================================================================

$constant_listuser?: Array (

[ERROR] => 512 [E_ASSERT_ERROR] => 4096 [FATAL] => 256 [JOB_ABORTED] => 288 [JOB_ABORTING] => 9 [JOB_CANCELLED] => 320 [JOB_COMMFLAG] => 2 [JOB_DONE] => 256 [JOB_ERRORED] => 304 [JOB_ERRORING] => 8 [JOB_EXTERNAL] => 4 [JOB_FINISHED] => 272 [JOB_LIST_ALL] => 1 [JOB_LIST_DONE] => 2 [JOB_LIST_ERROR] => 8 [JOB_LIST_NOT_DONE] => 4 [JOB_LIST_RECENT] => 16 [JOB_LIVE_REC] => 2 [JOB_METADATA] => 4 [JOB_NONE] => 0 [JOB_NO_FLAGS] => 0 [JOB_PAUSE] => 1 [JOB_PAUSED] => 6 [JOB_PENDING] => 2 [JOB_QUEUED] => 1 [JOB_RESTART] => 8 [JOB_RESUME] => 2 [JOB_RETRY] => 7 [JOB_RUN] => 0 [JOB_RUNNING] => 4 [JOB_STARTING] => 3 [JOB_STOP] => 4 [JOB_STOPPING] => 5 [JOB_SYSTEMJOB] => 255 [JOB_TRANSCODE] => 1 [JOB_UNKNOWN] => 0 [JOB_USERJOB] => 65280 [JOB_USERJOB1] => 256 [JOB_USERJOB2] => 512 [JOB_USERJOB3] => 1024 [JOB_USERJOB4] => 2048 [JOB_USE_CUTLIST] => 1 [PHP_MIN_VERSION] => 5.3 [WARNING] => 1024 [WebDBSchemaVer] => 4 [dupsin_all] => 15 [dupsin_newepisodes] => 16 [dupsin_oldrecorded] => 2 [dupsin_recorded] => 1 [error_email] => [gb] => 1073741824 [hostname] => mythtv16 [http_host] => 10.200.1.20 [kb] => 1024 [max_stars] => 4 [mb] => 1048576 [module] => tv [modules_path] => /usr/share/mythtv/mythweb/modules [num_time_slots] => 72 [prefer_channum] => 1 [rectype_always] => 4 [rectype_daily] => 2 [rectype_dontrec] => 8 [rectype_findone] => 6 [rectype_once] => 1 [rectype_override] => 7 [rectype_template] => 11 [rectype_weekly] => 5 [root] => /mythweb/ [root_auth_url] => http://10.200.1.20/mythweb/ [root_url] => http://10.200.1.20/mythweb/ [searchtype_keyword] => 3 [searchtype_manual] => 5 [searchtype_people] => 4 [searchtype_power] => 1 [searchtype_title] => 2 [skin] => default [skin_img_url] => http://10.200.1.20/mythweb/skins/default/img/ [skin_url] => http://10.200.1.20/mythweb/skins/default/ [star_character] => &#9733; [stream_url] => http://10.200.1.20:80//mythweb/ [tb] => 1099511627776 [timeslot_blocks] => 12 [timeslot_size] => 300 [timeslotbar_skip] => 10 [tmpl] => default [tmpl_dir] => modules/tv/tmpl/default/

)

Attachments (1)

ticket12868-inetref-fix.diff (942 bytes) - added by Stuart Auchterlonie 3 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 3 years ago by Stuart Auchterlonie

Component: MythTV - GeneralPlugin - MythWeb
Milestone: unknown0.28.1
Owner: set to Stuart Auchterlonie

comment:2 Changed 3 years ago by Stuart Auchterlonie

There is an interesting anomaly in our DB schema here.

For programs table we have this definition `inetref` varchar(40) DEFAULT '', and for oldrecorded table we have this definition `inetref` varchar(40) NOT NULL, and according to desc oldrecorded in my DB the default value is NULL whilst not being allowed to be NULL.

Last edited 3 years ago by Stuart Auchterlonie (previous) (diff)

Changed 3 years ago by Stuart Auchterlonie

comment:3 Changed 3 years ago by Stuart Auchterlonie

Status: newinfoneeded_new

Can you please try the patch attached to the ticket? As root you will need to do the following

# cd /usr/share/mythtv/mythweb/
# patch -p1 < /full/path/to/patch/ticket12868-inetref-fix.diff

Just to be double sure the new code is picked up, please restart your webserver.

comment:4 Changed 3 years ago by Stuart Auchterlonie <stuarta@…>

Resolution: fixed
Status: infoneeded_newclosed

In 7b469b2fa6408f178e19726f67a5797e58b244c8/mythweb:

Fixes #12868. inetref cannot be NULL

comment:5 Changed 3 years ago by Stuart Auchterlonie <stuarta@…>

In 291d3308f074a8e0918fbac529fb9e1014f9ad8c/mythweb:

Fixes #12868. inetref cannot be NULL

(cherry picked from commit 7b469b2fa6408f178e19726f67a5797e58b244c8)

Note: See TracTickets for help on using tickets.