Previous Thread
Next Thread
Print Thread
Hop To
Help with database error #261238 03/24/2018 6:44 PM
Joined: Aug 2006
Posts: 584
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 584
Hi guys, it's been a while since I've been here but I am hoping someone can help me resolve an issue. I have a backup of an older UBB version. I had all the files backed up and the database backed up. I recently had a need to temporarily re-install that from backups to look at something in my forum posts there, but have run into a snag.

I have uploaded all the files and database to my server, but when I try to go to my forum index file I get the following (See attached)/ In case the attachment doesn't work, it basically says:

UBB Message
We encountered a problem. The reason reported was
Database error only visible to forum administrators
Please click back to return to previous page.

My question to you all is, how can I see this error when I can't get logged in? In cPanel, the error log doesn't show any database errors so maybe DB error are accessible from somewhere else? Any help is greatly appreciated.

UPDATE: Upon closer look, I did find a related error in error logs:

[Sat Mar 24 18:26:23.737975 2018] [cgi:error] [pid 11836] [client XX.XX.XX.XX:XXXX] AH01215: PHP Fatal error: Call to a member function error() on null in /home/xyz/public_html/ubforum/libs/mysql.inc.php on line 77: /usr/local/cpanel/cgi-sys/ea-php56, referer: http://www.blahblah.com/ubforum/admin/

Line 77 seems to be the $admin->error( $errstr ) in the following code:

PHP Code
global $admin, $html;

		if (defined('IS_ADMIN')) {
			$admin->error( $errstr );
		} else if (defined('IS_IMPORT') || defined('IS_UPGRADE')) {
			echo '<b>SQL Error:</b> ' . $errstr;
		} else {
			if (!is_object($html)) {
				$html = new html;
			}

			if (defined('NO_WRAPPERS')) $is_bare = true;

			( $is_bare ? $html->not_right_bare( $errstr ) : $html->not_right( $errstr ) );
		}
	} 


