{"id":851,"date":"2022-08-30T15:08:14","date_gmt":"2022-08-30T15:08:14","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/getting-unknown-transaction-error-in-codeigniter-using-mamp-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:08:14","modified_gmt":"2022-08-30T15:08:14","slug":"getting-unknown-transaction-error-in-codeigniter-using-mamp-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/getting-unknown-transaction-error-in-codeigniter-using-mamp-collection-of-common-programming-errors\/","title":{"rendered":"getting unknown transaction error in codeigniter using MAMP-Collection of common programming errors"},"content":{"rendered":"<p>I am using MAMP and codeigniter framework.<\/p>\n<p>Am facing a very weird problem. There is an active record statement where i write.<\/p>\n<pre><code>$this-&gt;db-&gt;select('user_vcard.pro_pic_filename AS `author_pro_pic_filepath`');\n<\/code><\/pre>\n<p>If i use <code>AS author_pro_pic_filepath<\/code> in the CI statement, after executing the HTTP request I get a SERVER ERROR. Then if i try to refresh the page, my browser stalls for a long time and then, at one point, it says<\/p>\n<pre><code>Error Number: 1205.\nLock wait timeout exceeded; try restarting transaction\n<\/code><\/pre>\n<p>However, if i replace <code>AS author_pro_pic_filepath<\/code> with ANY OTHER NAME, it works just fine.<\/p>\n<p>Here are somethings i tried to do to solve the problem:<\/p>\n<ol>\n<li>I exported a .sql dump of the database and kept it in a safe place<\/li>\n<li>I tried dropping all tables.<\/li>\n<li>I tried dropping the entire database.<\/li>\n<li>I cleared all MySQL user privileges from the tables<\/li>\n<li>I cleared all cookies, session data from my browser<\/li>\n<li>I tried on both Safari and Chrome<\/li>\n<li>I tried shutting down MAMP.<\/li>\n<li>I tried shutting down my laptop.<\/li>\n<li>I tried doing all the above together.<\/li>\n<li>I also tried turning off all transaction statements inside my codeigniter code.<\/li>\n<\/ol>\n<p><strong>No change in result<\/strong>. It is always behaving like I mentioned above.<\/p>\n<p>I have used this same active record statement in several other files in my app. Everywhere it is working fine. But only in this ONE particular file I am facing the issue mentioned above.<\/p>\n<p>result of SQL query: SHOW ENGINE INNODB MUTEX;<\/p>\n<pre><code>Rows: 2\n\nType    InnoDB  \nName    \/users\/severin\/MAMPexp\/MAMP_packages\/mysql-5.5.9\/storage\/innobase\/srv\/srv0srv.c:1030    \nStatus  os_waits=1\n\nType    InnoDB\nName    \/users\/severin\/MAMPexp\/MAMP_packages\/mysql-5.5.9\/storage\/innobase\/log\/log0log.c:832 \nStatus  os_waits=7\n<\/code><\/pre>\n<p>result of SQL query: SHOW ENGINE INNODB MUTEX;<\/p>\n<pre><code>Rows: 1\n\nType    InnoDB      \nName    \nStatus  \n=====================================\n120426 18:39:04 INNODB MONITOR OUTPUT\n=====================================\nPer second averages calculated from the last 5 seconds\n-----------------\nBACKGROUND THREAD\n-----------------\nsrv_master_thread loops: 56 1_second, 56 sleeps, 5 10_second, 8 background, 8 flush\nsrv_master_thread log flush and writes: 57\n----------\nSEMAPHORES\n----------\nOS WAIT ARRAY INFO: reservation count 8, signal count 8\nMutex spin waits 2, rounds 31, OS waits 1\nRW-shared spins 7, rounds 210, OS waits 7\nRW-excl spins 0, rounds 0, OS waits 0\nSpin rounds per wait: 15.50 mutex, 30.00 RW-shared, 0.00 RW-excl\n------------\nTRANSACTIONS\n------------\nTrx id counter 8BCB\nPurge done for trx's n:o &lt; 8BBD undo n:o &lt; 0\nHistory list length 149\nLIST OF TRANSACTIONS FOR EACH SESSION:\n---TRANSACTION 0, not started, OS thread id 4531712000\nMySQL thread id 55, query id 926 localhost root\nSHOW ENGINE INNODB STATUS\n---TRANSACTION 8BBB, not started, OS thread id 4531163136\nMySQL thread id 44, query id 820 localhost doc2doc\n---TRANSACTION 8BBD, ACTIVE 486 sec, OS thread id 4531437568\n3 lock struct(s), heap size 376, 2 row lock(s), undo log entries 1\nMySQL thread id 45, query id 831 localhost doc2doc\nTrx read view will not see trx with id &gt;= 8BBE, sees &lt; 8BBE\n--------\nFILE I\/O\n--------\nI\/O thread 0 state: waiting for i\/o request (insert buffer thread)\nI\/O thread 1 state: waiting for i\/o request (log thread)\nI\/O thread 2 state: waiting for i\/o request (read thread)\nI\/O thread 3 state: waiting for i\/o request (read thread)\nI\/O thread 4 state: waiting for i\/o request (read thread)\nI\/O thread 5 state: waiting for i\/o request (read thread)\nI\/O thread 6 state: waiting for i\/o request (write thread)\nI\/O thread 7 state: waiting for i\/o request (write thread)\nI\/O thread 8 state: waiting for i\/o request (write thread)\nI\/O thread 9 state: waiting for i\/o request (write thread)\nPending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,\nibuf aio reads: 0, log i\/o's: 0, sync i\/o's: 0\nPending flushes (fsync) log: 0; buffer pool: 0\n413 OS file reads, 520 OS file writes, 381 OS fsyncs\n0.00 reads\/s, 0 avg bytes\/read, 0.00 writes\/s, 0.00 fsyncs\/s\n-------------------------------------\nINSERT BUFFER AND ADAPTIVE HASH INDEX\n-------------------------------------\nIbuf: size 1, free list len 0, seg size 2, 0 merges\nmerged operations:\ninsert 0, delete mark 0, delete 0\ndiscarded operations:\ninsert 0, delete mark 0, delete 0\nHash table size 276707, node heap has 1 buffer(s)\n0.00 hash searches\/s, 0.00 non-hash searches\/s\n---\nLOG\n---\nLog sequence number 5050799\nLog flushed up to   5050799\nLast checkpoint at  5050799\n0 pending log writes, 0 pending chkp writes\n370 log i\/o's done, 0.00 log i\/o's\/second\n----------------------\nBUFFER POOL AND MEMORY\n----------------------\nTotal memory allocated 137363456; in additional pool allocated 0\nDictionary memory allocated 114130\nBuffer pool size   8192\nFree buffers       7736\nDatabase pages     455\nOld database pages 0\nModified db pages  0\nPending reads 0\nPending writes: LRU 0, flush list 0, single page 0\nPages made young 0, not young 0\n0.00 youngs\/s, 0.00 non-youngs\/s\nPages read 402, created 53, written 322\n0.00 reads\/s, 0.00 creates\/s, 0.00 writes\/s\nBuffer pool hit rate 1000 \/ 1000, young-making rate 0 \/ 1000 not 0 \/ 1000\nPages read ahead 0.00\/s, evicted without access 0.00\/s\nLRU len: 455, unzip_LRU len: 0\nI\/O sum[0]:cur[0], unzip sum[0]:cur[0]\n--------------\nROW OPERATIONS\n--------------\n0 queries inside InnoDB, 0 queries in queue\n2 read views open inside InnoDB\nMain thread id 4506259456, state: waiting for server activity\nNumber of rows inserted 507, updated 2, deleted 0, read 1679\n0.00 inserts\/s, 0.00 updates\/s, 0.00 deletes\/s, 0.00 reads\/s\n----------------------------\nEND OF INNODB MONITOR OUTPUT\n============================\n<\/code><\/pre>\n<ol>\n<li>\n<p>OMG&#8230;&#8230;&#8230;.. I have just proven myself to be a <strong><em><code>big time dumb ass<\/code><\/em><\/strong> after having spent 2 days trying to figure this out.<\/p>\n<p>I was calling a helper function while I had not loaded the helper beforehand.<\/p>\n<p>Pardon my idiocy.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:49:00. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am using MAMP and codeigniter framework. Am facing a very weird problem. There is an active record statement where i write. $this-&gt;db-&gt;select(&#8216;user_vcard.pro_pic_filename AS `author_pro_pic_filepath`&#8217;); If i use AS author_pro_pic_filepath in the CI statement, after executing the HTTP request I get a SERVER ERROR. Then if i try to refresh the page, my browser stalls [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-851","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=851"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/851\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}