Search in sections not working

Hi there,

this problem is bugging me since the beginning of the release of Komodo 10: Codeintelligence and search in sections isn’t working. I have opened a simple PHP file and the search in sections is always empty:

Also i’m getting daily codeintel errors, regardless of cleaning profile or re-installing komodo from scratch with a new profile. The only error which disappears for a short time is the “BusyError: BusyError: database is locked” - but it definitely comes again:

These errors were generated directly after a rebuild of the codeintelligence database. Thanks for any help.

Would you please post the contents of your View > Troubleshooting > View Log File? The error messages in your screenshot are not very helpful unfortunately. Also, if you could share the contents of your simple PHP file, that would be helpful too, in order for us to try and reproduce the problem.

Thanks!

Hi mitchell,

here is the content of the error log:

> [2016-12-22 16:29:21,065] [INFO] Startup: Welcome to Komodo IDE 10.1.4 build 89515 (platform win32-x86, running on Windows post2012Server version 6.3.9600)
> [2016-12-22 16:29:21,065] [INFO] Startup: C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\komodo.exe built on Fri Dec 16 10:34:21 2016
> [2016-12-22 16:29:21,680] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in resource://gre/modules/Preferences.jsm:381
> [2016-12-22 16:29:21,684] [WARNING] console-logger: Ignoring obsolete chrome registration modifier 'xpcnativewrappers=no'. (1) in file:///C:/Users/daniel/AppData/Local/ActiveState/KomodoIDE/10.1/XRE/extensions/inspector@mozilla.org/chrome.manifest:16
> [2016-12-22 16:29:21,720] [WARNING] root: ko.logging has been converted to a CommonJS module; use require("ko/logging") instead (since Komodo 9.0.0a1).
>     @chrome://komodo/content/komodo.js:15:1

> [2016-12-22 16:29:22,066] [ERROR] console-logger: bad script XDR magic number (0) in :0
> Traceback (most recent call last):
>   File "", line 0, in 

> [2016-12-22 16:29:28,256] [INFO] koInitService: Adding pre startup service for 'koFileStatusService': '@activestate.com/koFileStatusService;1'
> [2016-12-22 16:29:28,401] [INFO] komodospellchecker: Spell checker loaded.
> [2016-12-22 16:29:28,401] [INFO] komodospellchecker: Using dictionary en-US
> [2016-12-22 16:29:28,470] [ERROR] koScopeDocs-Py: Could not find cix for ext
> [2016-12-22 16:29:28,473] [INFO] elastic_tabstops: Elastic tabstops loaded.
> [2016-12-22 16:29:28,477] [ERROR] koScopeDocs-Py: Could not find cix for html5
> [2016-12-22 16:29:31,756] [ERROR] console-logger: bad script XDR magic number (0) in :0
> Traceback (most recent call last):
>   File "", line 0, in 

