How to debug "Sugar CRM X Files May Only Be Used With A Sugar CRM Y Database." - sugarcrm

Sometimes one gets a message like:
Sugar CRM 6.4.5 Files May Only Be Used With A Sugar CRM 6.4.5 Database.
I am wondering how Sugar determines what version of the database it is using. In the above case, I get the following output:
select * from config where name='sugar_version';
+----------+---------------+-------+
| category | name | value |
+----------+---------------+-------+
| info | sugar_version | 6.4.5 |
+----------+---------------+-------+
1 row in set (0.00 sec)
cat config.php |grep sugar_version
'sugar_version' => '6.4.5',
Given the above output, I am wondering how to debug the output "Sugar CRM 6.4.5 Files May Only Be Used With A Sugar CRM 6.4.5 Database.": Sugar seems to think the files are not of version 6.4.5 even though the sugar_version is 6.4.5 in config.php; where should I look next?

Two options for the issue:
Option 1: Update your database for the latest version.
Option 2: Follow the steps below and change the SugarCRM cnfig version.
mysql> select * from config where name ='sugar_version';
+----------+---------------+---------+----------+
| category | name | value | platform |
+----------+---------------+---------+----------+
| info | sugar_version | 7.7.0.0 | NULL |
+----------+---------------+---------+----------+
1 row in set (0.00 sec)
Update your sugarcrm version to apporipriate :
mysql> update config set value='7.7.1.1' where name ='sugar_version';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

The above commands seem to be correct. Sugar seems to check that config.php and the config table in the database contain the same version. In my case I was making the mistake of using the wrong database -- so if you're like me and tend to have your databases mixed up, double check in config.php that 'dbconfig' is indeed pointing to the right database.

Related

Why do certain psql commands from terminal work for local database and not for hosted database?

I have imported a local PostgreSQL database to a managed cluster on Digital Ocean. It will be used with a Python app that will also be hosted on Digital Ocean. I used pg_dump and pg_restore to achieve the import. Now, to make sure the import was successful, I am running some psql queries and commands via my MacOS terminal app that is set up with zsh and it connects via a shell script that prompts me for host, database name, port, user and password. I am successful in connecting to the managed cluster this way, and I can execute some queries with no problem, while others are causing errors. For example:
my_support=> \dt
List of relations
Schema | Name | Type | Owner
--------+----------------------+-------+---------
public | ages | table | doadmin
public | articles | table | doadmin
public | challenges | table | doadmin
public | cities | table | doadmin
public | comments | table | doadmin
public | messages | table | doadmin
public | relationships | table | doadmin
public | topics | table | doadmin
public | users | table | doadmin
(9 rows)
my_support=> \dt+
sh: more: command not found
my_support=>
Also:
my_support=> SELECT id,sender_id FROM messages;
id | sender_id
----+-----------
1 | 1
2 | 2
3 | 4
4 | 1
5 | 2
(5 rows)
my_support=> SELECT * FROM messages;
sh: more: command not found
my_support=>
So the terminal app seems to dislike certain characters, such as * and +, but I can't find any documentation that tells me I should escape them, or how. I tried backslash in front of them, but it did not work. And what's more confusing is that these very same queries are successful when I connected to my LOCAL copy of the database, using the very same terminal app, launched from the very same shell script.
In case it's helpful, here's what I see in the CLI when I connect:
psql (14.1, server 14.2)
SSL connection (protocol: TLSv1.3, cipher: <alphanumeric string here>, bits: 256, compression: off)
Type "help" for help.
my_support=>
Does it matter that my local PostgreSQL version is 14.1 and the server is 14.2? I'm assuming the "server" refers to the hosted environment, but it seems like something as basic as "SELECT * FROM" should not be version-dependent.
Ultimately what matters is whether my Python app (which uses psycopg library to talk to PostgreSQL) can run those queries, and I haven't test that yet. But it sure would be handy to test things on the managed cluster using my local terminal app.
BTW, I have an open ticket with Digital Ocean to answer this question, but I find SO to be faster and more helpful in most cases.
psql is trying to use a pager to display results that are longer than the number of lines in the terminal. The error message
more: command not found
indicates that the pager (more) it tries to use is not available. You can turn off the use of a pager:
\pset pager off
or set a different command to be used as the pager. See the manual for details

Sphinx 3.1.1 not returning correct snippet

