Author Topic: [Solved] Synchronize Media keeps asking me to re-synchronize...  (Read 4583 times)

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
[Solved] Synchronize Media keeps asking me to re-synchronize...
« on: October 24, 2011, 17:17:44 pm »
I'm stuck on this one...  I'm running VM 1.9.8j version 4534 (Updated to HEAD this morning after I started having a problem) on Joomla! 1.7.0

It might be because I'm running the site on XAMPP right now but I hit syncronize media button and it says following:
        Found prior migration process, resume migration maxScriptTime 26 maxMemoryLimit 96
        Synchronized 401 media for product in directory images/stories/virtuemart/product/
        The synchronisation is not finished, please execute again

I click again I get same info with a different Synchronized number... and again and again... I click it like 20 times and it never finished.  I have around 850 images in the database right now.   It seems like it's not finding the correct previous process to me but I'm not sure to be honest.

I'm going to take this revision to my live server and see if I get same result. 
- Cleanshooter

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #1 on: October 24, 2011, 17:20:27 pm »
Just double checked that I had updated my tables and turned on my vmdebug...

vmdebug confirms that it's re-sychronizing the same file every time becuase the same product ID #s are showing up over and over.

Now I just need to figure out why.
- Cleanshooter

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10373
  • VirtueMart Version: 3+
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #2 on: October 24, 2011, 17:51:16 pm »
I think it only works on main image, not additional image.

IS that your case? 
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #3 on: October 24, 2011, 18:00:13 pm »
I am talking about the "Synchronize Media to Virtuemart" button in the: Shop > Media Files section...

It used to synchronize the entire folder when I added new images now it just keeps asking me to resynchronize.

I also just discovered something interesting...

I put a debug in the migrator.php line 214
vmdebug("Stored Medias Array", print_r($this->storedMedias));

I suspect I might be using this funciton wrong but the output was rather odd...

vmdebug Stored Medias Array Var1:

1

I was expecting an array of all of my media ids in the database but I only got one id... I could be reading the code wrong here but it seems like this array should be larger...
I'll keep digging

-Cleanshooter
- Cleanshooter

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9968
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #4 on: October 24, 2011, 18:31:08 pm »
I am quite sure the problem is not in the exeSortSearchListQuery.

Maybe in the table storing the migration process is an error.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #5 on: October 24, 2011, 18:41:12 pm »
Yeah after further digging it definitely wasn't the exeSortSearchListQuery... ( I couldn't even find it ).

It's just odd to me that when I vmdebug the the $this->_data form the getFiles funciton in the media.php I can see the data needed but when I vmdebug it after it's called in the migrator.php ( line 211 $this->storedMedias = $this->mediaModel->getFiles(false, true, false);)  it is empty.  As in there is nothing there...

Well time for lunch here I'll keep cracking at it after lunch.

- Cleanshooter

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #6 on: October 24, 2011, 18:43:40 pm »
Maybe in the table storing the migration process is an error.

I tried resetting the virtuemart_migration_oldtonew_ids table with out any improvement...

The code recreated id 1 the way it should have then the re-synchronize started again.

@Milbo are u able to replicate issue or no?
- Cleanshooter

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #7 on: October 24, 2011, 19:33:52 pm »
It must have been a session issue.... I got logged out over lunch and when I logged back in everything was working again...

Given that once the new session started the issue disappeared I wonder if it is an issue with Joomla?  Has anyone else ever had issues that resolved them selves by logging out and logging back in? I seem to remember dealing with a similar problem not to long ago can't remember what though.
- Cleanshooter

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10373
  • VirtueMart Version: 3+
Re: [Solved] Synchronize Media keeps asking me to re-synchronize...
« Reply #8 on: October 24, 2011, 19:40:54 pm »
system cache plugin turned on?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9968
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Synchronize Media keeps asking me to re-synchronize...
« Reply #9 on: October 24, 2011, 19:46:18 pm »
It works for me. I just did it today.

BTW:
Code: [Select]
vmdebug("Stored Medias Array", print_r($this->storedMedias));
Dont use print_r in vmdebug, the function itself is doing it for you. You also can add more than one variable.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9968
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [Solved] Synchronize Media keeps asking me to re-synchronize...
« Reply #10 on: October 24, 2011, 20:15:23 pm »
BTw, the model took some JRequest variables, maybe you had them set somehow. I moved the JRequest part to the views where it is actually needed, it may make the difference, it is just a bit cleaner now.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Cleanshooter

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 69
    • My Blog
Re: [Solved] Synchronize Media keeps asking me to re-synchronize...
« Reply #11 on: October 24, 2011, 20:21:24 pm »
system cache plugin turned on?

No it's disabled...


BTW:
Code: [Select]
vmdebug("Stored Medias Array", print_r($this->storedMedias));
Dont use print_r in vmdebug, the function itself is doing it for you. You also can add more than one variable.

I thought it did but when nothing came out I tried something crazy :-P thx

BTw, the model took some JRequest variables, maybe you had them set somehow. I moved the JRequest part to the views where it is actually needed, it may make the difference, it is just a bit cleaner now.

If I run into the issue again I'll be sure to look at them so I can figure out what happened...
- Cleanshooter