Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

[SOLVED] Mysql error after restoring from backup 2 weeks 5 days ago #1

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
Hi

I've been running my webtrees server on a Raspberry Pi 4 here at home, and recently my MariaDB installation was corrupted (no idea how). I've reinstalled MariaDB, and retrieved a backup of my sql database, which seems to have mostly worked, exept for an error showing up on the right hand side of the page:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'AndrewsTree1.wt_media_file' doesn't exist (SQL: select `wt_media`.* from `wt_media` inner join `wt_media_file` on `wt_media_file`.`m_file` = `wt_media`.`m_file` and `wt_media_file`.`m_id` = `wt_media`.`m_id` where `wt_media`.`m_file` = 16 and `wt_media_file`.`multimedia_format` in (jpg, jpeg, png, gif, tiff, bmp) and `wt_media_file`.`source_media_type` in (book, card, certificate, coat, document, electronic, fiche, film, magazine, manuscript, map, newspaper, other, painting, photo, tombstone, )) …/vendor/illuminate/database/Connection.php:664
#0 …/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('select `wt_medi...', Array, Object(Closure))
#1 …/vendor/illuminate/database/Connection.php(333): Illuminate\Database\Connection->run('select `wt_medi...', Array, Object(Closure))
#2 …/vendor/illuminate/database/Query/Builder.php(2130): Illuminate\Database\Connection->select('select `wt_medi...', Array, true)
#3 …/vendor/illuminate/database/Query/Builder.php(2118): Illuminate\Database\Query\Builder->runSelect()
#4 …/vendor/illuminate/database/Query/Builder.php(2604): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 …/vendor/illuminate/database/Query/Builder.php(2119): Illuminate\Database\Query\Builder->onceWithColumns(Array, Object(Closure))
#6 …/app/Module/SlideShowModule.php(121): Illuminate\Database\Query\Builder->get()
#7 …/app/Http/RequestHandlers/UserPageBlock.php(72): Fisharebest\Webtrees\Module\SlideShowModule->getBlock(Object(Fisharebest\Webtrees\Tree), 20, 'user')
#8 …/app/Http/Middleware/WrapHandler.php(83): Fisharebest\Webtrees\Http\RequestHandlers\UserPageBlock->handle(Object(Nyholm\Psr7\ServerRequest))
#9 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\WrapHandler->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#10 …/app/Module/HitCountFooterModule.php(157): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#11 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Module\HitCountFooterModule->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#12 …/app/Http/Middleware/AuthLoggedIn.php(50): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#13 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\AuthLoggedIn->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#14 …/app/Http/Middleware/CheckCsrf.php(75): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#15 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckCsrf->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#16 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#17 …/app/Http/Middleware/Router.php(166): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))
#18 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\Router->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#19 …/app/Http/Middleware/BootModules.php(62): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#20 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BootModules->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#21 …/app/Http/Middleware/LoadRoutes.php(76): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#22 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\LoadRoutes->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#23 …/app/Http/Middleware/UseTransaction.php(45): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#24 …/vendor/illuminate/database/Concerns/ManagesTransactions.php(29): Fisharebest\Webtrees\Http\Middleware\UseTransaction::Fisharebest\Webtrees\Http\Middleware\{closure}(Object(Illuminate\Database\MySqlConnection))
#25 …/app/Http/Middleware/UseTransaction.php(46): Illuminate\Database\Connection->transaction(Object(Closure), 3)
#26 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTransaction->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#27 …/app/Http/Middleware/DoHousekeeping.php(74): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#28 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\DoHousekeeping->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#29 …/app/Http/Middleware/UseTheme.php(70): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#30 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseTheme->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#31 …/app/Http/Middleware/CheckForMaintenanceMode.php(51): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#32 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CheckForMaintenanceMode->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#33 …/app/Http/Middleware/UseLanguage.php(73): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#34 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseLanguage->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#35 …/app/Http/Middleware/UseSession.php(71): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#36 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseSession->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#37 …/app/Http/Middleware/UpdateDatabaseSchema.php(58): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#38 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#39 …/app/Http/Middleware/UseDebugbar.php(67): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#40 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDebugbar->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#41 …/app/Http/Middleware/UseDatabase.php(117): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#42 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#43 …/app/Http/Middleware/BadBotBlocker.php(212): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#44 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#45 …/app/Http/Middleware/RegisterFactories.php(72): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#46 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\RegisterFactories->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#47 …/vendor/middlewares/client-ip/src/ClientIp.php(81): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#48 …/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#49 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#50 …/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#51 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#52 …/app/Http/Middleware/BaseUrl.php(77): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#53 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#54 …/app/Http/Middleware/ReadConfigIni.php(69): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#55 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#56 …/app/Http/Middleware/SecurityHeaders.php(47): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#57 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#58 …/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#59 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#60 …/app/Http/Middleware/PhpEnvironment.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#61 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\PhpEnvironment->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#62 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#63 …/index.php(57): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))
#64 {main}