I have a Sphinx 3.1.1. installation where I want to show snippets for the found results using DocStore. However, the snippet is just returning the beginning of the content of the document.
The query I use:
SELECT id, SNIPPET(content, QUERY()) AS snippet FROM test_index WHERE MATCH('test');
This returns me results like:
+--+--------------------------------------------------------+
|id |snippet |
+-----------------------------------------------------------+
|1 |this is a test document to test Sphinx 3.1.1 ... |
+-----------------------------------------------------------+
|2 |another test document to test Sphinx 3.1.1. ... |
+--+--------------------------------------------------------+
Please note that the returned snippets have no highlighting b-tags around the search word test and the returned snippet is the starting string of the document. If I for instance search for test2, the results are the same (the documents contain test2 further in the content, but the snippet only shows the first x words from the content without any highlighting?)
The configuration of my index is:
index test_index
{
type = rt
path = /mtn/data001/test_index
rt_field = content
stored_fields = content
}
What am I doing wrong and why does my snippet not contain highlight tags?
Hmm, I just tried copy/pasting your test_index to a config file, and starting a sphinx3 instance...
barry#tea:~/sphinx-3.1.1$ bin/searchd --config test.conf
Sphinx 3.1.1 (commit 612d99f)
Copyright (c) 2001-2018, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file 'test.conf'...
listening on all interfaces, port=10312
listening on all interfaces, port=10306
precaching index 'test_index'
precached 1 indexes in 0.001 sec
barry#tea:~/sphinx-3.1.1$ mysql --protocol=tcp -P10306 --prompt='sphinxQL3>' --default-character-set=utf8
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 3.1.1 (commit 612d99f)
sphinxQL3>SELECT id, DOCUMENT() as doc, DOCUMENT({content}) FROM test_index WHERE MATCH('test');
Empty set (0.00 sec)
sphinxQL3>insert into test_index values (1,'this is a test');
Query OK, 1 row affected (0.00 sec)
sphinxQL3>insert into test_index values (2,'this is a test more');
Query OK, 1 row affected (0.00 sec)
sphinxQL3>SELECT id, SNIPPET(DOCUMENT({content}), QUERY()) AS snippet FROM test_index WHERE MATCH('test');
+------+----------------------------+
| id | snippet |
+------+----------------------------+
| 1 | this is a <b>test</b> |
| 2 | this is a <b>test</b> more |
+------+----------------------------+
2 rows in set (0.00 sec)
sphinxQL3>SELECT id, SNIPPET(content, QUERY()) AS snippet FROM test_index WHERE MATCH('test');
+------+----------------------------+
| id | snippet |
+------+----------------------------+
| 1 | this is a <b>test</b> |
| 2 | this is a <b>test</b> more |
+------+----------------------------+
2 rows in set (0.00 sec)
sphinxQL3>SELECT id, SNIPPET(content, QUERY()) AS snippet FROM test_index WHERE MATCH('more');
+------+----------------------------+
| id | snippet |
+------+----------------------------+
| 2 | this is a test <b>more</b> |
+------+----------------------------+
1 row in set (0.00 sec)
sphinxQL3>insert into test_index values (3,'this is a test document to test Sphinx 3.1.1 Technically, Sphinx is a standalone software package provides fast and relevant full-text search functionality to client applications. It was specially designed to integrate well with SQL databases storing the data, and to be easily accessed by scripting languages. However, Sphinx does not depend on nor require any specific database to function. ');
Query OK, 1 row affected (0.00 sec)
sphinxQL3>SELECT id, SNIPPET(content, QUERY()) AS snippet FROM test_index WHERE MATCH('test'); +------+-------------------------------------------------------------------------------+
| id | snippet |
+------+-------------------------------------------------------------------------------+
| 1 | this is a <b>test</b> |
| 2 | this is a <b>test</b> more |
| 3 | this is a <b>test</b> document to <b>test</b> Sphinx 3.1.1 Technically, ... |
+------+-------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
sphinxQL3>SELECT id, SNIPPET(content, QUERY()) AS snippet FROM test_index WHERE MATCH('scripting');
+------+------------------------------------------------------------------------------------------+
| id | snippet |
+------+------------------------------------------------------------------------------------------+
| 3 | ... to be easily accessed by <b>scripting</b> languages. However, Sphinx does not ... |
+------+------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
So it seems that 3.1.1 does work as such, but something odd is going on with your configuration.
Maybe try deleting the test_index files (while searchd is shutdown) and trying again. Maybe you've somehow corrupted your index files (eg changed the config since creating it) - this is quite easy to do during experimentation

How Jasperreports Server stores report output internally?