> [2016-12-22 16:29:31,983] [INFO] koInitService: Adding pre startup service for 'KoMemoryReporter': '@activestate.com/koMemoryReporter;1'
> [2016-12-22 16:29:31,984] [INFO] koInitService: Adding pre startup service for 'koCommandmentService': '@activestate.com/koCommandmentService;1'
> [2016-12-22 16:29:31,990] [INFO] koInitService: Adding pre startup service for 'koDBGPManager': '@activestate.com/koDBGPManager;1'
> [2016-12-22 16:29:32,456] [ERROR] commands: doing _updateCommand: cmd_publishingOpenDialog: 
> -- EXCEPTION START --
> [Exception... "[JavaScript Error: "ko.places.manager is undefined" {file: "chrome://komodo-places/content/places.js" line: 3749}]'[JavaScript Error: "ko.places.manager is undefined" {file: "chrome://komodo-places/content/places.js" line: 3749}]' when calling method: [nsIController::isCommandEnabled]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://komodo/content/library/commands.js :: _command_updateCommand :: line 72"  data: yes]
> + QueryInterface (function) 3 lines
> + message (string) '[JavaScript Error: "ko.places.manager is undefined" {file: "chrome://komodo-places/content/places.js'...285 chars
> + result (number) 2153185313
> + name (string) 'NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS'
> + filename (string) 'chrome://komodo/content/library/commands.js'
> + lineNumber (number) 72
> + columnNumber (number) 0
> + location (object) JS frame :: chrome://komodo/content/library/commands.js :: _command_updateCommand :: line 72
> | + QueryInterface (function) 3 lines
> | + language (number) 2
> | + languageName (string) 'JavaScript'
> | + filename (string) 'chrome://komodo/content/library/commands.js'
> | + name (string) '_command_updateCommand'
> | + lineNumber (number) 72
> | + columnNumber (number) 22
> | + sourceLine (string) ''
> | + caller (object) JS frame :: chrome://komodo/content/library/commands.js :: command_updateCommandset/commandset._updateTimer< :: line 99
> | + formattedStack (string) '_command_updateCommand@chrome://komodo/content/library/commands.js:72:22
> command_updateCommandset/commandset._updateTimer<@chrome://komodo/content/library/commands.js:99:21
> '
> | + inner (object) null
> | + data (object) [xpconnect wrapped nsISupports]
> | + QueryInterface (function) 3 lines
> | + initialize (function) 3 lines
> -- EXCEPTION END --
> [2016-12-22 16:29:33,476] [ERROR] console-logger: TypeError: ko.places.manager is undefined (2) in chrome://komodo-places/content/places.js:3749
> Traceback (most recent call last):
>   File "chrome://komodo-places/content/places.js", line 3749, in 

> [2016-12-22 16:29:36,362] [WARNING] console-logger: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create (1) in file:///C:/Program%20Files%20(x86)/ActiveState%20Komodo%20IDE%2010/lib/mozilla/components/koamAddonManager.js:138
> [2016-12-22 16:29:41,081] [ERROR] codeintel.indexer: unexpected internal error in indexer: ignoring and continuing
> Traceback (most recent call last):
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\indexer.py", line 516, in run
>     self._iteration()
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\indexer.py", line 583, in _iteration
>     buf.scan(mtime=request.mtime)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\udl.py", line 483, in scan
>     super(XMLParsingBufferMixin, self).scan(mtime, skip_scan_time_check)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\citadel.py", line 290, in scan
>     skip_scan_time_check=skip_scan_time_check)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\database\database.py", line 1046, in update_buf_data
>     skip_scan_time_check=skip_scan_time_check)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\database\multilanglib.py", line 939, in update_buf_data
>     self._update_symbols_db(conn, action, blob)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\database\langlib.py", line 961, in _update_symbols_db
>     (blob.get("src"),))
>   File "c:\bb\ko-win-x86-r\ide-10.1\build\release\apsw\src\cursor.c", line 236, in resetcursor
> BusyError: BusyError: database is locked
> [2016-12-22 16:29:43,173] [ERROR] codeintel.citadel: unexpected error scanning `custom_model.php'
> Traceback (most recent call last):
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\citadel.py", line 264, in scan
>     scan_tree = cile_driver.scan_purelang(self)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\udl.py", line 616, in scan_purelang
>     self.slave_css_cile_driver)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 1285, in scan_multilang
>     csl_tokens, css_tokens = phpciler.scan_multilang_content(buf.accessor.text)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3426, in scan_multilang_content
>     PHPLexer().tokenize_by_style(content, self.token_next)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\udl.py", line 98, in tokenize_by_style
>     return Lexer.tokenize_by_style(self, text, call_back)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\SilverCity\Lexer.py", line 8, in tokenize_by_style
>     call_back
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3386, in token_next
>     self._addCodePiece()
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3197, in _addCodePiece
>     self._addCodePiece()
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3238, in _addCodePiece
>     doc=self.comment)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 2865, in _variableHandler
>     assignChar = text[p]
> IndexError: list index out of range
> [2016-12-22 16:29:43,372] [ERROR] codeintel.citadel: unexpected error scanning `textformat_helper.php'
> Traceback (most recent call last):
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\citadel.py", line 264, in scan
>     scan_tree = cile_driver.scan_purelang(self)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\udl.py", line 616, in scan_purelang
>     self.slave_css_cile_driver)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 1285, in scan_multilang
>     csl_tokens, css_tokens = phpciler.scan_multilang_content(buf.accessor.text)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3426, in scan_multilang_content
>     PHPLexer().tokenize_by_style(content, self.token_next)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\codeintel2\udl.py", line 98, in tokenize_by_style
>     return Lexer.tokenize_by_style(self, text, call_back)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\python\komodo\SilverCity\Lexer.py", line 8, in tokenize_by_style
>     call_back
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3386, in token_next
>     self._addCodePiece()
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3197, in _addCodePiece
>     self._addCodePiece()
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 3238, in _addCodePiece
>     doc=self.comment)
>   File "C:\Program Files (x86)\ActiveState Komodo IDE 10\lib\mozilla\distribution\bundles\php_language@ActiveState.com\pylib\lang_php.py", line 2865, in _variableHandler
>     assignChar = text[p]
> IndexError: list index out of range
> [2016-12-22 16:37:11,936] [WARNING] console-logger: Key event not available on GTK2: key="u" modifiers="control,shift" (1) in chrome://komodo/content/tail/tail.xul:0
> [2016-12-22 16:37:11,937] [WARNING] console-logger: Key event not available on some keyboard layouts: key="v" modifiers="control,alt" (1) in chrome://komodo/content/tail/tail.xul:0


