Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Help Needed. Service Unavailable - Uncaught Exception Rate Topic   - - - - -

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 12 February 2018 - 04:50 PM #1

We are randomly and intermittently getting the following error on our home page using cs-cart 4.5.2SP2.

 

Any suggestions?  I have no idea what Pimple is or what it is used for.  Refreshing the page [F5] always gets rid of the error.

 

<!--
 
PHP Fatal Error
 
Message
Uncaught exception 'InvalidArgumentException' with message 'Identifier "view" is not defined.' in /home/homescho/public_html/app/lib/vendor/pimple/pimple/src/Pimple/Container.php:95
Stack trace:
#0 /home/homescho/public_html/app/Tygh/Registry.php(104): Pimple\Container->offsetGet('view')
#1 /home/homescho/public_html/app/functions/fn.cart.php(3340): Tygh\Registry::get('view')
#2 /home/homescho/public_html/app/functions/fn.cart.php(1661): fn_calculate_cart_content(Array, Array, 'S', false, 'I', false)
#3 /home/homescho/public_html/app/functions/fn.users.php(1354): fn_extract_cart_content(Array, '2', 'C')
#4 /home/homescho/public_html/app/functions/fn.users.php(2523): fn_init_user_session_data(Object(Tygh\Web\Session), '2')
#5 /home/homescho/public_html/app/functions/fn.init.php(590): fn_login_user('2')
#6 [internal function]: fn_init_user()
#7 /home/homescho/public_html/app/functions/fn.init.php(996): call_user_func_array('fn_init_user', Array)
#8 /home/homescho/public_html/init.php(150): fn_init(Array)
#9 /ho
 
Error at
app/lib/vendor/pimple/pimple/src/Pimple/Container.php, line: 95
 
Backtrace
 

--> 



 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 558 posts

Posted 12 February 2018 - 05:23 PM #2

I have no idea what Pimple is or what it is used for.  Refreshing the page [F5] always gets rid of the error.

 

https://pimple.symfony.com/


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 553 posts

Posted 12 February 2018 - 05:56 PM #3

Hello,

 

This would require server-side investigation. Contact either the CS-Cart helpdesk or feel free to contact us at info@poppedweb.com

 

Best wishes,


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 12 February 2018 - 05:57 PM #4

Yes, I see what pimple is, but what does the error mean and how to correct? 



 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 553 posts

Posted 12 February 2018 - 05:58 PM #5

Yes, I see what pimple is, but what does the error mean and how to correct? 

 

Like I said, we can't see from here. We need to know which add-ons you have, what core modifications you have done, PHP version, etc.


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 12 February 2018 - 08:59 PM #6

From the stack trace provided, it is trying to retrieve the current template "view" from the registry but for some reason it is undefined.