There are few ways to store report output in JR Server: FS, FTP and Repository. The repository output is the default one. I guess the files in the repository must be stored in the DB or file system. Are the files kept forever? How can I manage the repository and for example set a file's lifetime?
The repository outputs are stored in the database. Usually there is no need to set the lifetime.
As of JasperReports Server v 6.3.0 the reference to all resources is kept in jiresource table, while content of is kept in jiresource.
In my case I was able to retrieve all output reports with:
select r.id,r.name,r.creation_date
from jiresource r, jicontentresource c
where r.id = c.id;
The definition of jicontentresource is
jasperserver=# \d+ jicontentresource
id | bigint | not null | plain | |
data | bytea | | extended | |
file_type | character varying(20) | | extended | |

OrientDB: Cannot find a command executor for the command request: sql.MOVE VERTEX

I am using orientdb community edition 1.7.9 on mac osx.
Database Info:
DISTRIBUTED CONFIGURATION: none (OrientDB is running in standalone
mode)
DATABASE PROPERTIES
NAME | VALUE|
Name | null |
Version | 9 |
Date format | yyyy-MM-dd |
Datetime format | yyyy-MM-dd HH:mm:ss |
Timezone | Asia/xxxx |
Locale Country | US |
Locale Language | en |
Charset | UTF-8 |
Schema RID | #0:1 |
Index Manager RID | #0:2 |
Dictionary RID | null |
Command flow:
create cluster xyz physical default default append
alter class me add cluster xyz
move vertex #1:2 to cluster:xyz
Studio UI throw the following error:
014-10-22 14:59:33:043 SEVE Internal server error:
com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException:
Cannot find a command executor for the command request: sql.MOVE
VERTEX #1:2 TO CLUSTER:xyz [ONetworkProtocolHttpDb]
Console return a record as select does. I do not see error in the log.
I am planning a critical feature by using altering cluster for selected records.
Could anyone help on this regard?
Thanks in advance.
Cheers
move vertex command is not supported in 1.7.x
you have to use switch to 2.0-M2
The OrientDB Console is a Java Application made to work against OrientDB databases and Server instances.
more

Magento admin panel inaccessible with no error (after server hang)

the server that a magento install was on crashed for (currently reason unknown) and now the backend is inaccessible. I either get no error or I get access denied. I am able to preform the password reset.
I have tried:
clearing the browser cookies and cache
clearing the session, tmp and cache folders in magento
using the magento database repair tool - no errors were found
creating a new user manually in the admin_users table (this gets access denied)
rebooting the server again (last resort but still no)
The main admin user gets a redirect loop.
Any ideas are welcome, I am now stumped.
EDIT:I am really after any way to recover a magento admin login? or failing this any way to export the data (without exporting the bugged section)
I have employed a hack in one of the core magento files detailed here: http://blog.chapagain.com.np/magento-admin-login-problem/
I have had to comment out lines in "app/code/core/Mage/Core/Model/Session/Abstract/Varien.php":
(please note this is for 1.6 - check link posted for advice on 1.4)
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()//,
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);
also line 104 comment out :
//call_user_func_array('session_set_cookie_params', $cookieParams);
It seems to be when the server went down something happened to the session, as the new install also failed.
You can get your data by performing a database backup via cPanel or mysqldump via SSH access. Your hosting provider should be able to help you. Additionally, you can unzip the admin files from your Magento installed version. Download it to your computer and unzip the installation... then re-zip the folder for app/design/adminhtml ... upload and unpack this on your website in the proper place, and this will reinstall the PHP pages.
Double check the file app/etc/local.xml this usually has the database login stored in it.
Inside the mysql database for your magento installation, there is the table core_config_data and in it, some path values might interfere with using admin if intentionally set incorrectly:
mysql> select config_id, path, left(value,30) from core_config_data WHERE path LIKE '%admin%';
+-----------+-------------------------------------------+--------------------------------+
| config_id | path | left(value,30) |
+-----------+-------------------------------------------+--------------------------------+
| 50 | dev/translate_inline/active_admin | 0 |
| 220 | web/secure/use_in_adminhtml | 0 |
| 687 | admin/startup/page | catalog/products |
| 690 | admin/security/use_form_key | 0 |
| 691 | admin/security/use_case_sensitive_login | 1 |
| 692 | admin/security/session_cookie_lifetime | 36000 |
| 745 | admin/url/use_custom | 0 |
| 746 | admin/url/custom | |
+-----------+-------------------------------------------+--------------------------------+