Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2016
    Location
    Colorado
    Posts
    34
    Plugin Contributions
    0

    Default Excel Populate gives 500 server error for Populate from file

    I just installed Zencart 1.54 (fresh install using the test db) and wanted to try the plugin Excel Populate. Does it work with 1.54? It installs ok and exports an Excel file, but if I try to "populate from file", I get a 500 server error. My server is unsing PHP 5.6. I set the Excel file permissions to 777.
    Any ideas?
    Thanks.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Excel Populate gives 500 server error for Populate from file

    Excel file permissions to 777
    You can try "755"
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Excel Populate gives 500 server error for Populate from file

    Many servers may not like/allow other than 644.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Excel Populate gives 500 server error for Populate from file

    Check your store's /logs folder for any myDEBUG-adm-*.log file that identifies the details of the error. Remember, though, if you post that log-file's contents, that your secret admin folder name will be "called out" in that information so you'll want to xxx-it-out before posting.

  5. #5
    Join Date
    Feb 2016
    Location
    Colorado
    Posts
    34
    Plugin Contributions
    0

    Default Re: Excel Populate gives 500 server error for Populate from file

    The log file shows:
    [25-Feb-2016 20:14:06 America/Los_Angeles] PHP Notice: Undefined index: in .../includes/excel/oleread.inc on line 138

    Line 138 is:
    $sbdBlock = $this->bigBlockChain[$sbdBlock];


    What does this mean?
    Attached Files Attached Files

  6. #6
    Join Date
    Feb 2019
    Location
    Portugal
    Posts
    5
    Plugin Contributions
    0

    Default Re: Excel Populate gives 500 server error for Populate from file

    I have had the same problem, that when I try to populate an excel file it is giving me 500 error, in the debug file the error it gives me is the following:

    [18-Feb-2019 15:59:46 America/Los_Angeles] PHP Notice: Undefined index: in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 138
    [18-Feb-2019 15:59:46 America/Los_Angeles] PHP Notice: Undefined index: in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 138
    [18-Feb-2019 15:59:46 America/Los_Angeles] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 27

    [18-Feb-2019 15:59:46 America/Los_Angeles] Request URI: /store/Admin/excel.php?action=populate&filename=products_20190218152224.xls, IP address: 176.79.128.18
    --> PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 27.

    line 27 of my file is where the return is:
    Code:
    function GetInt4d($data, $pos) {
            return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24); 
    }
    line 138 of my file is:

    Code:
    while ($sbdBlock != -2) {
    	      $pos = ($sbdBlock + 1) * BIG_BLOCK_SIZE;
    	
    	      for ($j = 0; $j < BIG_BLOCK_SIZE / 4; $j++) {
    	        $this->smallBlockChain[$index] = GetInt4d($this->data, $pos);
    	        $pos += 4;
    	        $index++;
    	      }
    	
    	      $sbdBlock = $this->bigBlockChain[$sbdBlock]; // line 138
    }
    I would like to know how to fix the problem.
    Thanks.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Excel Populate gives 500 server error for Populate from file

    Quote Originally Posted by jsimoes1997 View Post
    I have had the same problem, that when I try to populate an excel file it is giving me 500 error, in the debug file the error it gives me is the following:

    [18-Feb-2019 15:59:46 America/Los_Angeles] PHP Notice: Undefined index: in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 138
    [18-Feb-2019 15:59:46 America/Los_Angeles] PHP Notice: Undefined index: in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 138
    [18-Feb-2019 15:59:46 America/Los_Angeles] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 27

    [18-Feb-2019 15:59:46 America/Los_Angeles] Request URI: /store/Admin/excel.php?action=populate&filename=products_20190218152224.xls, IP address: 176.79.128.18
    --> PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 27.

    line 27 of my file is where the return is:
    Code:
    function GetInt4d($data, $pos) {
            return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24); 
    }
    line 138 of my file is:

    Code:
    while ($sbdBlock != -2) {
    	      $pos = ($sbdBlock + 1) * BIG_BLOCK_SIZE;
    	
    	      for ($j = 0; $j < BIG_BLOCK_SIZE / 4; $j++) {
    	        $this->smallBlockChain[$index] = GetInt4d($this->data, $pos);
    	        $pos += 4;
    	        $index++;
    	      }
    	
    	      $sbdBlock = $this->bigBlockChain[$sbdBlock]; // line 138
    }
    I would like to know how to fix the problem.
    Thanks.
    Looks like during execution data being sent to or available from the GetInt4d function is not "neatly" always 4 characters at the end of the data to be processed. Not sure if this will resolve the issue; however, suggest trying:
    Code:
    function GetInt4d($data, $pos) {
            for ($i = 0; $i < 4; $i++) {
                if (!isset($data[$pos + $i])) {
                  $data[$pos + $i] = '';
                }
            }
            return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24); 
    }
    line 138 of my file is:

    Code:
    while ($sbdBlock != -2) {
    	      $pos = ($sbdBlock + 1) * BIG_BLOCK_SIZE;
    	
    	      for ($j = 0; $j < BIG_BLOCK_SIZE / 4; $j++) {
    	        $this->smallBlockChain[$index] = GetInt4d($this->data, $pos);
    	        $pos += 4;
    	        $index++;
    	      }
    	
                  if (!(isset($this->bigBlockChain[$sbdBlock]) || in_array($sbdBlock, $this->bigBlockChain))) {
                      break; // Leave the loop if the array key does not exist testing against first if the location has a value other than null then if it is null to see if the specific key is in the array allowing operation to continue if the key exists.
                  }
    	      $sbdBlock = $this->bigBlockChain[$sbdBlock]; // line 138
    }
    Perhaps could try the change to the first code block before applying the change to the second code block. Not sure the impact of operation downstream from this change as there appears to be an expectation that $sbdBlock is equal to -2 at the completion of this loop by modifying other variables. I also haven't downloaded and reviewed the previously provided zip file to see what is affected downstream. It may be that the code had been written to try to take advantage of earlier php style execution that treated missing array keys in a particular way instead of ensuring that all data was present for processing.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Feb 2019
    Location
    Portugal
    Posts
    5
    Plugin Contributions
    0

    Default Re: Excel Populate gives 500 server error for Populate from file

    Quote Originally Posted by mc12345678 View Post
    Looks like during execution data being sent to or available from the GetInt4d function is not "neatly" always 4 characters at the end of the data to be processed. Not sure if this will resolve the issue; however, suggest trying:
    Code:
    function GetInt4d($data, $pos) {
            for ($i = 0; $i < 4; $i++) {
                if (!isset($data[$pos + $i])) {
                  $data[$pos + $i] = '';
                }
            }
            return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24); 
    }
    line 138 of my file is:

    Code:
    while ($sbdBlock != -2) {
    	      $pos = ($sbdBlock + 1) * BIG_BLOCK_SIZE;
    	
    	      for ($j = 0; $j < BIG_BLOCK_SIZE / 4; $j++) {
    	        $this->smallBlockChain[$index] = GetInt4d($this->data, $pos);
    	        $pos += 4;
    	        $index++;
    	      }
    	
                  if (!(isset($this->bigBlockChain[$sbdBlock]) || in_array($sbdBlock, $this->bigBlockChain))) {
                      break; // Leave the loop if the array key does not exist testing against first if the location has a value other than null then if it is null to see if the specific key is in the array allowing operation to continue if the key exists.
                  }
    	      $sbdBlock = $this->bigBlockChain[$sbdBlock]; // line 138
    }
    Perhaps could try the change to the first code block before applying the change to the second code block. Not sure the impact of operation downstream from this change as there appears to be an expectation that $sbdBlock is equal to -2 at the completion of this loop by modifying other variables. I also haven't downloaded and reviewed the previously provided zip file to see what is affected downstream. It may be that the code had been written to try to take advantage of earlier php style execution that treated missing array keys in a particular way instead of ensuring that all data was present for processing.


    In the debug file gives me this error:

    Code:
    [22-Feb-2019 14:42:18 America/Los_Angeles] PHP Notice:  Undefined index:  in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 175
    [22-Feb-2019 14:42:18 America/Los_Angeles] PHP Notice:  Undefined index:  in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 175
    [22-Feb-2019 14:42:18 America/Los_Angeles] PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 65798145 bytes) in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 173
    
    [22-Feb-2019 14:42:18 America/Los_Angeles] Request URI: /store/Admin/excel.php?action=populate&filename=products_20190218152224.xls, IP address: 176.79.128.18
    --> PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 65798145 bytes) in /opt/bitnami/apache2/htdocs/store/Admin/includes/excel/oleread.inc on line 173.
    I made the changes and now it's the error on line 173.

    Code:
         function __readData($bl) {
            $block = $bl;
            $pos = 0;
            $data = '';
            
            while ($block != -2)  {
                $pos = ($block + 1) * BIG_BLOCK_SIZE;
                $data = $data.substr($this->data, $pos, BIG_BLOCK_SIZE);
                //echo "pos = $pos data=$data\n";	
    	    $block = $this->bigBlockChain[$block];
            }
    		return $data;
         }
    If it is possible to send the file with which it is not giving an error.

    Thank you

  9. #9
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Excel Populate gives 500 server error for Populate from file

    Assuming that the file being processed is properly formatted for this plugin including whatever line endings may be expected or other information, then I would suggest doing in this while loop, the same thing that was done in the second set of code provided a few pages back. Thing is I'm not familiar with this code and have no idea if these changes are going to result in a successful run or not.

    So, would suggest, right or wrong, for this section of code to be similar to the following:
    Code:
         function __readData($bl) {
            $block = $bl;
            $pos = 0;
            $data = '';
            
            while ($block != -2)  {
                $pos = ($block + 1) * BIG_BLOCK_SIZE;
                $data = $data.substr($this->data, $pos, BIG_BLOCK_SIZE);
                //echo "pos = $pos data=$data\n";
                if (!(isset($this->bigBlockChain[$block]) || in_array($block, $this->bigBlockChain))) {
                  break;
                } 	
    	    $block = $this->bigBlockChain[$block];
            }
    		return $data;
         }
    Apologies if the above code has "#"s in it. I copied and pasted the code which may result in them being present where a space would be expected.

    So, something that still seems a little off is that it almost seems as if the code is expecting a particular sequence of information that would be or resolve to -2. I don't know what that is/was supposed to be, but sometime after the code was written, something is not quite right. This effort may resolve to nothing legible.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 Difference between easy populate and Excel Populate
    By Kevin205 in forum General Questions
    Replies: 7
    Last Post: 22 Jan 2013, 04:33 AM
  2. Can't find Excel Populate output file
    By drewtracy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 14 Feb 2011, 04:25 PM
  3. GoDaddy 500 Internal Server Error when uploading Easy Populate
    By peedeefish in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 3 Nov 2010, 08:20 PM
  4. Easy Populate CSV: problem when open Complete File in excel
    By henryvuong in forum All Other Contributions/Addons
    Replies: 14
    Last Post: 25 Feb 2009, 12:15 AM
  5. Easy Populate won't work with Excel text file, only Text Edit file.
    By anduril3019 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Jan 2007, 04:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR