Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalog creation in 6.2 fails #3750

Open
elliotn opened this issue Dec 28, 2023 · 7 comments
Open

Catalog creation in 6.2 fails #3750

elliotn opened this issue Dec 28, 2023 · 7 comments

Comments

@elliotn
Copy link

elliotn commented Dec 28, 2023

Description

I created a new 6.2 installation. When I attempted to add a catalog, there is an internal crash/stack trace in src/Module/Util/VaInfo.php.

Describe the bug

I tried to add a new catalog, and kept seeing server-side events failing, reconnecting.

From looking at the apache logs, I saw a stack trace in :

src/Module/Util/VaInfo.php in clean_tag_info()

This throws an exception when $keys somehow comes in as an Array:

foreach ($keys as $key) {
$tags = $results[$key] ?? array();
...
}

I hacked it to something I had seen in the file, which prevents the crash/stacktrace:

foreach ($keys as $key) {
if (is_array($key)) {
$key = 'general';
}

$tags = $results[$key] ?? array();
...
}

To reproduce

Add new catalog.

Expected behavior

Catalog created.

Environment

  • Ampache version: 6.2
  • Web server + version: apache, v2.4.38
  • Server operating system: linux, v6.1.11-meson64
  • Client operating system: mac os x

Client type

  • Web - firefox

Logs

PHP Fatal error: Uncaught TypeError: Illegal offset type in /var/www/html/ampache6.via.git/src/Module/Util/VaInfo.php:580\nStack trace:\n#0 /var/www/html/ampache6.via.git/src/Module/Util/VaInfo.php(864): Ampache\Module\Util\VaInfo::clean_tag_info()\n#1 /var/www/html/ampache6.via.git/src/Module/Util/VaInfo.php(359): Ampache\Module\Util\VaInfo->_get_tags()\n#2 /var/www/html/ampache6.via.git/src/Module/Catalog/Catalog_local.php(901): Ampache\Module\Util\VaInfo->gather_tags()\n#3 /var/www/html/ampache6.via.git/src/Module/Catalog/Catalog_local.php(445): Ampache\Module\Catalog\Catalog_local->insert_local_song()\n#4 /var/www/html/ampache6.via.git/src/Module/Catalog/Catalog_local.php(308): Ampache\Module\Catalog\Catalog_local->add_file()\n#5 /var/www/html/ampache6.via.git/src/Module/Catalog/Catalog_local.php(365): Ampache\Module\Catalog\Catalog_local->add_files()\n#6 /var/www/html/ampache6.via.git/src/Module/Catalog/Catalog_local.php(308): Ampache\Module\Catalog\Catalog_local->add_file()\n#7 /var/www/html/ampache6.via.git/src/Module/Catalog/Catalog_local.php(529): Ampache\Module\Catalog\Catalog_local->add_files()\n#8 /var/www/html/ampache6.via.git/src/Repository/Model/Catalog.php(4087): Ampache\Module\Catalog\Catalog_local->add_to_catalog()\n#9 /var/www/html/ampache6.via.git/src/Module/Api/SseApiApplication.php(90): Ampache\Repository\Model\Catalog::process_action()\n#10 /var/www/html/ampache6.via.git/public/server/sse.server.php(32): Ampache\Module\Api\SseApiApplication->run()\n#11 {main}\n thrown in /var/www/html/ampache6.via.git/src/Module/Util/VaInfo.php on line 580, referer: http://172.16.0.10/ampache6/

@Verbocutane
Copy link

Verbocutane commented Dec 30, 2023

I ran into a similar (if not identical) problem. I tough I had fix it by changing the Filename and Folder Pattern of the catalog to "%t" and "%A" but it looks like the issue still occurs.

@elliotn
Copy link
Author

elliotn commented Dec 30, 2023

I reverted my changes and tried changing the filename and folder patterns. No dice. I'm back to my hack.

@JoeDat
Copy link

JoeDat commented Dec 31, 2023

Same issue. OP's hack works. Just moved my server to new hardware and was going nuts thinking I had a config issue somewhere. Decided to freshen up my instance and add a new catalog and ran into this as well.

@mneiger
Copy link
Contributor

mneiger commented Dec 31, 2023

same here
Happy new year.

@Verbocutane
Copy link

Verbocutane commented Jan 1, 2024

I did some cleanup in my mp3 files; I had some corrupted files (empty files), invalid year tag on some files ("0000"), duplicates files in different location (or different file name) containing identical tag information. After fixing those issues, I was able to update the catalog without any issue.

Not sure if this can solve this particular problem, but it might be worth a try :

#3754 (comment)

@lachlan-00
Copy link
Member

what i've found is that the code isn't stopping early enough on bad files, these two commits should fix any reading issues

db54ee6 (don't return tags in the key list)
and
fc296ec (missing return on an error with the file)

@elliotn
Copy link
Author

elliotn commented Jan 4, 2024

I cherry picked those 2 commits, and deleted and re-created my catalog successfully. Thanks for the fixes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants