Cannot declare class FieldsPlugin, because the name is already in use Topic is solved

Need help upgrading your Joomla! website or converting to Joomla! 4.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 12:33 am

It's been some time since I posted in the forum, but this one has me stumped. I am getting the same error both on my web host (siteground) and locally using MAMP on my Mac. I have got to the point where I have removed every extension that I have installed (like YooTheme) and stripped the site back to nothing but the content and one site and one admin template...but the same error persists at about 90.3% progress on the update.

The error is (I've changed the domain name)...
FatalError
HTTP 500 Whoops, looks like something went wrong.
Compile Error: Cannot declare class FieldsPlugin, because the name is already in use
Exception Stack Trace
Symfony\Component\ErrorHandler\Error\
FatalError
in /home/customer/www/domainremoved.com/public_html/j4test/administrator/components/com_fields/libraries/fieldsplugin.php (line 1)
<?php/** * @package Joomla.Administrator * @subpackage com_fields *
I've tried replacing that file with a fresh version and it has no impact.

Here's the FPA information I created before I tried the migration and got the error above...
Forum Post Assistant (v1.6.5) : 28-Jan-2022 wrote:
Basic Environment :: wrote:Joomla! Instance :: Joomla! 3.10.5-Stable (Daraja) 15-January-2022
Joomla! Platform :: Joomla Platform 13.1.0-Stable (Curiosity) 24-Apr-2013
Joomla! Configured :: Yes | Writable (644) |
Configuration Options :: Offline: false | SEF: true | SEF Suffix: true | SEF ReWrite: true | .htaccess/web.config: Yes | GZip: true | Cache: true | CacheTime: 15 | CacheHandler: memcached | CachePlatformPrefix: false | FTP Layer: false | Proxy: false | LiveSite: Is Not Empty | Session lifetime: 15 | Session handler: database | Shared sessions: false | SSL: 2 | Error Reporting: maximum | Site Debug: false | Language Debug: false | Default Access: Public | Unicode Slugs: false | dbConnection Type: mysqli | PHP Supports J! 3.10.5: Yes | Database Supports J! 3.10.5: Yes | Database Credentials Present: Yes |

Host Configuration :: OS: Linux | OS Version: 3.12.18-clouder0 | Technology: x86_64 | Web Server: Apache | Encoding: | System TMP Writable: Yes | Free Disk Space : 439.70 GiB |

PHP Configuration :: Version: 8.0.15 | PHP API: cgi-fcgi | Session Path Writable: Yes | Display Errors: 0 | Error Reporting: 30709 | Log Errors To: php_errorlog | Last Known Error: | Register Globals: | Magic Quotes: | Safe Mode: | Allow url fopen: 1 | Open Base: | Uploads: 1 | Max. Upload Size: 256M | Max. POST Size: 256M | Max. Input Time: 120 | Max. Execution Time: 120 | Memory Limit: 768M

Database Configuration :: Version: 5.7.32-35-log (Client:mysqlnd 8.0.15) | Database Size: 5.66 MiB | #of Tables with config prefix:  80 | #of other Tables:  0 | User Privileges : GRANT ALL
Detailed Environment :: wrote:PHP Extensions :: Core (8.0.15) | date (8.0.15) | libxml (8.0.15) | openssl (8.0.15) | pcre (8.0.15) | sqlite3 (8.0.15) | zlib (8.0.15) | bcmath (8.0.15) | bz2 (8.0.15) | calendar (8.0.15) | ctype (8.0.15) | curl (8.0.15) | dba (8.0.15) | dom (20031129) | enchant (8.0.15) | hash (8.0.15) | fileinfo (8.0.15) | filter (8.0.15) | ftp (8.0.15) | gd (8.0.15) | gettext (8.0.15) | gmp (8.0.15) | SPL (8.0.15) | iconv (8.0.15) | session (8.0.15) | intl (8.0.15) | json (8.0.15) | mbstring (8.0.15) | standard (8.0.15) | mysqlnd (mysqlnd 8.0.15) | pcntl (8.0.15) | mysqli (8.0.15) | PDO (8.0.15) | pdo_mysql (8.0.15) | pdo_pgsql (8.0.15) | pdo_sqlite (8.0.15) | pgsql (8.0.15) | Phar (8.0.15) | posix (8.0.15) | pspell (8.0.15) | readline (8.0.15) | Reflection (8.0.15) | imap (8.0.15) | shmop (8.0.15) | SimpleXML (8.0.15) | soap (8.0.15) | sockets (8.0.15) | sodium (8.0.15) | exif (8.0.15) | sysvmsg (8.0.15) | sysvsem (8.0.15) | tidy (8.0.15) | tokenizer (8.0.15) | xml (8.0.15) | xmlreader (8.0.15) | xmlwriter (8.0.15) | xsl (8.0.15) | zip (1.19.5) | cgi-fcgi (8.0.15) | memcached (3.1.5) | Zend OPcache (8.0.15) | Zend Engine (4.0.15-dev) |
Potential Missing Extensions ::

Switch User Environment :: PHP CGI: Yes | Server SU: Yes | PHP SU: Yes | Potential Ownership Issues: No
Folder Permissions :: wrote:Core Folders :: images/ (755) | components/ (755) | modules/ (755) | plugins/ (755) | language/ (755) | templates/ (755) | cache/ (755) | logs/ (---) | tmp/ (755) | administrator/components/ (755) | administrator/modules/ (755) | administrator/language/ (755) | administrator/templates/ (755) | administrator/logs/ (755) |

Elevated Permissions (First 10) ::
Database Information :: wrote:Database statistics :: Uptime: 105442 | Threads: 6 | Questions: 82967064 | Slow queries: 258 | Opens: 9573293 | Flush tables: 1 | Open tables: 3072 | Queries per second avg: 786.850 |
Extensions Discovered :: wrote:Components :: Site ::
Core :: com_mailto (3.0.0) 1 | com_wrapper (3.0.0) 1 |
3rd Party::

Components :: Admin ::
Core :: com_cache (3.0.0) 1 | com_redirect (3.0.0) 1 | com_menus (3.0.0) 1 | com_admin (3.0.0) 1 | com_tags (3.1.0) 1 | com_messages (3.0.0) 1 | com_cpanel (3.0.0) 1 | com_joomlaupdate (3.10.1) 1 | com_languages (3.0.0) 1 | com_categories (3.0.0) 1 | com_ajax (3.2.0) 1 | com_actionlogs (3.9.0) 1 | com_login (3.0.0) 1 | com_banners (3.0.0) 1 | com_finder (3.0.0) 1 | com_newsfeeds (3.0.0) 1 | com_search (3.0.0) 1 | com_checkin (3.0.0) 1 | com_associations (3.7.0) 1 | com_fields (3.7.0) 1 | com_plugins (3.0.0) 1 | com_contenthistory (3.2.0) 1 | com_users (3.0.0) 1 | com_content (3.0.0) 1 | com_postinstall (3.2.0) 1 | com_privacy (3.9.0) 1 | com_templates (3.0.0) 1 | com_installer (3.0.0) 1 | com_media (3.0.0) 1 | com_modules (3.0.0) 1 | com_config (3.0.0) 1 |
3rd Party::

Modules :: Site ::
Core :: mod_whosonline (3.0.0) 1 | mod_related_items (3.0.0) 1 | mod_search (3.0.0) 1 | mod_custom (3.0.0) 1 | mod_articles_news (3.0.0) 1 | mod_tags_popular (3.1.0) 1 | mod_finder (3.0.0) 1 | mod_articles_categories (3.0.0) 1 | mod_syndicate (3.0.0) 1 | mod_articles_latest (3.0.0) 1 | mod_feed (3.0.0) 1 | mod_articles_archive (3.0.0) 1 | mod_menu (3.0.0) 1 | mod_articles_category (3.0.0) 1 | mod_stats (3.0.0) 1 | mod_footer (3.0.0) 1 | mod_breadcrumbs (3.0.0) 1 | mod_banners (3.0.0) 1 | mod_languages (3.5.0) 1 | mod_login (3.0.0) 1 | mod_tags_similar (3.1.0) 1 | mod_users_latest (3.0.0) 1 | mod_wrapper (3.0.0) 1 | mod_random_image (3.0.0) 1 | mod_articles_popular (3.0.0) 1 |
3rd Party::

Modules :: Admin ::
Core :: mod_multilangstatus (3.0.0) 1 | mod_status (3.0.0) 1 | mod_custom (3.0.0) 1 | mod_stats_admin (3.0.0) 1 | mod_version (3.0.0) 1 | mod_feed (3.0.0) 1 | mod_popular (3.0.0) 1 | mod_menu (3.0.0) 1 | mod_quickicon (3.0.0) 1 | mod_latest (3.0.0) 1 | mod_logged (3.0.0) 1 | mod_privacy_dashboard (3.9.0) 1 | mod_latestactions (3.9.0) 1 | mod_toolbar (3.0.0) 1 | mod_login (3.0.0) 1 | mod_submenu (3.0.0) 1 | mod_title (3.0.0) 1 | mod_sampledata (3.8.0) 1 |
3rd Party::

Libraries ::
Core ::
3rd Party:: file_fof40 (4.1.1) ? |

Plugins ::
Core :: plg_content_vote (3.0.0) 1 | plg_content_loadmodule (3.0.0) 1 | plg_content_emailcloak (3.0.0) 1 | plg_content_fields (3.7.0) 1 | plg_content_joomla (3.0.0) 1 | plg_content_pagebreak (3.0.0) 1 | plg_content_finder (3.0.0) 1 | plg_privacy_content (3.9.0) 1 | plg_privacy_consents (3.9.0) 1 | plg_privacy_actionlogs (3.9.0) 1 | plg_privacy_message (3.9.0) 1 | plg_privacy_user (3.9.0) 1 | plg_quickicon_extensionupdate (3.0.0) 1 | plg_quickicon_phpversioncheck (3.7.0) 1 | plg_quickicon_privacycheck (3.9.0) 1 | plg_quickicon_eos310 (3.10.0) 1 | plg_quickicon_joomlaupdate (3.0.0) 1 | plg_system_redirect (3.0.0) 1 | plg_system_log (3.0.0) 1 | plg_system_sessiongc (3.8.6) 1 | plg_system_p3p (3.0.0) 1 | plg_system_fields (3.7.0) 1 | plg_system_stats (3.5.0) 1 | plg_system_cache (3.0.0) 0 | plg_system_sef (3.0.0) 1 | plg_system_updatenotification (3.5.0) 1 | plg_system_remember (3.0.0) 1 | plg_system_logout (3.0.0) 1 | plg_system_languagefilter (3.0.0) 0 | plg_system_logrotation (3.9.0) 1 | plg_system_highlight (3.0.0) 1 | plg_editors-xtd_article (3.0.0) 1 | plg_editors-xtd_image (3.0.0) 1 | plg_editors-xtd_fields (3.7.0) 1 | plg_editors-xtd_pagebreak (3.0.0) 1 | plg_editors-xtd_readmore (3.0.0) 1 | plg_editors-xtd_module (3.5.0) 1 | plg_editors-xtd_menu (3.7.0) 1 | plg_captcha_recaptcha (3.4.0) 1 | plg_fields_calendar (3.7.0) 1 | plg_fields_sql (3.7.0) 1 | plg_fields_imagelist (3.7.0) 1 | plg_fields_color (3.7.0) 1 | plg_fields_integer (3.7.0) 1 | plg_fields_text (3.7.0) 1 | plg_fields_usergrouplist (3.7.0) 1 | plg_fields_media (3.7.0) 1 | plg_fields_url (3.7.0) 1 | plg_fields_checkboxes (3.7.0) 1 | plg_fields_repeatable (3.9.0) 1 | plg_fields_radio (3.7.0) 1 | plg_fields_textarea (3.7.0) 1 | plg_fields_list (3.7.0) 1 | plg_fields_user (3.7.0) 1 | plg_fields_editor (3.7.0) 1 | PLG_ACTIONLOG_JOOMLA (3.9.0) 1 | plg_extension_joomla (3.0.0) 1 | plg_installer_packageinstaller (3.6.0) 1 | PLG_INSTALLER_FOLDERINSTALLER (3.6.0) 1 | plg_installer_webinstaller (2.1.2) 1 | PLG_INSTALLER_URLINSTALLER (3.6.0) 1 | plg_finder_content (3.0.0) 1 | plg_authentication_cookie (3.0.0) 1 | plg_authentication_joomla (3.0.0) 1 | plg_user_joomla (3.0.0) 1 |
3rd Party:: plg_editors_tinymce (4.5.12) 1 | plg_editors_codemirror (5.60.0) 1 |
Templates Discovered :: wrote:Templates :: Site :: beez3 (3.1.0) 1 |
Templates :: Admin :: isis (1.0) 1 |

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17445
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by toivo » Fri Jan 28, 2022 1:12 am

phil_roy wrote:
Fri Jan 28, 2022 12:33 am
Compile Error: Cannot declare class FieldsPlugin, because the name is already in use
There must be some files left over from third party extensions or Joomla versions somewhere in the filesystem because both versions of Joomla declare the class FieldsPlugin only once:

Joomla 3.10.5 in administrator/components/com_fields/libraries/fieldsplugin.php, and
Joomla 4.0.6 in administrator/components/com_fields/src/plugin/FieldsPlugin.php

After you first tried to run the update to Joomla 4 and the update failed, did you then clean the main Joomla folder and restore of a backup of the Joomla 3.10.5 site, before attempting to rerun the update?
Toivo Talikka, Global Moderator

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 1:27 am

Yes...I always zip the site and do a backup of the database before I try an update. When it fails, I restore both.

Given that I have uninstalled virtually everything not core-Joomla, I suppose I could try deleting all the Joomla files and dropping in a clean 3.10.5 set of files and see what happens. I have noticed some odd folders around, such as "/libraries/fof30/" and "/libraries/fof40/" which don't come with 3.10.5 but were from Akeeba (I think) at some point).

This site has been around for ages, so there is every chance that there are stray files and folders from the past. I'll give it a go, thanks.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 1:56 am

OK...I went into the folder on the server and I deleted everything...with the exception of the following...

* images folder (I needed to retain my images for my site)
* .htaccess file (this is set up for the folder concerned)
* configuration.php (need this as it has the settings for the existing site)
* favicon.ico (simple enough)
* htaccess.txt (a copy of what is in the .htaccess file

I then downloaded a copy of Joomla 3.10.5 and uploaded everything, with the exception of the installation folder. I logged in and check the site was functional...yep.

So basically I now had a site of entirely new/clean files, with the exceptions of the ones listed above.

The update failed with exactly the same error as before.

I'm stumped. I should point out that the timing for it is always the same...both on my server and locally...the progress bar gets to 90.3%...pauses and then there is the failure. I know that means little...I'm just trying to point out that there is amazing consistency in when and what the error is...even with a clean set of files.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17445
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by toivo » Fri Jan 28, 2022 3:20 am

phil_roy wrote:
Fri Jan 28, 2022 1:56 am
I then downloaded a copy of Joomla 3.10.5 and uploaded everything, with the exception of the installation folder. I logged in and check the site was functional...yep.
So the 3.10.5 site did not go through the installation but was using the previous 3.10.5 database?

Repeat the procedure but this time change the level of error reporting in configuration.php to 'maximum' and turn on the option $debug.

If the installation of Joomla 3.10.5 were to fail out-of-the-box, this forum would be awash of topics about it...
Toivo Talikka, Global Moderator

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 4:23 am

So the 3.10.5 site did not go through the installation but was using the previous 3.10.5 database?
Yes.

I have just been playing around and tried something new...this time instead of using the "Live Update" option...I decided to try the "Upload & Update" option....and it got to about 90.8% and then I got a modal alert in my browser window that said...
ERROR:
AJAX Loading Error: Internal Server Error
Thinking it might be specific to a browser, I tried the whole process with both Safari and Firefox and got the same result.

I'll go back and try your suggestion next, thanks.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 4:59 am

So I'm not exactly sure what I am meant to do now...the reason being that when the error occurs, I'm effectively kicked out of the Joomla admin backend, in to what looks like a server error page...an HTTP 500 page...so I don't see the debug results that Joomla would display.

I do note that the error at the top of the page is a slight variation and says...
Fatal error: Cannot declare class FieldsPlugin, because the name is already in use in /home/customer/www/domainremoved.com/public_html/mysite/administrator/components/com_fields/libraries/fieldsplugin.php on line 0
Screen Shot 2022-01-26 at 11.41.20 AM.png
You do not have the required permissions to view the files attached to this post.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17445
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by toivo » Fri Jan 28, 2022 5:18 am

Click the tab Stack Trace and copy and paste the contents here so that we can see where the error originates from, where the second declaration of the class FieldsPlugin resides.
Toivo Talikka, Global Moderator

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 5:43 am

Attached.
Screen Shot 2022-01-28 at 5.55.08 PM.png
You do not have the required permissions to view the files attached to this post.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17445
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by toivo » Fri Jan 28, 2022 6:21 am

Go the Extensions - Plugins and locate the plugin System - Debug. Make sure first it has been enabled. Add your group, Super Users, to 'Allowed Groups' and then go to the tab 'Logging' and select 'Log Almost Everything'. Other options may be selectively turned off to reduce the size of the log file.

The stack trace should now have more information. If that does not happen, download the log file administrator/logs/everything.php and copy and paste the relevant messages here.
Toivo Talikka, Global Moderator

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Jan 28, 2022 9:50 pm

Updated to fix typo

So again, I deleted all the Joomla files except images, config, etc and uploaded new Joomla 3 files. I did make the decision to install the extensions I use (as having them uninstalled hasn't made any difference). I did then uninstall OSMap when the Joomla update said it was an issue.

The update failed at the same spot. The stack trace was exactly the same. Here's the file contents of "everything.php" which to me, looks like it doesn't really give any clues as it has no entries after the update starts?
#
#<?php die('Forbidden.'); ?>
#Date: 2022-01-28 21:41:47 UTC
#Software: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

#Fields: datetime priority clientip category message
2022-01-28T21:41:47+00:00 INFO 203.211.110.196 updater Loading information from update site #1 with name "Joomla! Core" and URL https://update.joomla.org/core/sts/list_sts.xml took 0.03 seconds
2022-01-28T21:41:47+00:00 INFO 203.211.110.196 updater Loading information from update site #3 with name "Accredited Joomla! Translations" and URL https://update.joomla.org/language/tran ... list_3.xml took 0.03 seconds
2022-01-28T21:41:47+00:00 INFO 203.211.110.196 updater Loading information from update site #4 with name "Joomla! Update Component Update Site" and URL https://update.joomla.org/core/extensio ... update.xml took 0.02 seconds
2022-01-28T21:41:47+00:00 INFO 203.211.110.196 updater Loading information from update site #5 with name "WebInstaller Update Site" and URL http://appscdn.joomla.org/webapps/jedap ... taller.xml took 0.29 seconds
2022-01-28T21:41:49+00:00 INFO 203.211.110.196 updater Loading information from update site #67 with name "Regular Labs - Cache Cleaner" and URL https://download.regularlabs.com/update ... &type=.xml took 1.26 seconds
2022-01-28T21:41:49+00:00 INFO 203.211.110.196 updater Loading information from update site #124 with name "WebInstaller Update Site" and URL https://appscdn.joomla.org/webapps/jeda ... taller.xml took 0.02 seconds
2022-01-28T21:41:50+00:00 INFO 203.211.110.196 updater Loading information from update site #199 with name "YOOtheme" and URL https://yootheme.com/api/update/yootheme_j33.xml took 0.94 seconds
2022-01-28T21:41:51+00:00 INFO 203.211.110.196 updater Loading information from update site #201 with name "moreJoomla" and URL https://morejoomla.com/updates/mod_more ... me_pro.xml took 0.80 seconds
2022-01-28T21:41:52+00:00 INFO 203.211.110.196 updater Loading information from update site #209 with name "YOOtheme Installer" and URL http://yootheme.com/api/update/installe ... me_j33.xml took 1.51 seconds
2022-01-28T21:41:53+00:00 INFO 203.211.110.196 updater Loading information from update site #220 with name "Regular Labs Library" and URL https://download.regularlabs.com/update ... &type=.xml took 1.14 seconds
2022-01-28T21:41:54+00:00 INFO 203.211.110.196 updater Loading information from update site #243 with name "YOOtheme Installer" and URL https://yootheme.com/api/update/install ... me_j33.xml took 0.92 seconds
2022-01-28T21:41:55+00:00 INFO 203.211.110.196 updater Loading information from update site #244 with name "Joomlashack Framework" and URL https://deploy.ostraining.com/client/up ... aframework took 1.08 seconds
2022-01-28T21:41:56+00:00 INFO 203.211.110.196 updater Loading information from update site #245 with name "Joomlashack Extension Support" and URL https://deploy.ostraining.com/client/up ... sesmanager took 0.95 seconds
2022-01-28T21:41:58+00:00 INFO 203.211.110.196 updater Loading information from update site #4 with name "Joomla! Update Component Update Site" and URL https://update.joomla.org/core/extensio ... update.xml took 0.74 seconds
2022-01-28T21:42:22+00:00 INFO 203.211.110.196 update Update started by user Philip Roy (340). Old version is 3.10.5.
2022-01-28T21:42:25+00:00 INFO 203.211.110.196 update Downloading update file from https://downloads.joomla.org/cms/joomla ... ackage.zip.
2022-01-28T21:42:29+00:00 INFO 203.211.110.196 update File Joomla_4.0.6-Stable-Update_Package.zip downloaded.
2022-01-28T21:42:30+00:00 INFO 203.211.110.196 update Starting installation of new version.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 1:22 am

Ok the plot thickens....but also gets more confusing.

I decided the best way to test upgrading was with the cleanest of clean Joomla installs, powered by Siteground's own "app installer" contained within their site tools (aka, CPanel). So I installed a brand new version of Joomla using their installer. It installed 3.10.3, which I then updated to 3.10.5.

I opted not to install sample content....so this site was virtually empty.

I used the approach of uploading the Joomla 4.0.6-Stable-Full_Package zip and the updating process failed as before. To me this clearly indicates that it's not me...it's possibly a Siteground issue? I'm going to contact them and point them to this thread.

The one weird thing about this....why is it also failing when I try locally on my Mac using MAMP?

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 1:50 am

Comment from Siteground during our chat session...
There isn't really anything special in Site Tools that can prevent the update from happening, it is all a matter of configuration. I see that the update also has failed on your local environment, which suggest that the issue is not server related. There is also nothing on the server that can prevent the update from happening as long as it is done correct. The error is occurring due to some conflict and it will be necessary to troubleshoot it on application level. Such matters however are development related and as our main expertise is in hosting / server related matters, such tasks fall beyond the scope of our support.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17445
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by toivo » Mon Jan 31, 2022 2:20 am

phil_roy wrote:
Mon Jan 31, 2022 1:22 am
I used the approach of uploading the Joomla 4.0.6-Stable-Full_Package zip and the updating process failed as before.
Please explain what was done, when you say 'uploading'.

Did you go to Components - Joomla! Update, then to the tab 'Live Update'?

Or did you download the Joomla Upgrade Package to your workstation and then went to Components - Joomla! Update and the tab 'Upload & Update', locate the file in your workstation, select the 'Installation method' as 'Write files directly' and click 'Upload & Install'?

phil_roy wrote:
Mon Jan 31, 2022 1:22 am
To me this clearly indicates that it's not me...it's possibly a Siteground issue?
If your Joomla 3.10.5 was installed from a package prepared by Siteground, rather than downloading packages from the official Joomla download site, https://downloads.joomla.org, there is a good chance that some odd leftovers are causing the issue. For example, libraries/fof is the only folder that comes with the standard Joomla 3.10.5. The other fof folders are left over from third party extensions.
Toivo Talikka, Global Moderator

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 2:31 am

Did you go to Components - Joomla! Update, then to the tab 'Live Update'?
No, I did the upload and install from a zipped version on my Mac.
If your Joomla 3.10.5 was installed from a package prepared by Siteground
It wasn't. It was done via the approach you mention of downloading from Joomla and doing a 'manual' install by me a long time ago. I'm not a fan of using hosting company scripts.

It's just today I thought "well maybe it's me clearly doing something wrong" and installed (via Siteground's tools) a brand new version of Joomla in a sub-directory using their automated script. That process created the database and the database user...so everything was new and clean. I then updated from 3.10.3 to 3.10.5 via the live update. I then tried to update to J4 by uploading the full package from my Mac. Trying to update this failed.

I have now uninstalled the version in the sub-folder that Siteground scripts created.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 2:39 am

Sorry this bit is bugging me also, as it's weird. I've touched on it previously but I want to emphasise is. The error using Live Update versus the error using the upload and update approach, is different.

With the Live Update approach, the progress bar stalls at about 90.3% (although it might be 90.8% if I pay attention, and then you are redirected to a 500 error page that I have included in text and mages before.

With the upload and update...it stalls at exactly 90.8% and a modal window appears on your browser (have tested both Safari and Firefox) with the Ajax error I have described previously. When you dismiss this, the progress bar just stays at 90.8% and goes no further.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2678
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by ceford » Mon Jan 31, 2022 8:17 am

I have been contributing to a problem on another thread, yet to be solved, and can offer the following observations here:

1. The green progress bar is created by the Joomla 3 code.
2. After completion there is log file name joomla_update.php - after Starting installation of new version. it contains a long list of queries. Then a few finalisation lines. These lines are coming from the update script.

And I just found this in administrator/components/com_admin/script.php starting on line 94 (J3):

Code: Select all

		// Uninstall plugins before removing their files and folders
		$this->uninstallRepeatableFieldsPlugin();
		$this->uninstallEosPlugin();
In the other problem a J3 screen reports an error in the url bar but reload gives the normal J4 atum template apparently working normally. The other thread is a long read and probably won't tell you anything:
viewtopic.php?f=808&t=991482&e=1&view=unread#unread
The problem there may be related to litespeed or to mysql connection problems.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 10:38 am

Thanks. I read the other forum post but it doesn’t tell me anything other than someone else is having issues.

When my update fails, refreshing the browsers takes you in to a J4 environment that has clearly failed. The admin template is not displayed correctly and (from memory as I haven’t refreshed the browser in a while) there are warnings about the database.

stevezuks
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jan 31, 2022 11:33 am

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by stevezuks » Mon Jan 31, 2022 12:16 pm

Clear browser cache it might be a browser specific problem

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2678
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by ceford » Mon Jan 31, 2022 12:22 pm

Immediately after the upgrade fail what does your server error log say? You could start on your Mac with something like this:

tail /usr/local/var/log/httpd/error_log

OR

tail -50 /usr/local/var/log/httpd/error_log

-50 means 50 lines from end

Look for a series of lines beginning with one containing "Stack trace"

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 6:41 pm

stevezuks wrote:
Mon Jan 31, 2022 12:16 pm
Clear browser cache it might be a browser specific problem
It fails on two different browsers, one of which (Firefox) has the cache disabled and set to clear on shut down, so I doubt it, but I’ll try.
Last edited by phil_roy on Mon Jan 31, 2022 7:23 pm, edited 1 time in total.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 6:42 pm

ceford wrote:
Mon Jan 31, 2022 12:22 pm
Immediately after the upgrade fail what does your server error log say? You could start on your Mac with something like this:

tail /usr/local/var/log/httpd/error_log

OR

tail -50 /usr/local/var/log/httpd/error_log

-50 means 50 lines from end

Look for a series of lines beginning with one containing "Stack trace"
Will be offline for 48 hours without my Mac but I’ll give it a go and let you know, thanks.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Mon Jan 31, 2022 9:10 pm

Ok this one might seem a bit silly...but it popped into my head last night. I wondered if I tried to reduce any processing on the server that might not be needed, maybe it would help...things like turning off Gzip compression. Again, purely a guess. I also wondered about my browser and the extensions I had installed.

So just before I head off for 48 hours, here's one I tried (and again, same failure)...

* Turned off all SEO settings
* Cache handler = file
* Gzip compression off

Site ground
* Flushed dynamic and memcached cache on the Siteground server for my account

Safari
* Disabled all extensions
* Cleared cache
* Quit

Restarted Safari
* Logged in to Joomla and tried to apply Live Update

As mentioned, it failed. Will try the suggestion re server error logs in about 48 hours.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Thu Feb 03, 2022 12:23 am

OK, so I decided to do this locally on my Mac using MAMP.

After making sure that the site was all set up and ready to use the Live Update feature, I quit everything and went into the /Applications/MAMP/logs folder and deleted all error logs...I wanted to make sure the logs reflected only what was happening with this attempt.

@ceford I navigated to /usr/local/var/log/ and there is no folder called httpd on my Mac? I'm assuming this is because I am using MAMP?

I then started MAMP up and logged into the local site and tried the "Live Update" feature with debug on and error reporting set to maximum. The stack trace was exactly the same as before when the error occurred....and then I went and looked at the php_error.log file...it also says the same thing...
[02-Feb-2022 23:48:07 UTC] PHP Fatal error: Cannot declare class FieldsPlugin, because the name is already in use in /Applications/MAMP/htdocs/j4test/administrator/components/com_fields/libraries/fieldsplugin.php on line 16
the apache_error.log said the following after I had failed and quit...
[Thu Feb 03 12:46:51.681709 2022] [:notice] [pid 6256] FastCGI: process manager initialized (pid 6256)
[Thu Feb 03 12:46:51.687471 2022] [mpm_prefork:notice] [pid 6253] AH00163: Apache/2.4.46 (Unix) OpenSSL/1.0.2u PHP/8.0.8 mod_wsgi/3.5 Python/2.7.13 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1 configured -- resuming normal operations
[Thu Feb 03 12:46:51.687741 2022] [core:notice] [pid 6253] AH00094: Command line: '/Applications/MAMP/Library/bin/httpd'
[Thu Feb 03 12:48:37.332720 2022] [mpm_prefork:notice] [pid 6253] AH00169: caught SIGTERM, shutting down
mysql_error.log was blank. There were no other log files.

I really appreciate everything that people are offering as suggestions to fix the issue, but at the moment...I remain stumped as the error is the same over and over again. If I'm looking in the wrong place locally when using MAMP, please let me know.

At the moment I am looking at an alternate approach. I've been given alpha testing access to this...

https://www.eshiol.it/joomla/j2xml/j2xml-3-9.html

I'd really like to get the standard update process to work, but I've tried so many times now (and failed) I think I may have to try something else.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Thu Feb 17, 2022 2:02 am

OK, so bizarrely, despite errors, I seem to have managed to migrate to Joomla 4...although there is still an issue. I thought I would come back here and post just to explain what I have and haven't managed to do.

First...I linked to an extension that is under development that I had been given alpha access to. At the moment the extension still is in early development (you can export from J3 but not import into J4) so I can't promote that as the approach to use (as I couldn't use it).

So what I did...I updated my site to 3.10.6 and then downloaded a copy to try and run the whole migration process locally. I had also downloaded a copy locally of Joomla 4.1.0 to use.

The same issues as before came up for when I had tried to migrate using the "Upload and Update" approach before. Same ajax error etc. So I then looked at the logs. Nothing of any detail that was significant and it ended with these two lines...

Code: Select all

2022-02-16T22:11:06+00:00	INFO ::1	update	End of SQL updates.
2022-02-16T22:11:06+00:00	INFO ::1	update	Deleting removed files and folders.
I mean, come on...that says the thing has worked, right? Despite the fact that it looked like hadn't. So with the updating fuel gauge stuck, I refreshed my browser and was very surprised to find a nice looking Joomla 4 admin area! This is NOT what has happened in the past. Previously the admin area has been a mess. I still wasn't convinced that things had worked. But it had.

I then tried the approach (after making a backup) on my live site. This time I opted to use the "Live Update" option to move to Joomla 4. Again...same error using that approach that is the subject of this forum thread. That file claiming the name was already in use. But browser refresh, and there was the Joomla 4 admin area looking good.

So I checked for warnings. The first one was a Database warning saying that tables are not up to date as in the attached image. So I ticked the box and asked it to update the structure.

Oddly, it failed the first time with no message...but when I tired a second time...success!

I then also decided to reinstall the Joomla core files to be safe to make sure that I truly have the most up to date stable version.

It now appears I have a Joomla 4 site! Everything is actually there!

BUT!

My contact form is not working. When I go into the admin area and ask it to send me a test email using sendmail, it sends it. If I change that to send by php, that works also. But from the public front end, when you use the contact form...

If it is set to the php mail setting you get the following on submitting the form....

Warning
Could not instantiate mail function.


If the system is set up to use sendmail, the error is...

Warning
Could not execute: /usr/sbin/sendmail


I switched to the default template to make sure this is not a YooTheme issue...it happens using the default site template in Joomla also. No emails arrive.

So I am almost there....but not quite. I can't see it as a hosting issue, as it works from the backend of Joomla...so it's something to do with that contact form...maybe? I can't use SMTP on the server as I have a Google account using that domain name.

Almost there, but can't find a solution around for this issue. Anyone have an idea?
You do not have the required permissions to view the files attached to this post.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Fri Feb 18, 2022 4:07 am

OK, I have to correct myself when I said
I can't use SMTP on the server as I have a Google account using that domain name.
I could have used Google's settings for sending emails via SMTP...but in talking with Siteground, they said I could easily just create an email account on the hosting server...which I did, switched to SMTP for the contact form and now my site is error free and running Joomla 4!

I never figured out the error that started this thread...but regardless of not being able to solve that, I've managed to migrate.

Thanks to those that offered help along the way. Much appreciated!

User avatar
anibal_sanchez
Joomla! Explorer
Joomla! Explorer
Posts: 487
Joined: Sat Mar 17, 2012 3:01 pm
Location: Oviedo, Asturias, Spain
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by anibal_sanchez » Wed Mar 09, 2022 3:53 pm

Hi,

This is the offending file:

plugins/fields/repeatable/repeatable.php

...
JLoader::import('components.com_fields.libraries.fieldsplugin', JPATH_ADMINISTRATOR);
...


If you comment on the line and refresh the error page, then the installer shows the success page.

Best Regards
@anibal_sanchez - Former JED Team Leader.

Prefix PHP Libraries & Projects: https://php-prefixer.com
My Extensions: https://extly.com

cyberxstudio
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Mar 10, 2022 5:35 am

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by cyberxstudio » Thu Mar 10, 2022 5:43 am

Clear browser cache might be a browser-specific problem.

phil_roy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 224
Joined: Tue Sep 06, 2005 11:46 am
Location: New Zealand
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by phil_roy » Thu Mar 10, 2022 6:25 am

You are both posting on a thread that I started and the issue is clearly marked as resolved.

anibal_sanchez I can't confirm your solution as the issue is no longer one I have.

cyberxstudio This was already suggested and I indicated it was not a browser issue when multiple browsers and Joomla installs were tested

User avatar
anibal_sanchez
Joomla! Explorer
Joomla! Explorer
Posts: 487
Joined: Sat Mar 17, 2012 3:01 pm
Location: Oviedo, Asturias, Spain
Contact:

Re: Cannot declare class FieldsPlugin, because the name is already in use

Post by anibal_sanchez » Thu Mar 10, 2022 12:02 pm

@anibal_sanchez - Former JED Team Leader.

Prefix PHP Libraries & Projects: https://php-prefixer.com
My Extensions: https://extly.com


Locked

Return to “Migrating and Upgrading to Joomla! 4.x”