v17development / flarum-support-feedback

The Flarum Support public repository to report bugs, feature requests and feedback
4 stars 0 forks source link

Flarum crash if i enabling Support extension. #10

Closed hasanmerkit closed 2 years ago

hasanmerkit commented 2 years ago

Error Preview: https://cdn.discordapp.com/attachments/952635535422292028/1021155686903709807/Adsz.png Note: Cleared cache with Terminal but not solved.

hasanmerkit commented 2 years ago

php flarum info

Flarum core 1.5.0
PHP version: 8.1.9
MySQL version: 5.7.38-cll-lve
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, json, iconv, SPL, pcntl, readline, Reflection, session, standard, mbstring, shmop, SimpleXML, tokenizer, xml, bcmath, dom, fileinfo, gd, gmp, imagick, imap, inotify, intl, exif, mcrypt, mysqli, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, soap, xmlreader, xmlwriter, Zend OPcache
+--------------------------------------+---------+--------+
| Flarum Extensions                    |         |        |
+--------------------------------------+---------+--------+
| ID                                   | Version | Commit |
+--------------------------------------+---------+--------+
| flarum-markdown                      | v1.5.0  |        |
| flarum-tags                          | v1.5.0  |        |
| flarum-flags                         | v1.5.0  |        |
| flarum-subscriptions                 | v1.5.0  |        |
| askvortsov-rich-text                 | v2.1.7  |        |
| fof-discussion-language              | 1.2.7   |        |
| flarum-lock                          | v1.5.0  |        |
| flarum-sticky                        | v1.5.0  |        |
| flarum-likes                         | v1.5.0  |        |
| afrux-forum-widgets-core             | v0.1.7  |        |
| flarum-suspend                       | v1.5.0  |        |
| flarum-approval                      | v1.5.0  |        |
| fof-oauth                            | 1.2.2   |        |
| fof-impersonate                      | 1.1.0   |        |
| fof-follow-tags                      | 1.1.6   |        |
| v17development-blog                  | v0.6.4  |        |
| zerosonesfun-member                  | 1.2     |        |
| zerosonesfun-direct-links            | 3.1     |        |
| zerosonesfun-bbcode-advanced-image   | 0.3     |        |
| v17development-user-badges           | v1.1.0  |        |
| v17development-seo                   | v1.8.0  |        |
| therealsujitk-gifs                   | v4.1.1  |        |
| the-turk-stickiest                   | 2.0.3   |        |
| the-turk-quiet-edits                 | 0.1.3   |        |
| the-turk-flamoji                     | 1.0.4   |        |
| sycho-profile-cover                  | v1.3.3  |        |
| sycho-move-posts                     | v0.1.7  |        |
| nearata-twofactor                    | v2.1.1  |        |
| nearata-no-self-likes                | v1.2.1  |        |
| nearata-copy-code-to-clipboard       | v2.1.0  |        |
| michaelbelgium-discussion-views      | v7.1.3  |        |
| justoverclock-welcomebox             | 1.3.7   |        |
| justoverclock-last-users-posts       | 0.3.0   |        |
| justoverclock-custom-html-widget     | 0.1.4   |        |
| ianm-synopsis                        | 1.2.1   |        |
| ianm-syndication                     | 1.2.2   |        |
| ianm-html-head                       | 1.1.0   |        |
| glowingblue-password-strength        | 3.1.0   |        |
| fof-webhooks                         | 1.1.0   |        |
| fof-user-directory                   | 1.2.3   |        |
| fof-user-bio                         | 1.1.0   |        |
| fof-upload                           | 1.2.3   |        |
| fof-terms                            | 1.2.0   |        |
| fof-subscribed                       | 1.1.2   |        |
| fof-socialprofile                    | 1.1.4   |        |
| fof-sitemap                          | 1.0.3   |        |
| fof-share-social                     | 1.1.0   |        |
| fof-recaptcha                        | 1.1.0   |        |
| fof-reactions                        | 1.1.2   |        |
| fof-polls                            | 1.1.0   |        |
| fof-pages                            | 1.0.4   |        |
| fof-nightmode                        | 1.5.0   |        |
| fof-moderator-notes                  | 1.1.0   |        |
| fof-links                            | 1.1.2   |        |
| fof-linguist                         | 1.0.4   |        |
| fof-ignore-users                     | 1.1.0   |        |
| fof-forum-statistics-widget          | 1.0.2   |        |
| fof-formatting                       | 1.0.2   |        |
| fof-filter                           | 1.1.1   |        |
| fof-drafts                           | 1.1.2   |        |
| fof-disposable-emails                | 1.0.0   |        |
| fof-default-group                    | 1.1.0   |        |
| fof-best-answer                      | 1.2.3   |        |
| fof-bbcode-details                   | 1.1.0   |        |
| fof-analytics                        | 1.1.0   |        |
| flarumtr-mobile-search               | v1.2    |        |
| flarum-statistics                    | v1.5.0  |        |
| flarum-pusher                        | v1.5.0  |        |
| flarum-nicknames                     | v1.5.0  |        |
| flarum-mentions                      | v1.5.0  |        |
| flarum-lang-turkish                  | 1.7.0   |        |
| flarum-lang-english                  | v1.5.0  |        |
| flarum-emoji                         | v1.5.0  |        |
| flarum-bbcode                        | v1.5.0  |        |
| dem13n-topic-starter-label           | 0.1.8   |        |
| dem13n-discussion-cards              | 0.3.8   |        |
| davwheat-custom-sidenav-links        | 1.0.1   |        |
| davwheat-ads                         | 1.2.0   |        |
| datlechin-posted-on                  | v0.1.6  |        |
| datlechin-birthdays                  | v1.2.4  |        |
| darkle-fancybox                      | 1.1.2   |        |
| clarkwinkelmann-username-blacklist   | 1.0.0   |        |
| clarkwinkelmann-passwordless         | 1.4.0   |        |
| clarkwinkelmann-likes-received       | 1.0.2   |        |
| clarkwinkelmann-group-list           | 1.0.0   |        |
| clarkwinkelmann-group-invitation     | 1.0.1   |        |
| clarkwinkelmann-discussion-bookmarks | 2.0.0   |        |
| clarkwinkelmann-create-user-modal    | 1.3.1   |        |
| clarkwinkelmann-circle-groups        | 1.0.1   |        |
| clarkwinkelmann-author-change        | 1.0.2   |        |
| blomstra-no-email-notifications      | 0.1.0   |        |
| askvortsov-pwa                       | v3.1.3  |        |
| askvortsov-moderator-warnings        | v0.6.1  |        |
| askvortsov-markdown-tables           | v1.2.1  |        |
| askvortsov-checklist                 | v1.3.1  |        |
| antoinefr-bbcode-fa                  | v1.0.0  |        |
| afrux-online-users-widget            | v0.1.6  |        |
| afrux-news-widget                    | v0.1.1  |        |
| acpl-my-tags                         | 1.2.0   |        |
| acpl-mobile-tab                      | 1.1.0   |        |
+--------------------------------------+---------+--------+
Base URL: https://www.teteos.net
Installation path: /home/l0f5ug6349xu/public_html
Queue driver: sync
Mail driver: mail
Debug mode: ON