As @popedweb states, it must be investigated on your server since 1) it is intermittent (which means sometimes it works and sometimes doesn't) and 2) That is is probably NOT related to the registry at all, but rather to the template engine itself. There is probably a different error ahead of this one in your error_log that will probably point more directly to the actual problem rather than the symptom.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3871 posts

Posted 13 February 2018 - 12:17 AM #7

http://forum.cs-cart...le&fromsearch=1



 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 13 February 2018 - 12:27 AM #8

I saw that the other day and tried it. Still a NOGO. 

 

 



 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 13 February 2018 - 01:01 AM #9

OK, I think I found the cause. Now how to fix.

 

I have some modified code in fn.cart.php that says

 

if (strlen($arrive['3'])>1) {Registry::get('view')->assign('arrive3', $arrive['3']);}

 

It appears for some reason, sometimes 'view' is not defined and Registry::get('view') is throwing an error. 

 

Why?

 

and I have 

 

use Tygh\Registry;



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 13 February 2018 - 01:50 AM #10

Generally a Registry::get('something") will return false if "something" is not set.  You can use an ifGet(value, default) but then what would you do if it's not set?

 

So the reason it's not set is most likely that you are trying to reference the 'view' before the templater is initialized (which is where the 'view' is set).  Are you doing this in an addon?  Addons init.,php files are usually run AFTER all the standard init() routines are performed.  If you're modifying distributed code then you are probably trying to reference it before the templater is initialized.

 

Suggest you verify at what point in the page loading process you are getting the 'view'.

 

To help any further, would need more detail on what/how you're doing what you are doing.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 13 February 2018 - 02:07 AM #11

Yes, I believe you are correct about the templater getting initialized, but weird how the error is very intermittent.

 

Its for an addon, but I modified the app/functions/fn.cart.php directly in order to pass some variables. It all works fine (has been for years), but very intermittently we get this view error.  

 

In fn.cart.php (around line 3325), I added:

foreach ($group['shippings'] as $shipping_id => $shipping) {
			
			
			//	if ($shipping_id == 40) {continue 1;}
			// DAVID MOD FOR ARRIVE DATE
                    //echo $shipping_id.'<br>';
                    $arrive  = arriveDate($shipping_id);  //call function and pass in $shipping_id              
                   
                    //  Assign smarty variables to PHP array indexes
                    if (strlen($arrive['3'])>1) {Registry::get('view')->assign('arrive3', $arrive['3']);}
                    if (strlen($arrive['11'])>1) {Registry::get('view')->assign('arrive11', $arrive['11']);}
                    if (strlen($arrive['12'])>1) {Registry::get('view')->assign('arrive12', $arrive['12']);}
                    if (strlen($arrive['13'])>1) {Registry::get('view')->assign('arrive13', $arrive['13']);}
                    
                    //GROUND BY ZONES
                    if (strlen($arrive['111'])>1) {Registry::get('view')->assign('zone1', $arrive['111']);}
                    if (strlen($arrive['112'])>1) {Registry::get('view')->assign('zone2', $arrive['112']);}
                    if (strlen($arrive['113'])>1) {Registry::get('view')->assign('zone3', $arrive['113']);}
                    if (strlen($arrive['114'])>1) {Registry::get('view')->assign('zone4', $arrive['114']);}
                    if (strlen($arrive['115'])>1) {Registry::get('view')->assign('zone5', $arrive['115']);}
                    
            // END DAVID MOD FOR ARRIVE DATE


 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 13 February 2018 - 02:19 AM #12

Do you see any harm (or will it help) if I add
fn_init_stack(array('fn_init_templater'));
before the foreach line of code?
 
I tried it and so far no error, but the problem is intermittent.


 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 13 February 2018 - 06:03 PM #13

Unfortunately we have seen the error once today.  So my fix didn't help.

 

It does appear to be the Admin who sees it the most when switching to Frontend. Can it be related to the Admin logging in with multiple accounts or acting on behalf of?  We are not sure if customers are seeing the intermittent error.

 

David



 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 553 posts

Posted 13 February 2018 - 06:10 PM #14

Hello,

 

The only thing I could think of is that you have created / edited an order and then decide to view the admin panel (without a user session --> sid_customer_*) thus causing this bug (because it will try and calculate the cart of the admin perhaps?).

 

Kind regards,


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11442 posts

Posted 13 February 2018 - 06:52 PM #15

I can guess till the cows come home.

Best practice would be never modify core files. Always use addons.  If you need to modify a core file, do it as a hook and then make a hook request in the developer area (sticky post).  Never do anything in an addon's config.php file that expects other areas of the system to be initialized (I.e. init follows config).


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Takestock
  • Senior Member
  • Members
  • Join Date: 08-Nov 13
  • 483 posts

Posted 20 October 2018 - 04:51 PM #16

I can guess till the cows come home.

Best practice would be never modify core files. Always use addons.  If you need to modify a core file, do it as a hook and then make a hook request in the developer area (sticky post).  Never do anything in an addon's config.php file that expects other areas of the system to be initialized (I.e. init follows config).

I have also started to see this error, very intermitant only since updating to the latest version of CS-cart

 

Alan



 
  • amdowney
  • Senior Member
  • Members
  • Join Date: 22-Oct 14
  • 269 posts

Posted 08 January 2020 - 02:49 PM #17

I'm getting this also using a 3rd party addon we need working, very frustrating as they are saying it's CS Carts fault...

 

Any more ideas or how anyone above resolved this?

#0 /home/cctvkits/public_html/app/Tygh/Registry.php(105): Pimple\Container->offsetGet('view')
#1 /home/cctvkits/public_html/app/addons/product_package_builder/func.php(366): Tygh\Registry::get('view')
#2 /home/cctvkits/public_html/app/functions/fn.control.php(120): fn_product_package_builder_get_product_data(63, '?:products.*, ?...', ' LEFT JOIN ?:pr...', Array, 'en', ' AND (companies...')
#3 /home/cctvkits/public_html/app/functions/fn.catalog.php(181): fn_set_hook('get_product_dat...', 63, '?:products.*, ?...', ' LEFT JOIN ?:pr...', Array, 'en', ' AND (companies...')
#4 /home/cctvkits/public_html/app/addons/product_package_builder/func.php(686): fn_get_product_data(63, Array, 'en', '?:products.*, ?...', true, true, true, true)
#5 /home/cctvkits/public_html/app/functions/fn.control.php(120): fn_product_package_builder_get_o

 


Stores: CCTV Kits & www.jmtb.co.uk

 
  • soft-solid
  • Junior Member
  • Authorized Reseller
  • Join Date: 19-Apr 10
  • 997 posts

Posted 08 January 2020 - 11:09 PM #18

Hello

 

This addon has no producer support? Does this addon have open code or is it encoded?

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19982 posts

Posted 09 January 2020 - 05:12 AM #19

 

I'm getting this also using a 3rd party addon we need working, very frustrating as they are saying it's CS Carts fault...

 

Any more ideas or how anyone above resolved this?

 

 

It is hard to say anything without detailed code examination


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • amdowney
  • Senior Member
  • Members
  • Join Date: 22-Oct 14
  • 269 posts

Posted 11 January 2020 - 12:10 PM #20

Hi and thanks - they are looking at it now but it is hard to recreate the issue reliably. It's not encoded. They have setup logging on the dev store apparently. Thought logs were under var/log but don't seem to have such a directory?


Stores: CCTV Kits & www.jmtb.co.uk