It only seems to show up on "My page", underneath the welcome panel.

I can see what the error's telling me, and it's a fair comment- there really is no 'wt_media_file' table in the database. So, I'm wondering what's going on.

Here's my confession: the backup is a bit old, and it's quite possible that it pre-dates the last webtrees upgrade (from 1.? to 2.?). But I'm not sure. Mea culpa.

Current webtrees version 2.0.9
MariaDB version 10.3.27
Apache 2.4.38
Database client version: libmysql - mysqlnd 5.0.12
PHP version: 7.3.27
Raspbian Buster

Any suggestions?

Cheers
Charlie

serenesky.duckdns.org/webtrees

Please Log in or Create an account to join the conversation.

Last edit: by Andrews.

Mysql error after restoring from backup 2 weeks 5 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
The database table wt_media_file was created in the upgrade from 1.7 to 2.0

(The table wt_media was split into two - wt_media and wt_media_file).

However, webtrees should upgrade the old database - unless it thinks it has already done it. (WT_SCHEMA_VERSION in table wt_site_setting).

So, what is the structure of your wt_media table and what schema version do you have?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Mysql error after restoring from backup 2 weeks 5 days ago #3

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
Hi Greg

Thanks for replying.

WT_SCHEMA_VERSION: 44

wt_media structure:
m_id: varchar(20)
m_file: int(11)
m_gedcom: longtext

I hope that's what you need?

Charlie

Please Log in or Create an account to join the conversation.

Mysql error after restoring from backup 2 weeks 5 days ago #4

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
That's the table wt_media table (and version number) *AFTER* it has been split into two.

I don't know what you've done, but you've lost one of your tables...

Your GEDCOM data should be OK, so you should be able to export to a GEDCOM file.

If this is the only broken/missing table, then perhaps you can create a new/temporary installation (e.g. with a different table prefix), and then manually create wt_media_file.

Then, re-import your GEDCOM file to re-populate this table. It just contains a structured copy of the files info from the wt_media table.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Mysql error after restoring from backup 2 weeks 5 days ago #5

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
OK, that looks like it's sorted.

Very many thanks indeed for your help there. Much appreciated.

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 2 weeks 1 day ago #6

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
OK, there's something I've noticed, and I'm not sure whether it's related to the above or not...

On my "My page", in the slide show pane, I have the following message:

Slide show
This family tree has no images to display.

Any clues? Might just be me doing something wrong...

Thanks again.

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 2 weeks 1 day ago #7

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
> Any clues?

Perhaps you don't have any media objects?
Perhaps they are all private?

That block has config options to select different types of media.
Perhaps you have no media objects that match this selection?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 2 weeks 23 hours ago #8

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
So, here's an odd thing...

I can browse through my tree, and see plenty of media objects (photos of people, gravestones, etc), but going to Lists > Media Objects shows Media objects found 0. The "Folder" drop-down menu is also empty. I've tried making various selections in that query page.

Thanks again for your continued input.

Charlie

Please Log in or Create an account to join the conversation.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

[SOLVED] Mysql error after restoring from backup 2 weeks 22 hours ago #9

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
Click the "Search" button?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 2 weeks 21 hours ago #10

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9

fisharebest wrote: Click the "Search" button?


Yep, tried that... (I should have mentioned, sorry!)

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 2 weeks 7 hours ago #11

  • markhattam
  • markhattam's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 1
What do you have in the "Media folder" setting in
Control panel > Manage family trees > Preferences

Does that match what is shown in
Control panel > Manage media

Is the media in subfolders?

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 1 week 6 days ago #12

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
Both locations match (showing /var/www/html/webtrees/data/media), and there are a number of subfolders.

I navigated to an individual with photos, and edited a photo to change media type to photo, and after this, that image was included in the media list and slideshow. (Hope that makes sense?). Obviously to do this for each of the 1100-or-so pictures in the collection would be laborious!

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 1 week 6 days ago #13

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
What if you just edit the media object, make no changes, and click save?

Perhaps it was saving it that fixed the problem, not changing the media type...
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 1 week 6 days ago #14

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
Ah ha. Yes, saving after making no changes has the same effect. "Media type" seems to be blank on all the objects, don't know if that's a factor.

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 1 week 6 days ago #15

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
Media type is allowed to be blank.

When you edit (update/save/import, etc.) any GEDCOM records, webtrees creates a number of search indexes.

It uses these indexes to find data for lists, the slide-show, etc.

I'm guessing that your earlier database corruption has lost the contents of one of these search indexes. (The table wt_media_file?)

To fix this, try exporting your tree to a GEDCOM file and then re-importing it.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

[SOLVED] Mysql error after restoring from backup 1 week 6 days ago #16

  • Andrews
  • Andrews's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
OK, looks like the export / import GEDCOM has done the trick.

Thank you very much indeed once again.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum