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

Error when trying to enable tenant #42

Open
caiadogithub opened this issue Jan 7, 2025 · 2 comments · May be fixed by #43
Open

Error when trying to enable tenant #42

caiadogithub opened this issue Jan 7, 2025 · 2 comments · May be fixed by #43

Comments

@caiadogithub
Copy link

Moodle 4.5.1+
PHP 8.3
Postgres 16
Ai Manager v0.0.4 (2025010700)

Informações de depuração: ERRO: valor é muito longo para tipo character varying(10)
INSERT INTO mdl_local_ai_manager_config (configkey,configvalue,tenant) VALUES($1,$2,$3) RETURNING id
[array (
'configkey' => 'tenantenabled',
'configvalue' => '1',
'tenant' => 'InstitutoTrcioPacitti',
)]
Error code: dmlwriteexception Rastreamento de pilha:

line 500 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 358 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
line 1149 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 1197 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
line 152 of /local/ai_manager/classes/local/config_manager.php: call to pgsql_native_moodle_database->insert_record()
line 48 of /local/ai_manager/tenant_config.php: call to local_ai_manager\local\config_manager->set_config()
@PhMemmel
Copy link
Member

PhMemmel commented Jan 8, 2025

Hi @caiadogithub,

thank you very much for your report. The issue here is that the name of your tenant is too long for the database fields I defined. This is still a relict of an early development decision.

I provided a pull request that updates the fields' precisions. If you are working on a testing instance, you can use the code of the pull request and test. But be aware that we are currently about to add some bigger new features including database manipulations, so I do not recommend installing the feature branch on a production or pre-production system yet until the fix it has landed in main branch.

@caiadogithub
Copy link
Author

We are working on a testing site, but I will wait for the upgrade.

Thanks!

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