------------------------------------------------------------

And here is the content of the PHP-file:

> <?php

> class Custom_Model extends CI_Model {

>       
>   protected 	$CI;      			//Holds instance
>   protected 	$userId;  			//User ID from the currently logged in person
> 	protected		$tablename;			
> 	protected 	$validFields;		
> 	
>   public function __construct() {
>     parent::__construct();
>     
>     //Instanz von CI laden für den Zugriff auf benötigte Libraries
> 		$this->CI =& get_instance();
> 		$this->userId = $this->CI->session->getUserId();
>     $this->tablename = '';
> 		$this->transactionDepth = 0;	//Initial wird davon ausgegangen, dass alles klappt, sollte ein Fehler auftreten so wird alles gerollbacked (auch nested transactions)
> 		}
>     
>     
>   /*
>    * This function checks for the permission of the currently logged in user on the given SQL-Query.
>    * @return string Returns the parsed SQL query
>    */
>   
>   public function checkPermission($sql, $fieldname='id_user') {
>     
> 		//Check if User has general Administration Privileges and set the replace string to dummy
> 		if($this->CI->Auth->checkIfBackofficeUser()){
> 			//No need to restrict Access for logged in Administration Users
> 			$replaceString = ' 1=1';
> 			}
> 		else{
> 			$replaceString = ' '.$fieldname.' = '.$this->db->escape($this->userId).' ';
> 			}
> 		
> 		//Replace Query-String
> 		$sql = str_replace('###CHECK_PERMISSION###', $replaceString, $sql);
> 		
>     return $sql;
>     }
>     
> 		
>   /*
>    *  This function gets the amount of found rows which were returned in the last executed query with SQL_CALC_FOUND_ROWS
>    * @return string Returns the parsed SQL query
>    */
>   
>   public function _getFoundRows() {
>     
>     $retval = false;
>     
>     if($query = $this->db->query('SELECT FOUND_ROWS() as rows')){
>       if($query->num_rows()>0){
>         $retval = $query->row()->rows;
>         }
>       }
>     
>     return $retval;
>     
>     }
>    
> 	 
> 	/**
>   * Global fetch function for single or multiple datafields fom database
>   *
>   * @param $id ID of the datafield
>   * @param $field $array Field which should be fetched
>   * @return array
>   */
>   public function fetch($id, $field) {
> 		$retval = false;
>     
> 		$fieldlist = (is_array($field)) ? implode(', ',$field) : $field;
> 		
>     $sql_query = 'SELECT '.$fieldlist. ' FROM '.$this->tablename.' WHERE id = '.$this->db->escape($id);
>     if($query = $this->db->query($sql_query)){
> 			
> 			if(is_array($field) && count($field)>1){
> 				//Mehrere Felder werden ausgelesen -> Ein Array mit "Feldname" -> "Wert" wird retourniert
> 				if($query->num_rows()>0) $retval = $query->row_array();
> 				}
> 			else{
> 				//EIn Einzelfeld wird retourniert -> Es wird nur der Wert alleine rückgegeben
> 				if($query->num_rows()>0) {
> 					$tmpVal = $query->row_array();
> 					$retval = $tmpVal[$field];
> 					}
> 				}
> 			
> 			}
> 			
>     return $retval;
> 		}
> 	 
> 	 
> 	/**
> 	 * Allgemeine Insert Methode - Legt einen neuen Datensatz in der Tabelle $this->tablename an (Muss durch die erweiternde Klasse definiert werden!)
> 	 * @param Array $userdata = Array mit den Daten
> 	 * @return Bool/Int Bei Erfolg die ID der angelegten Ressource, ansonst false
> 	 */
> 	public function _insert($data, $tablename='', $validFields=false) {
> 		$insertedId = false;
> 		
> 		if(!is_array($data)) return false;
> 		
> 		//Transaktion starten
> 		$this->db->trans_begin();
> 		$this->db->query('INSERT INTO '.(strlen($tablename)>0 ? $tablename : $this->tablename).' SET creationtime = NOW()');
> 		if($insertedId = $this->db->insert_id()){
> 			$this->_update($insertedId, $data, $validFields);	//Insert OK --> Update now
> 			}
> 		else throw new Exception('Der Datensatz konnte nicht angelegt werden');
> 		
> 		//Transaktion beenden
> 		if($this->db->trans_status()) {
> 			$retval = $insertedId;
> 			$this->db->trans_commit();
> 			}
> 		else {
> 			throw new Exception('Der Datensatz konnte nicht angelegt werden');
> 			$this->db->trans_rollback();
> 			}
> 		
> 		return $retval;
>     }
> 	 
> 	 
> 	/**
>    * Aktualisiert einen Eintrag in der Tabelle $this->tablename an (Muss durch die erweiternde Klasse definiert werden! --> ValidFields auch in erweiternder Klasse festlegen!)
>    * @param Int $id = ID des zu aktualisierenden Datensatzes
>    * @param Array $data = Array mit den Daten des zu aktualisierenden Datensätzen (feldname => wert)
>    * @param Array $validFields = Array, das die für dieses Insert gültigen Feldnamen definiert (optionale Sicherheitsoption)
>    * @return void
>    */
>   public function _update($id, $data, $validFields=false) {
>     
>     $retval = true;
>     
>     if (!($id >= 0 && is_array($data)))return false;
>     
>     $fields = array();
>     
>     //Benutzerspezifische validFields überschreiben Model-Vorgaben
> 		if(!$validFields){$validFields = $this->validFields;}
> 		
>     foreach ($validFields as $index) {  //Zu schreibende Daten an ein temporäres Array zuweisen
>       if (isset($data[$index]))
>         $fields[$index] = $data[$index];
> 				}
> 				
> 				
>     //SQL Query zusammenstellen und schreiben falls Felder zur Aktualisierung vorhanden sind
>     if (count($fields) > 0) {
>       $where = 'id = '.$this->db->escape($id);
>       $sql = $this->db->update_string($this->tablename, $fields, $where);
> 			
>       if (!($query = $this->db->query($sql))) {
>         $retval = false;
> 				}
> 				
> 			}
> 		return $retval;
> 		}
> 	 
> 	
> 	/**
>   * Allgemeine Löschfunktion für einen Datensatz. Sollten sich in diesem Datensatz auch Pfade zu Dateien befinden, so können diese auch automatisch mitgelöscht werden (Triggerfeld = filename)
>   * @param id
>   * @return boolean
>   */
>   public function _delete($id) {
>     $retval = false;
>     if($id == null) return false; //$id = $this->get_session('id');
> 		
> 		//Alten Datensatz vorher auslesen
> 		if($deleteFiles) $recordToDelete = $this->get($id);
> 		
>     $query = 'DELETE FROM '.$this->tablename.' WHERE id = '.$this->db->escape($id);
>     if($this->db->query($query)){
> 			if($this->db->affected_rows()>0){
> 				$retval = true;
> 				
> 				
> 					
> 				}
> 			}
> 			
>     return $retval;
> 		}
> 	
> 	
> 	
> 	/**
>   * Global get function for single data row from the current set table
>   *
>   * @param $id ID of the row
>   * @return array
>   */
>   public function get($id) {
> 		$retval = false;
>     
>     $sql_query = 'SELECT * FROM '.$this->tablename.' WHERE id = '.$this->db->escape($id);
>     if($query = $this->db->query($sql_query)){
> 			if($query->num_rows()>0) $retval = $query->row_array();
> 			}
>     
>     return $retval;
> 		}
> 	 
> 	 
> 	/**
>   * Global get function for All data rows from the current set table
>   *
>   * @param $id ID of the row
>   * @return array
>   */
>   public function getAll($orderBy='', $fields=array(), $start=0, $elements=30) {
>     
> 		$sqlOrderBy = $this->_getSqlOrderBy($orderBy);
> 		$sqlFields = (is_array($fields) && count($fields)>0) ? implode(',', $fields) : '*';
> 		
>     $sql = 'SELECT '.$sqlFields.' FROM '.$this->tablename.$sqlOrderBy;
>     if($query = $this->db->query($sql)){
> 			if($query->num_rows()>0) return $query->result_array();
> 			}
>     
>     return false;
> 		}
> 	 
> 	 
> 	 /**Liest eine Liste an Datensätzen der aktuell gesetzten Tabelle aus
>   *
>   * @param $id ID of the row
>   * @return array
>   */
>   public function _getList($fields=array(), $orderBy, $paginationStart=0, $paginationElements=20) {
>     
> 		$sqlOrderBy = $this->_getSqlOrderBy($orderBy);
> 		$sqlLimit = $this->_getSqlLimit($paginationStart, $paginationElements);
> 		
> 		$sqlFields = (is_array($fields) && count($fields)>0) ? implode(',', $fields) : '*';
> 		
>     $sql = 'SELECT
> 						SQL_CALC_FOUND_ROWS
> 						'.$sqlFields.'
> 						FROM '.$this->tablename;
> 		$sql .= $sqlOrderBy;
> 		$sql .= $sqlLimit;
> 		
>     if($query = $this->db->query($sql)){
> 			if($query->num_rows()>0) return $query->result_array();
> 			}
>     
>     return false;
> 		}
> 	 
> 	 
> 	 /**
>      * Prüft, ob ein Wert bereits in Datenbank eingetragen ist. (Bspq. für E-Mail Check)
>      *
>      * @param   String 	$table 	Tabellenname für die Abfrage
>      * @param 	String	$field 	Feldname für die Abfrage
>      * @param 	String 	$value 	Wert der auf Existenz abgefragt wird
>      * @param 	bool			$excludeId	ID des Datensatzes, welcher ausgenommen werden soll (Sodass bspw. der eigene, bestehende Datensatz bei einem E-Mail Check nicht fälschlicherweise als existent angenommen wird)
>      * @param 	bool 		$returnID		Rückgabe der ID des Datensatzes, der gefunden wurde (true/false)
>      * @return  bool  True bei existierendem Wert, ansonst false
>      */
>     public function checkForExistingValue($table, $field, $value, $excludeId=false, $returnID = true) {

> 			$retval = true;

> 			$where = '';
> 			if(!empty($excludeId) && $excludeId>0) $where = ' AND id <> "'.$excludeId.'"';
> 			$sql = 'SELECT id FROM '.$table.' WHERE '.$field.' = '.$this->db->escape($value).' '.$where;
> 			
> 			if($query = $this->db->query($sql)) {
> 					if($query->num_rows()==0) { //Eintrag existiert noch nicht
> 							return false;
> 					}
> 			}

> 			if($returnID) {
> 					$row = $query->row();
> 					return $row->id;
> 			} else {
> 					return true;
> 			}
> 			
>     }
> 	 
> 	 /**
> 		* Liest
> 		* @param Int $tablename   	= Name der zu aktualisierenden Tabelle
> 		* @param $table      				= Name der abzufragende Tabelle
> 		* @param $fieldname      		= Name der abzufragenden Spalte
> 		* @param $comparisonField   = Assoziatives Array mit Feldname -> Feldwert-Zuordnungfür die WHERE Bedingung
> 		* @return Array           	= Retourniert Array mit den ausgelesenen Werten (IDs)
> 		*/
> 	 public function getRelation($table, $fieldname, $comparisonArray=false) {
> 		
> 		$retval = false;
> 		if(!(strlen(trim($table))>0)) return false;
> 		if(!(strlen(trim($fieldname))>0)) return false;
> 		
> 		$this->db->select($fieldname);
> 		
> 		if(is_array($comparisonArray)){
> 			$this->db->where($comparisonArray);
> 			}
> 		
> 		$query = $this->db->get($table);
> 		if($query->num_rows()>0) { //Ergebnis vorhanden
> 			$retval = array();
> 			foreach($query->result_array() as $row){
> 				$retval[] = $row[$fieldname];
> 				}
> 			return $retval;
> 			}
> 			
> 		return $retval;
> 		}
>     
> 		
> 		
> 	/**
> 	 * 
> 	 * General function to count rows in a given table
> 	 * @return	object		Description	
> 	 */
> 	public function count($conditions=false){
> 		
> 		$sqlWhereString = '';
> 		
> 		if(is_array($conditions) && count($conditions)>0){
> 			$tmpSqlArray = array();
> 			foreach($conditions as $key => $val){
> 				$tmpSqlArray[] = $this->db->escape_str($key).' = "'.$this->db->escape_str($val).'"';
> 				}
> 			$sqlWhereString = ' AND '.implode(' AND ', $tmpSqlArray);
> 			}
> 		
> 		$sql = 'SELECT COUNT(*) AS anzahl FROM '.$this->tablename.' WHERE 1=1'.$sqlWhereString;
> 		$result = $this->db->query($sql)->row_array();
> 		
> 		if($result['anzahl']>0) return $result['anzahl'];
> 		
> 		return 0;
> 		}
> 		
> 		
> 		
> 		
> 		
> 	/*
>    *  Funktion zur intrnen Verwendung: Retourniert die 
>    * @return string Returns the parsed SQL query
>    */
>   protected function _getSqlOrderBy($orderBy) {
>     
> 		if(is_string($orderBy)) return ' ORDER BY '.$orderBy;
>     if(!is_array($orderBy) || count($orderBy)==0) return '';
>     
> 		$tmpOrderBy = array();
> 		foreach ($orderBy as $key => $dir) {
> 			$tmpOrderBy[] = $key.' '.strtoupper($dir);
> 			}
> 			
> 		//Now implode the Values to one string
> 		if(count($tmpOrderBy)>0) return ' ORDER BY '.implode(',', $tmpOrderBy);
> 		else return '';
> 		
>     }
> 	
> 	
> 	/*
>    *  Funktion zur intrnen Verwendung: Retourniert die 
>    * @return string Returns the parsed SQL query
>    */
>   protected function _getSqlSearch($searchString, $searchFields) {
> 		
> 		//Search String must not be shorter than 3 signs
>     $searchString = trim($searchString);
>     if(strlen($searchString)<3) return '';
>     //Search Fields must be set
> 		if(!is_array($searchFields) || count($searchFields)==0) return '';
> 		
> 		$tmpSearch = array();
> 		foreach ($searchFields as $field) {
> 			$tmpSearch[] = $field.' LIKE \'%'.$this->db->escape_like_str($searchString).'%\'';
> 			}
> 		//Now implode the Values to one string
> 		return ' AND ('.implode(' OR ', $tmpSearch).')';
>     }
> 	
> 	/*
>    *  Funktion zur intrnen Verwendung: Retourniert die 
>    * @return string Returns the parsed SQL query
>    */
>   protected function _getSqlLimit($start, $elements) {
>     $start = (!is_numeric($start)) ? 0 : $start;
>     if(!(is_numeric($elements) && $elements>0)) $elements = 30;
> 		return ' LIMIT '.$start.', '.$elements;
>     }
> 	
> 	
> 	
> 	
>   }

I hope this is helpful. Thanks in advance!

Please try Help > Troubleshooting > Reset CodeIntel Database

Thanks, I’ve logged a bug: https://github.com/Komodo/KomodoEdit/issues/2241

As for the “database is locked” errors, you might need to try resetting your codeintel database again as nathanr suggested.

Thanks for your help - resetting the codeintel database has no positive effect, i’ve done this several times. The errors from the log were generated about 5 minutes after reset.