Don't forget to turn off debug mode! It should never be turned on in a production system.
hasanmerkit commented 2 years ago

Downloaded to localhost and enabled php error view. Here is error log:

Warning: Undefined array key "data" in /teteosnet/Apps/Xampp/opt/www/vendor\flarum\core\src\Frontend\Content\CorePayload.php on line 74

Warning: Undefined array key "data" in /teteosnet/Apps/Xampp/opt/www/vendor\flarum\core\src\Frontend\Content\CorePayload.php on line 74

Fatal error: Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Output has been emitted previously; cannot emit response in /teteosnet/Apps/Xampp/opt/www/vendor\laminas\laminas-httphandlerrunner\src\Exception\EmitterException.php:24 Stack trace: #0 /teteosnet/Apps/Xampp/opt/www/vendor\laminas\laminas-httphandlerrunner\src\Emitter\SapiEmitterTrait.php(40): Laminas\HttpHandlerRunner\Exception\EmitterException::forOutputSent() #1 /teteosnet/Apps/Xampp/opt/www/vendor\laminas\laminas-httphandlerrunner\src\Emitter\SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->assertNoPreviousOutput() #2 /teteosnet/Apps/Xampp/opt/www/vendor\laminas\laminas-httphandlerrunner\src\RequestHandlerRunner.php(98): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(Laminas\Diactoros\Response\HtmlResponse)) #3 /teteosnet/Apps/Xampp/opt/www/vendor\flarum\core\src\Http\Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run() #4 /teteosnet/Apps/Xampp/opt/www/index.php(27): Flarum\Http\Server->listen() #5 {main} thrown in /teteosnet/Apps/Xampp/opt/www/vendor\laminas\laminas-httphandlerrunner\src\Exception\EmitterException.php on line 24
hasanmerkit commented 2 years ago

