ChurchCRM / CRM

ChurchCRM is an OpenSource Church CRM & Management Software.
https://ChurchCRM.io
MIT License
607 stars 428 forks source link

Bug: sudo -u www-data php setup/index.php => "ChurchCRM\model\ChurchCRM\Base\ListOptionQuery" not found in ... #7039

Open Beerlesklopfer opened 1 month ago

Beerlesklopfer commented 1 month ago

Description

I followed these instructions

mkdir -p /usr/share/CCRM
cd /usr/share/CCRM
wget [some.url.from.github]/5.8.0.tar.gz
tar xf 5.8.0.tar.gz
ln -s CRM-5.8.0 current
chown -R nginx:nginx $PWD
cd /usr/share/CCRM/current/src
composer --dev install [succeeded w/o errors]

A clear and concise description of what the reported bug is:

Steps To Reproduce I tried to open the web page and was redirected to the setup URL as expected. Finally, I got an empty page. After having typed sudo -u nginx php setup/index.php for further examinations I got:

PHP Fatal error:  Uncaught Error: Class "ChurchCRM\model\ChurchCRM\Base\ListOptionQuery" not found in /usr/share/CCRM/CRM-5.8.0/src/ChurchCRM/model/ChurchCRM/ListOptionQuery.php:16
Stack trace:
#0 /usr/share/CCRM/CRM-5.8.0/src/vendor/composer/ClassLoader.php(582): include()
#1 /usr/share/CCRM/CRM-5.8.0/src/vendor/composer/ClassLoader.php(433): Composer\Autoload\{closure}()
#2 /usr/share/CCRM/CRM-5.8.0/src/ChurchCRM/dto/SystemConfig.php(73): Composer\Autoload\ClassLoader->loadClass()
#3 /usr/share/CCRM/CRM-5.8.0/src/ChurchCRM/dto/SystemConfig.php(89): ChurchCRM\dto\SystemConfig::getFamilyRoleChoices()
#4 /usr/share/CCRM/CRM-5.8.0/src/ChurchCRM/dto/SystemConfig.php(299): ChurchCRM\dto\SystemConfig::buildConfigs()
#5 /usr/share/CCRM/CRM-5.8.0/src/setup/index.php(18): ChurchCRM\dto\SystemConfig::init()
#6 {main}
  thrown in /usr/share/CCRM/CRM-5.8.0/src/ChurchCRM/model/ChurchCRM/ListOptionQuery.php on line 16 

Expected behavior Doing the setup steps

DawoudIO commented 1 month ago

The source does not have all the code please download a release unless you are trying to develop

Beerlesklopfer commented 1 month ago

I used this Release from GitHub. Would you like me to extract a Docker image? I do not find any other download on Your website.

Why is this source missing? Where can I download that tarball, please?

respencer commented 1 month ago

Hi @Beerlesklopfer:

You want this one: https://github.com/ChurchCRM/CRM/releases/download/5.8.0/ChurchCRM-5.8.0.zip

The other 2 are the source code in a Zip or Tarball.

Beerlesklopfer commented 1 month ago

A am about to build a makefile for generating different packages based on the docker-stages-mechanism. Could you assist me please getting the missing files into the git repository? In the end you waould archieved to have packages available for those linux distributiuons that have docker images available. Maybe you want to accept my pull request later on.

respencer commented 1 month ago

What's missing?

Beerlesklopfer commented 1 month ago

@respencer: Maybe you want to have a lock at https://github.com/Beerlesklopfer/ChurchCRM-maintainable. I assumed, that when I checked out the source, and followed your build steps here I would run in success. But you didn't mention how I can resolve the necessary dependencies in the instructions. Why keep it simple when you can make it more complicated? Well then, I resolved it in the prepare-section of "my" Makefile. Now the missing php 'packages' can be imported.

Nevertheless, the installer reports that the integrity check has failed. The reason for this, which attachments are missing, remains a mystery. I will attach my Ubuntu package later on to my forked repo.

respencer commented 1 month ago

There's no reason that I can think of to use the ChurchCRM source to build a Debian package.

There's nothing missing if you used the 5.8.0 release file I've already given you a link too.

Further, neither Debian nor Ubuntu would accept the resulting package you are making as it includes composer.phar.

Beerlesklopfer commented 1 month ago

A) Well at our company we have CI/CD activated. Our packages were all built out of sources. B) Can you explain the meaning of this, please? It appears also in your file. Can you explain the meaning of this, please? the corresponduing log is:

2024/05/22 18:30:23 [error] 186500#186500: *5 open() "/usr/share/churchcrm/current/setup/SystemIntegrityCheck" failed (2: No such file or directory), client: 127.0.0.1, server: www.example.com, request: "GET /setup/SystemIntegrityCheck HTTP/2.0", host: "localhost:4343", referrer: "https://localhost:4343/setup/"
2024/05/22 18:30:23 [error] 186500#186500: *5 open() "/usr/share/churchcrm/current/setup/SystemPrerequisiteCheck" failed (2: No such file or directory), client: 127.0.0.1, server: www.example.com, request: "GET /setup/SystemPrerequisiteCheck HTTP/2.0", host: "localhost:4343", referrer: "https://localhost:4343/setup/"

C) Yes, you are completely right. It was meant to be a step in between. I already updated it.

respencer commented 1 month ago

A. Unless you are making changes to the source that requires a rebuild, you are just making your life unnecessarily hard in this case.

B. ChurchCRM requires Apache mod_rewrite. On your install it appears it's going outside the web server root and looking for files that don't actually exists since they are a path internal to ChurchCRM.

I don't know what the setting is to get Nginx to behave the same way as Apache would with mod_rewrite.

Beerlesklopfer commented 1 month ago

I finally got it working and attached a pkg at a fork. Maybe you are interested in a pull request later on? I have to figure out how to deal with the MySQL system installed password for user root.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

DAcodedBEAT commented 5 days ago

@respencer Curious why you removed the Stale label - the Query classes are now implicitly created on composer install so this shouldn't be an issue.