Attached Files Screen Shot 2018-03-24 at 4.33.30 PM.jpeg
Last edited by Basil; 03/24/2018 6:56 PM.
Express Hosting
Re: Help with database error [Re: Basil] #261239 03/24/2018 6:56 PM
Joined: Jun 2006
Posts: 15,851
Gizmo Online Tapedshut
UBB.threads Developer
Online Tapedshut
UBB.threads Developer
Joined: Jun 2006
Posts: 15,851
To display errors when MySQL logging is off (or hasn't been enabled) you'd need to make a small change to an embedded variable
In /libs/mysql.inc.php change:
Code
$showerror = 0;


to
Code
$showerror = 1;


You'll want to reverse this change once everything is worked out.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Help with database error [Re: Basil] #261240 03/24/2018 7:46 PM
Joined: Aug 2006
Posts: 584
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 584
Thanks for that! I guess either I didn't download the entire DB or when I tried to re-import it, it didn't import all the way because the error is:

SQL Error: Table 'xyz_threadsv7.ubbt_USERS' doesn't exist

Looks like all the tables didn't import (Or if I screwed up when I did the last backup I may be screwed unless I get lucky and can find an older DB backup.

Re: Help with database error [Re: Basil] #261241 03/24/2018 7:53 PM
Joined: Jun 2006
Posts: 15,851
Gizmo Online Tapedshut
UBB.threads Developer
Online Tapedshut
UBB.threads Developer
Joined: Jun 2006
Posts: 15,851
Is the current database named "xyz_threadsv7"?


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Help with database error [Re: Gizmo] #261242 03/24/2018 8:33 PM
Joined: Aug 2006
Posts: 584
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 584
Yes and no. the xyz is really something else, but I obfuscated it for posting on a public forum. But the database in question has the exact same name as was in the error. Now, I just tried to re-import the database to see if I can all the tables, but I got this in PhPMyAdmin:

SQL query:


--
-- Dumping data for table `ubbt_ANNOUNCEMENTS`
--

INSERT INTO `ubbt_ANNOUNCEMENTS` (`TOPIC_ID`, `FORUM_ID`) VALUES
(5343, '22'),
(6770, '20'),
(6779, '17'),
(7580, '23'),
(15561, '26'),


MySQL said:

#1062 - Duplicate entry '5343-22' for key 'a_index'


Do I need to delete and re-create a DB before I try to import it again?

Last edited by Basil; 03/24/2018 8:33 PM.
Re: Help with database error [Re: Basil] #261243 03/24/2018 8:39 PM
Joined: Jun 2006
Posts: 15,851
Gizmo Online Tapedshut
UBB.threads Developer
Online Tapedshut
UBB.threads Developer
Joined: Jun 2006
Posts: 15,851
Are you attempting to import a backup through PHPMyAdmin? You'll likely hit the PHP max execute time if using a large database.

I would recommend importing a database via command line vs through a web script; I have some instructions in the "Import Database section of the "Migration Guide" at UBBWiki:
Quote
Now that the old files are on the new server, you need to import your database; you can again use PHPMyAdmin or use the command line to import the database. The command line way of doing this (note, this is not the MySQL command line, simply the Linux command line) would be:
Code
mysql -h localhost -uuser -ppass database_name < databasebackupfile.sql


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Help with database error [Re: Basil] #261244 03/24/2018 8:50 PM
Joined: Aug 2006
Posts: 584
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 584
Ok, I'll try that but I have a sinking feeling that when I did the backup I didn't get the entire DB

Re: Help with database error [Re: Basil] #261245 03/24/2018 8:52 PM
Joined: Jun 2006
Posts: 15,851
Gizmo Online Tapedshut
UBB.threads Developer
Online Tapedshut
UBB.threads Developer
Joined: Jun 2006
Posts: 15,851
Entirely possible if you did it through PHPMyAdmin and the database wasnt fully exported. I generally either export/import via command line or SQLYog (when SSH access is not provided).


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Help with database error [Re: Basil] #261246 03/25/2018 12:02 AM
Joined: Jun 2006
Posts: 15,851
Gizmo Online Tapedshut
UBB.threads Developer
Online Tapedshut
UBB.threads Developer
Joined: Jun 2006
Posts: 15,851
It'll also throw an already exists error if you're importing into a database which already has data in it as you cannot import a UBB.threads database over a UBB.threads database.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Need to Upgrade?
Forums: A Gardeners Forum Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Re: Help with database error [Re: Gizmo] #261247 03/25/2018 5:04 PM
Joined: Dec 2003
Posts: 5,944
Ruben Offline
Offline
Joined: Dec 2003
Posts: 5,944
Basil,
You also need to undo the show error that Gizmo showed you.
It is a temporary measure if you don't have error logs turned on.
It will show any member/guest the same info.

Last edited by Ruben; 03/25/2018 5:04 PM.

Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Re: Help with database error [Re: Basil] #261249 03/26/2018 9:45 PM
Joined: Aug 2006
Posts: 584
Basil Offline OP
old hand
OP Offline
old hand
Joined: Aug 2006
Posts: 584
Thanks guys. I think I have to conclude that when I backed up the db I did not get the entire db so am essentially dead in the water. Oh well, lesson learned (PS: I did turn off the debug).


Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
visual accessibility issues.v7.7.3
by Ruben - 08/21/2019 1:50 PM
Holy grail to fix compatibility bewteen browsers
by Ruben - 08/20/2019 4:25 PM
File Manager and Image Uploads
by Ty Griffin - 08/19/2019 4:48 PM
Minimum Post Character Count
by M4TT - 08/19/2019 1:58 PM
[FIXED for 7.7.4] Strange Merge Issue
by Baldeagle - 08/16/2019 3:37 PM
Who's Online Now
2 registered members (Gizmo, isaac), 58 guests, and 256 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Photos
Stones
Amusing Terain Scenics
Sky places
Work spaces
Powered by UBB.threads™ PHP Forum Software 7.7.3