Prestashop - can't upgrade - prestashop

Hi I wanted to install "1-Click Upgrade v1.6.7 - by PrestaShop" plugin, but I'm not able to because of the following error:
The following module(s) were not installed properly:
autoupgrade :
Unable to create the "AdminSelfUpgrade" tab
I have checked enabled modules and all of them are up to date and issued by PrestaShop. Could anybody help me, please?
I'm currently running PrestaShop™ 1.6.0.11.
Thanks for your help.
UPDATE: Turned on Error reporting:
[PrestaShopDatabaseException]
Unknown column 'hide_host_mode' in 'field list'
INSERT INTO `ps_tab` (`id_parent`, `position`, `module`, `class_name`, `active`, `hide_host_mode`) VALUES ('17', '10', 'autoupgrade', 'AdminSelfUpgrade', '1', '0')
at line 639 in file classes/db/Db.php
634. WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
635. }
636. elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
637. {
638. if ($sql)
639. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
640. throw new PrestaShopDatabaseException($this->getMsgError());
641. }
642. }
643.
644. /**
DbCore->displayError - [line 333 - classes/db/Db.php] - [1 Arguments]
DbCore->query - [line 613 - classes/db/Db.php] - [1 Arguments]
DbCore->q - [line 398 - classes/db/Db.php] - [2 Arguments]
DbCore->insert - [line 480 - classes/ObjectModel.php] - [3 Arguments]
ObjectModelCore->add - [line 103 - classes/Tab.php] - [2 Arguments]
TabCore->add - [line 442 - classes/ObjectModel.php] - [2 Arguments]
ObjectModelCore->save - [line 115 - classes/Tab.php]
TabCore->save - [line 74 - modules/autoupgrade/autoupgrade.php]
Autoupgrade->install - [line 828 - controllers/admin/AdminModulesController.php]
AdminModulesControllerCore->postProcessCallback - [line 1071 - controllers/admin/AdminModulesController.php]
AdminModulesControllerCore->postProcess - [line 171 - classes/controller/Controller.php]
ControllerCore->run - [line 374 - classes/Dispatcher.php]
DispatcherCore->dispatch - [line 54 - admin/index.php]

it would be a good idea if you turn on Error Reporting.
Also, do you have installed some 3rd party module that manage the admin tabs? Or at least a module that manage admin staff?
If that, try to uninstall it and delete the directory files.

Finally, I have solved it myself: There was a missing column in the ps_tab.
To fix it, you need to go to this MySQL table and add hide_host_mode column into the DV, it's a tinyint type.

Related

Restlet not launching in Linux

When I launch Restlet J2SE on linux, I am getting the following exception. Any hint ?
java.lang.ArrayIndexOutOfBoundsException: 10
at java.util.concurrent.CopyOnWriteArrayList.addAllImpl(ILjava/util/Coll ection;)V [line 1048]
at java.util.concurrent.CopyOnWriteArrayList.addAll(Ljava/util/Collectio n;)Z [line 627]
at org.restlet.service.MetadataService.addCommonExtensions()V [line 371]
at org.restlet.service.MetadataService.<init>()V [line 84]
at org.restlet.Application.<init>(Lorg/restlet/Context;)V [line 172]
at org.restlet.Application.<init>()V [line 140]
Finally I managed to solve by editing the restlet sources in ,
org.restlet.service.MetadataService
// Add all those mappings
//Note : This is not working with in PowerPC with Aionix JVM
//this.mappings.addAll(dm);
//Adding one by one works fine.
for(MetadataExtension metadataExt : dm) {
this.mappings.add(metadataExt);
}

for loop crash when iterating over array of iTunesFileTracks

New to OS x and objective C. I am getting a crash in my program reported from several users I have not been able to reproduce it on my machine.
Feb 22, 2014, 9:06:44 AM: An uncaught exception was raised
Feb 22, 2014, 9:06:44 AM: *** -[NSArray getObjects:range:]: range {3392, 16} extends beyond bounds for empty array
Feb 22, 2014, 9:06:44 AM: (
0 CoreFoundation 0x00007fff8f05541c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff94c12e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8ef9bc9f -[NSArray getObjects:range:] + 271
3 CoreFoundation 0x00007fff8ef9da63 -[NSArray countByEnumeratingWithState:objects:count:] + 163
4 MYAppMac 0x00000001000037b9 +[ITunesProvider getITunesMediaFiles:] + 5209
The line crash line points to this for loop
// Get tracks from iTunesUserPlaylist
SBElementArray *fileTracks = [list fileTracks];
for(iTunesFileTrack* track in fileTracks)
{
// my code here. I do not modify filetracks anywhere in the loop
}
The for loop iterates over the items in the array but at some point it crashes trying to access items further down. I do not modify the fileTracks array at all. Any ideas what's going on ?
Just had the same problem. You're iterating over a live array which is changing on the fly depending on what your users do with iTunes. You could try getting the array using -get and iterate over the resulting fixed NSArray like this:
NSArray* fileTracks = [[list fileTracks] get];
for (iTunesFileTrack* track in fileTracks)
{
// Your code
}

wxFlexGridSizer AddGrowableCol throwing error

I have several wxFlexGridSizers that used to work in wxWigets version 2.8.11. After upgrading the wxWidgets library to 2.9.4 I am now getting an invalid column index in wxFlexGridSizer::AddGrowableCol().
Here is a sample of the sizer that I am creating:
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 3, 2, 0, 0 );
fgSizer1->AddGrowableCol( 2 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
I tried changing the value of the AddGrowableCol() arguement to 1 because maybe I thought it might have been wrong before or something but it still throws the same error. I can include the stacktrace if that would be helpful as well.
..\..\src\common\sizer.cpp(1956): assert "!m_cols || idx < (size_t)m_cols" failed in wxFlexGridSizer::AddGrowableCol(): invalid column index
Call stack:
[00] wxGUIAppTraitsBase::ShowAssertDialog j:\wxwidgets-2.9.4\src\common\appcmn.cpp:475
[01] ShowAssertDialog j:\wxwidgets-2.9.4\src\common\appbase.cpp:1265
[02] wxAppConsoleBase::OnAssertFailure j:\wxwidgets-2.9.4\src\common\appbase.cpp:761
[03] wxDefaultAssertHandler j:\wxwidgets-2.9.4\src\common\appbase.cpp:1065
[04] wxOnAssert j:\wxwidgets-2.9.4\src\common\appbase.cpp:1141
[05] wxFlexGridSizer::AddGrowableCol j:\wxwidgets-2.9.4\src\common\sizer.cpp:1956
[06] MyFrame::MyFrame c:\users\james\documents\code\wx29starter - copy (2)\minimal.cpp:181
[07] MyApp::OnInit c:\users\james\documents\code\wx29starter - copy (2)\minimal.cpp:130
[08] wxAppConsoleBase::CallOnInit j:\wxwidgets-2.9.4\include\wx\app.h:94
[09] wxEntryReal j:\wxwidgets-2.9.4\src\common\init.cpp:456
[10] wxEntry j:\wxwidgets-2.9.4\src\msw\main.cpp:189
[11] wxEntry j:\wxwidgets-2.9.4\src\msw\main.cpp:416
[12] WinMain c:\users\james\documents\code\wx29starter - copy (2)\minimal.cpp:111
[13] __tmainCRTStartup f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:578
[14] WinMainCRTStartup f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:403
[15] BaseThreadInitThunk
[16] RtlInitializeExceptionChain
[17] RtlInitializeExceptionChain
Here is the assert code
void wxFlexGridSizer::AddGrowableCol( size_t idx, int proportion )
{
wxASSERT_MSG( !IsColGrowable( idx ),
"AddGrowableCol() called for growable column" );
// see comment in AddGrowableRow(): although it's less common to omit the
// specification of the number of columns, it still can also happen
wxCHECK_RET( !m_cols || idx < (size_t)m_cols, "invalid column index" );
m_growableCols.Add( idx );
m_growableColsProportions.Add( proportion );
}
With confirmation from winterblood changing the parameter to 1 for the call to AddGrowableCol()will solve the problem, despite your test!

Xcode exception interpretation

Can anyone tell me how to tackle this exception? The debugger is at an exception breakpoint and as you can see there seems to be zero actionable information about the exception. Where did it occur? Pretty sure it's not in my code but I'm at a loss about how to proceed...
Many thanks for any help.
Edit 1:
Here's the console contents
* Terminating app due to uncaught exception 'NSRangeException', reason: '*
-[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack: (0x30ce188f 0x3627e259 0x30c2a9db 0x8d029 0x915c5 0x35723c59 0x35725ee7 0x30cb42ad 0x30c374a5 0x30c3736d 0x36ffb439 0x32917cd5 0x72e4d 0x72de8)
terminate called throwing an exception
Edit 2:
Here's the backtrace
thread #1: tid = 0x1c03, 0x3627e238 libobjc.A.dylib`objc_exception_throw, stop reason = breakpoint 1.1
frame #0: 0x3627e238 libobjc.A.dylib`objc_exception_throw
frame #1: 0x30c2a9da CoreFoundation`-[__NSArrayM objectAtIndex:] + 270
Edit 3 (the solution):
Here's the backtrace using the main() approach
2012-08-31 10:27:21.489 <>[820:707] Uncaught exception *** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array
2012-08-31 10:27:32.908 <>[820:707] Stack trace: (
0 CoreFoundation 0x30ce18a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x3627e259 objc_exception_throw + 32
2 CoreFoundation 0x30c2a9db -[__NSArrayM objectAtIndex:] + 270
3 <> 0x00050ed1 __55-[SFSummaryCard retrieveAndDisplayFirstImageForString:]_block_invoke_0 + 148
4 <> 0x0005546d __block_global_1 + 40
5 libdispatch.dylib 0x35723c59 _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x35725ee7 _dispatch_main_queue_callback_4CF$VARIANT$mp + 194
7 CoreFoundation 0x30cb42ad __CFRunLoopRun + 1268
8 CoreFoundation 0x30c374a5 CFRunLoopRunSpecific + 300
9 CoreFoundation 0x30c3736d CFRunLoopRunInMode + 104
10 GraphicsServices 0x36ffb439 GSEventRunModal + 136
11 UIKit 0x32917cd5 UIApplicationMain + 1080
12 <> 0x00036c01 main + 220
13 <> 0x00036b20 start + 40
)
The key element being: retrieveAndDisplayFirstImageForString()
There is a problem on Xcode 4/iOS 5 that sometimes you don't get the exception traceback in the emulator, due to an apparent bug in the emulator's pseudo OS. The solution is to add an explicit traceback in your main, along the lines of
#try {
retVal = UIApplicationMain...
}
#catch (NSException* exception) {
NSLog(#"Uncaught exception %#", exception);
NSLog(#"Stack trace: %#", [exception callStackSymbols]);
}
You can make exception breakpoint print backtrace in console.
Example:
-(void)backtraceTest
{
NSArray *array = [NSArray arrayWithObjects:#"1", #"2", nil];
id obj = [array objectAtIndex:3]; // out of bounds
NSLog(#"%#", obj);
}
gives this backtrace:
You can see that at line 34 of HelloWorldLayer.m file objectAtIndex method of NSArray was called and then exception happened.
This is relevant:
http://ijoshsmith.com/2011/11/28/debugging-exceptions-in-xcode-4-2/
You can add an "exception breakpoint" that shows backtraces; event handier, you can move it to a "user breakpoint" that appears in all your projects.
Wish I had learned this trick earlier.
I was able to resolve by workaround:
Closed all open applications
relaunch Finder
run sudo find / -name ".DS_Store" -exec rm {} \;
this removes all .DS_Store old files on the computer
launch finder and set default view to "LIST VIEW" as shown here: http://macs.about.com/od/usingyourmac/ss/Setting-Finder-Views-For-Folders-And-Su b-Folders_2.htm
rerun the offending application and file chooser works

OSX - NSLog prevents application crash in debug mode

Developing an app for OSX. There's still bugs and it crashes in release builds.
However, it runs in debug builds, when there's a blank NSLog statement in a few spots. If the NSLog statements are removed, the app crashes on run.
The first statement, in a run loop (prints calculated ticks and drawn frames, it simulates a fluid in an NSView)
NSLog(#"%d ticks, %d frames", ticks, frames);
The second statement, in the tick method that gets called every loop,
NSLog(#"");
In debug mode, running from Xcode, it works just fine with these two statements. If either is removed, it crashes. After several hours searching, I can't find any reference to apps crashing without blank NSLog statements.
Edit: The final question is: Is there anything I should look out for that might be causing this?
Edit 2: The run and tick methods are
-(void) run {
timeval start = gettime();
timeval end = gettime();
float dt = 1./60;
self.E.dt = dt;
float tick = 1e6*dt;
float unprocessed;
int ticks = 0;
int frames = 0;
timeval now;
while ( TRUE ) {
now = gettime();
unprocessed += diff(end, now)/tick;
end = now;
BOOL shouldRender = true; // set false to limit framerate to tickrate
while ( unprocessed >= 1 ) {
ticks++;
[self tick];
unprocessed -= 1;
shouldRender = true;
}
if ( shouldRender ) {
frames++;
}
if ( diff(start, gettime()) > 1000000 ) {
start.tv_sec += 1;
NSLog(#"%d ticks, %d frames", ticks, frames);
frames = 0;
ticks = 0;
}
}
}
-(void) tick {
NSLog(#"");
NSDictionary* fs = [NSDictionary dictionaryWithObjectsAndKeys:self.u, #"u", self.v, #"v", self.p, #"p", self.T, "#T", nil];
NSDictionary* gs = [self.E evolve:fs];
[self.u swap:[gs objectForKey:#"u"]];
[self.v swap:[gs objectForKey:#"v"]];
[self.p swap:[gs objectForKey:#"p"]];
[self.T swap:[gs objectForKey:#"T"]];
[self.view setNeedsDisplay:YES];
}
Edit 3: This is clearly an issue with LLVM. When I compile with GCC, I get no crash. Unfortunately there's an extraordinary amount of memory leaks now due to no ARC. Confusion level increased.
Edit 4: Backtrace
Crashed Thread: 2
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010
External Modification Warnings:
Debugger attached to process.
VM Regions Near 0x10:
-->
__TEXT 0000000103a9b000-0000000103a9c000 [ 4K] r-x/rwx SM=COW /Users/USER/Library/Developer/Xcode/DerivedData/Splash-ahjwbarsbqqbuzfcnxstxpslekdi/Build/Products/Debug/Splash.app/Contents/MacOS/Splash
Application Specific Information:
objc_msgSend() selector name: copy
objc[32100]: garbage collection is OFF
Thread 2 Crashed:
0 libobjc.A.dylib 0x00007fff8e43ee90 objc_msgSend + 16
1 com.apple.CoreFoundation 0x00007fff87edf8ac -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 668
2 com.apple.CoreFoundation 0x00007fff87efcd13 +[NSDictionary dictionaryWithObjectsAndKeys:] + 1203
3 com.mbarriault.Splash 0x0000000103a9d488 -[Game tick] + 328 (Game.m:95)
4 com.mbarriault.Splash 0x0000000103a9d2a9 -[Game run] + 361 (Game.m:76)
5 com.apple.Foundation 0x00007fff9020874e -[NSThread main] + 68
6 com.apple.Foundation 0x00007fff902086c6 __NSThread__main__ + 1575
7 libsystem_c.dylib 0x00007fff8dba18bf _pthread_start + 335
8 libsystem_c.dylib 0x00007fff8dba4b75 thread_start + 13
Thread 2 crashed with X86 Thread State (64-bit):
rax: 0x0000000103aa5a00 rbx: 0x0000000000000004 rcx: 0x0000000000000000 rdx: 0x0000000000000000
rdi: 0x0000000103aa3071 rsi: 0x00007fff8f9ea7d0 rbp: 0x0000000107b47970 rsp: 0x0000000107b47900
r8: 0x0000000000000004 r9: 0x0000000103aa5ab0 r10: 0x0000000000000001 r11: 0x0000000000000000
r12: 0x0000000000000003 r13: 0x0000000107b47928 r14: 0x0000000107b479a0 r15: 0x0000000107b47980
rip: 0x00007fff8e43ee90 rfl: 0x0000000000010202 cr2: 0x0000000000000010
Logical CPU: 3
I removed ID information and the logs for threads that didn't crash, as the whole log went over the post length limit.
Edit 5: Changing the dictionary creation from NSDictionary:dictionaryWithObjectsAndKeys: to NSDictionary:dictionaryWithObjects:forKeys: seems to have fixed all my problems. I'm not entirely certain why, but I'll take it! Thanks everyone!
Edit 6: The correct answer, believe if you will, was a simple typo in a string.
From the look of the backtrace it is crashing when allocating the NSDictionary. Probably one of the object references being used to initialize the NSDictionary is invalid. If you post code from the tick method it could help narrow down what the problem is. Also, if you try debugging with NSZombie on it could tell us which object type it is crashing on.
Edit:
OK. Now that I see the tick code, I can see the problem. I didn't see it at first, but you are using the c-string "#T", which you probably intended to be #"T".