vendor/flarum/core/src/Frontend/Content/CorePayload.php -> line 72-81:

    private function getDataFromApiDocument(array $apiDocument): array
    {
        $data[] = $apiDocument['data'];

        if (isset($apiDocument['included'])) {
            $data = array_merge($data, $apiDocument['included']);
        }

        return $data;
    }
luceos commented 2 years ago

This usually implies there's an error with the api, can you open https://www.teteos.net/api/discussions when it's enabled? Perhaps it gives a better error, otherwise check your storage/logs for a recent error.

hasanmerkit commented 2 years ago

Bu genellikle api ile ilgili bir hata olduğu anlamına gelir, etkinleştirildiğinde https://www.teteos.net/api/discussions'ı açabilir misiniz ? Belki daha iyi bir hata verir, aksi takdirde storage/logsyeni bir hata olup olmadığını kontrol edin.

flarum-2022-09-18.log

hasanmerkit commented 2 years ago

Okey, i think its about missing database tables. But why Flarum or Extension not created this tables idk :( Now i try with clean Flarum copy to see what happening.

jaspervriends commented 2 years ago

That's weird. Have you tried running the migration command? Seems that on your localhost the migrations were not executed. Is this also the case on production?

hasanmerkit commented 2 years ago

php flarum migrate

Migrating Flarum...
Nothing to migrate.
Migrating extension: flarum-markdown
Nothing to migrate.
Migrating extension: flarum-tags
Nothing to migrate.
Migrating extension: flarum-flags
Nothing to migrate.
Migrating extension: flarum-subscriptions
Nothing to migrate.
Migrating extension: fof-discussion-language
Nothing to migrate.
Migrating extension: flarum-lock
Nothing to migrate.
Migrating extension: flarum-approval
Nothing to migrate.
Migrating extension: flarum-sticky
Nothing to migrate.
Migrating extension: flarum-likes
Nothing to migrate.
Migrating extension: flarum-suspend
Nothing to migrate.
Migrating extension: fof-oauth
Nothing to migrate.
Migrating extension: fof-impersonate
Nothing to migrate.
Migrating extension: fof-follow-tags
Nothing to migrate.
Migrating extension: v17development-blog
Nothing to migrate.
Migrating extension: v17development-user-badges
Nothing to migrate.
Migrating extension: v17development-support
Nothing to migrate.
Migrating extension: therealsujitk-gifs
Nothing to migrate.
Migrating extension: the-turk-stickiest
Nothing to migrate.
Migrating extension: the-turk-quiet-edits
Nothing to migrate.
Migrating extension: the-turk-flamoji
Nothing to migrate.
Migrating extension: sycho-profile-cover
Nothing to migrate.
Migrating extension: sycho-move-posts
Nothing to migrate.
Migrating extension: nearata-twofactor
Nothing to migrate.
Migrating extension: michaelbelgium-discussion-views
Nothing to migrate.
Migrating extension: ianm-synopsis
Nothing to migrate.
Migrating extension: ianm-html-head
Nothing to migrate.
Migrating extension: glowingblue-password-strength
Nothing to migrate.
Migrating extension: fof-webhooks
Nothing to migrate.
Migrating extension: fof-user-directory
Nothing to migrate.
Migrating extension: fof-user-bio
Nothing to migrate.
Migrating extension: fof-upload
Nothing to migrate.
Migrating extension: fof-terms
Nothing to migrate.
Migrating extension: fof-socialprofile
Nothing to migrate.
Migrating extension: fof-sitemap
Nothing to migrate.
Migrating extension: fof-share-social
Nothing to migrate.
Migrating extension: fof-recaptcha
Nothing to migrate.
Migrating extension: fof-reactions
Nothing to migrate.
Migrating extension: fof-polls
Nothing to migrate.
Migrating extension: fof-pages
Nothing to migrate.
Migrating extension: fof-nightmode
Nothing to migrate.
Migrating extension: fof-moderator-notes
Nothing to migrate.
Migrating extension: fof-links
Nothing to migrate.
Migrating extension: fof-linguist
Nothing to migrate.
Migrating extension: fof-ignore-users
Nothing to migrate.
Migrating extension: fof-forum-statistics-widget
Nothing to migrate.
Migrating extension: fof-filter
Nothing to migrate.
Migrating extension: fof-drafts
Nothing to migrate.
Migrating extension: fof-best-answer
Nothing to migrate.
Migrating extension: fof-analytics
Nothing to migrate.
Migrating extension: flarum-nicknames
Nothing to migrate.
Migrating extension: flarum-mentions
Nothing to migrate.
Migrating extension: flarum-emoji
Nothing to migrate.
Migrating extension: dem13n-discussion-cards
Nothing to migrate.
Migrating extension: davwheat-custom-sidenav-links
Nothing to migrate.
Migrating extension: davwheat-ads
Nothing to migrate.
Migrating extension: datlechin-posted-on
Nothing to migrate.
Migrating extension: datlechin-birthdays
Nothing to migrate.
Migrating extension: clarkwinkelmann-passwordless
Nothing to migrate.
Migrating extension: clarkwinkelmann-likes-received
Nothing to migrate.
Migrating extension: clarkwinkelmann-group-list
Nothing to migrate.
Migrating extension: clarkwinkelmann-group-invitation
Nothing to migrate.
Migrating extension: clarkwinkelmann-discussion-bookmarks
Nothing to migrate.
Migrating extension: askvortsov-pwa
Nothing to migrate.
Migrating extension: askvortsov-moderator-warnings
Nothing to migrate.
Migrating extension: askvortsov-checklist
Nothing to migrate.
Migrating extension: afrux-online-users-widget
Nothing to migrate.
DONE.
hasanmerkit commented 2 years ago

Before subscribe to extension, i created a database backup and i found already have "v17development-support" string in file:

(280, '2021_08_12_000000_add_default_permissions', 'fof-socialprofile'),
(281, '2020_06_05_15_43_create_support_rating', 'v17development-support'),
(282, '2020_06_06_15_25_add_default_permissions', 'v17development-support'),
(283, '2020_06_07_14_35_add_viewArticleAuditLogs_permission', 'v17development-support'),
(284, '2020_06_19_13_46_drop_support_rating_foreign', 'v17development-support'),
(285, '2020_06_19_13_50_add_support_rating_foreign_keys', 'v17development-support'),
(286, '2020_07_07_17_53_add_deleteRatings_permission', 'v17development-support'),
(287, '2020_07_25_13_06_create_support_tickets', 'v17development-support'),
(288, '2020_07_26_12_41_create_support_ticket_assignees', 'v17development-support'),
(289, '2020_07_26_16_14_create_support_ticket_reply_templates', 'v17development-support'),
(290, '2020_07_26_16_50_create_support_ticket_languages', 'v17development-support'),
(291, '2020_08_24_20_11_add_read_tickets_at_to_users_table', 'v17development-support'),
(292, '2020_08_30_00_26_add_ticket_permissions', 'v17development-support'),
(293, '2020_08_31_19_01_add_support_ticket_language_to_tickets_table', 'v17development-support'),
(294, '2021_02_21_20_30_add_ticket_reminded_columns', 'v17development-support'),
(295, '2021_04_10_16_54_add_convert_to_ticket_permission', 'v17development-support'),
(296, '2020_12_24_create_webhooks_table', 'fof-webhooks'),

But support_* tables does not exists. May be manually removed tables having this bug?

hasanmerkit commented 2 years ago

I added manually this tables with Notepad++ (clean_install.sql to my_backup.sql) Now works :) Thanks for help https://cdn.discordapp.com/attachments/952635535422292028/1021174658168520824/unknown.png

jaspervriends commented 2 years ago

Yes I do think so. In that case it's not a bug. The migrations think they already ran and won't execute these migrations.

What you should do is only remove the rows from the v17development-support extension in your migration table (expecting none of the migrations did run and all columns/tables were removed properly earlier). This way you let the migration command know that these migrations have not yet ran in your database.

If you now run the migration command, it should fix the missing tables.

jaspervriends commented 2 years ago

Now works :)

Awesome, glad it's working now! I'll close this issue ✅