Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    851
    Plugin Contributions
    0

    red flag Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Hi

    I have just installed new 1.5.5a and for every currency I have I am getting warnings for each currency. Can anyone suggest a solution please

    =======================
    Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US Dollar (USD) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for Euro (EUR) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for GB Pound (GBP) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for Australian Dollar (AUD) - trying the secondary exchange rate server.
    =======================

    also

    TEXT_VERSION_CHECK_BUTTON showing instead of the button.
    (You are presently using: v1.5.5a)

    after clicking the link it returns to normal text as it should saying
    "Your version of Zen CartŪ appears to be current.
    (You are presently using: v1.5.5a)"
    Downunder QLD

  2. #2
    Join Date
    Jan 2004
    Posts
    64,748
    Blog Entries
    6
    Plugin Contributions
    74

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    1. Currency updates since v155 are now handled by the server which you've selected in Admin->Configuration->My Store-> primary/secondary Currency servers.
    So, if it's not finding CURRENCY_SERVER_PRIMARY that means your database wasn't upgraded or installed properly.

    2. And your english.php language file appears to be the old one, since the v155a file is correct:
    /admin/includes/languages/english.php:
    379: define('TEXT_VERSION_CHECK_BUTTON', 'Check for New Version');
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Having this exact issue after recent upgrade to V1.5.5e. How do I check database and how to resolve?

  4. #4
    Join Date
    Jan 2004
    Posts
    64,748
    Blog Entries
    6
    Plugin Contributions
    74

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Quote Originally Posted by Jacksback2 View Post
    Having this exact issue after recent upgrade to V1.5.5e. How do I check database and how to resolve?
    Since the database-upgrade step that's done via zc_install is what handles it, the first guess is that you didn't do that step?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    The upgrade was done by qualified third party, so assume it was done correctly.

    Did a test by doing a quick install of Zencart (via Softalucous) on two other hosting accounts with the same hosting company.
    Ran "update currencies" and the same error:
    Warning: The primary exchange rate server (ecb) failed for US Dollar (USD) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (ecb) failed for Euro (EUR) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (ecb) failed for GB Pound (GBP) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (ecb) failed for Canadian Dollar (CAD) - trying the secondary exchange rate server.
    on original site and the two test sites.

    Looking for common denominator so contacted hosting company but their response: Our server wouldn't control any of those values, its more of a development issue as it relates directly with the database and configuration files.

    Primary is set to ecb, but any other settings in admin that need to be changed? or any other possible solutions?
    Thanks for any help.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    6,980
    Plugin Contributions
    63

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Quote Originally Posted by Jacksback2 View Post
    The upgrade was done by qualified third party, so assume it was done correctly.

    Did a test by doing a quick install of Zencart (via Softalucous) on two other hosting accounts with the same hosting company.
    Ran "update currencies" and the same error:
    Warning: The primary exchange rate server (ecb) failed for US Dollar (USD) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (ecb) failed for Euro (EUR) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (ecb) failed for GB Pound (GBP) - trying the secondary exchange rate server.
    Warning: The primary exchange rate server (ecb) failed for Canadian Dollar (CAD) - trying the secondary exchange rate server.
    on original site and the two test sites.

    Looking for common denominator so contacted hosting company but their response: Our server wouldn't control any of those values, its more of a development issue as it relates directly with the database and configuration files.

    Primary is set to ecb, but any other settings in admin that need to be changed? or any other possible solutions?
    Thanks for any help.
    Getting the same thing here on a Zen Cart 1.5.5a store. The CURL request is receiving a 403 (Access denied), as illustrated in the following dump of the data returned by ECB:
    Code:
    [04-Aug-2017 08:53:51 America/Kentucky/Louisville] PHP Warning:  array (
      0 => '<html lang="en">',
      1 => '<head>',
      2 => '<title>European Central Bank</title>',
      3 => '<style type="text/css"> body{ font-family: "Droid Sans", sans-serif; margin:0; padding:0; background-color: #9099ab; text-align: center; } h1{  font-size:38px; font-weight: normal; color:#003299; }  @media screen and (max-width: 480px) { h1{ font-size: 30px; } }  p { font-size: 15px; line-height: 20px; color: #333; margin-bottom: 20px; }  p.signature{ font-style: italic; color:#DF0101; }  .centredFrame { margin: 0 auto; text-align: center; width: 70%;   } .content{ margin-top:40px; padding:40px; background-color: #fff; border:1px solid #CDE3E0; -moz-border-radius: 20px; border-radius: 20px; } </style>',
      4 => '<link href="http://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet" type="text/css">',
      5 => '</head>',
      6 => '<body>',
      7 => '<div class="centredFrame">',
      8 => '<div class="content">',
      9 => '<img src="http://www.ecb.europa.eu/pic_failover/ecb_logo_EN.png">',
      10 => '<h1>A problem occurred while trying to access this page</h1>',
      11 => 'We apologize for any inconvenience this might have caused.',
      12 => '<p class="signature">Reference number: xxx</p>',
      13 => '<p class="signature">HTTP status code: 403</p>',
      14 => '</div>',
      15 => '</div>',
      16 => '</body>',
      17 => '</html>',
    I've verified that I can access the ecb rates link directly, so it might be a change that ecb introduced to prevent scraping.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    6,980
    Plugin Contributions
    63

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Just poking around to see what's up, I made a slight change to /YOUR_ADMIN/includes/functions/localization.php's doCurlCurrencyRequest function, adding the line highlighted below and ... I've got currency updates!

    Please note that I'm not sure if this is the "correct" solution, but it's one that got the desired results.
    Code:
    
      function doCurlCurrencyRequest($method, $url, $vars = '') {
        //echo '-----------------<br />';
        //echo 'URL: ' . $url . ' VARS: ' . $vars . '<br />';
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_REFERER, HTTP_CATALOG_SERVER . DIR_WS_CATALOG);
        curl_setopt($ch, CURLOPT_VERBOSE, 0);
        curl_setopt($ch, CURLOPT_HEADER, false);
        curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    ...

  8. #8
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,526
    Plugin Contributions
    1

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    I have not been kept the currencies updated as frequently lately, so I do not know when the issue began here.
    zc 1.5.4


    Success The exchange rate for US Dollar (USD) was updated successfully via ecb.
    Warning Warning: The primary exchange rate server (ecb) failed for Euro (EUR) - trying the secondary exchange rate server.
    Error Error: The exchange rate for Euro (EUR) was not updated via boc. Is it a valid currency code?
    Warning Warning: The primary exchange rate server (ecb) failed for GB Pound (GBP) - trying the secondary exchange rate server.
    Error Error: The exchange rate for GB Pound (GBP) was not updated via boc. Is it a valid currency code?
    Warning Warning: The primary exchange rate server (ecb) failed for Canadian Dollar (CAD) - trying the secondary exchange rate server.
    Error Error: The exchange rate for Canadian Dollar (CAD) was not updated via boc. Is it a valid currency code?
    Warning Warning: The primary exchange rate server (ecb) failed for Australian Dollar (AUD) - trying the secondary exchange rate server.
    Error Error: The exchange rate for Australian Dollar (AUD) was not updated via boc. Is it a valid currency code?
    Warning Warning: The primary exchange rate server (ecb) failed for New Zealand Dollar (NZD) - trying the secondary exchange rate server.
    Error Error: The exchange rate for New Zealand Dollar (NZD) was not updated via boc. Is it a valid currency code?
    Last edited by RixStix; 4 Aug 2017 at 02:51 PM.
    Rick
    ChainWeavers (dot) com

  9. #9
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,526
    Plugin Contributions
    1

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    myDEBUGadmin
    repeated several times
    Code:
    [04-Aug-2017 06:49:27 America/Los_Angeles] PHP Warning:  Division by zero in /home/chainwea/public_html/9nd6Q536/includes/functions/localization.php on line 37
    [04-Aug-2017 06:49:27 America/Los_Angeles] Request URI: /9nd6Q536/currencies.php?page=1&cID=5&action=update_currencies, IP address: XXX.231.113.241
    #1  quote_ecb_currency() called at [/home/chainwea/public_html/XXX/currencies.php:99]
    
    [04-Aug-2017 06:49:27 America/Los_Angeles] PHP Warning:  Division by zero in /home/chainwea/public_html/XXX/includes/functions/localization.php on line 37
    [04-Aug-2017 06:49:27 America/Los_Angeles] Request URI: /XXX/currencies.php?page=1&cID=5&action=update_currencies, IP address: XXX.231.113.241
    #1  quote_boc_currency() called at [/home/chainwea/public_html/XXX/currencies.php:105]
    
    [04-Aug-2017 06:49:27 America/Los_Angeles] PHP Warning:  Division by zero in /home/chainwea/public_html/XXX/includes/functions/localization.php on line 64
    Rick
    ChainWeavers (dot) com

  10. #10
    Join Date
    Jan 2004
    Posts
    64,748
    Blog Entries
    6
    Plugin Contributions
    74

    Default Re: Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed for US

    Quote Originally Posted by Jacksback2 View Post
    Having this exact issue after recent upgrade to V1.5.5e. How do I check database and how to resolve?
    Okay, so actually, your issue is NOT "exactly" the same.

    The first person posting was getting "Warning: The primary exchange rate server (CURRENCY_SERVER_PRIMARY) failed".

    But yours is actually naming the primary currency exchange server code (you didn't reveal this in your very brief "me too" post). Completely different reason behind that.

    If it was actually still saying "CURRENCY_SERVER_PRIMARY" instead of the name of the server, then it would indeed have been an upgrade issue. Hence the suggestion to look in that direction.


    Yours is a different matter. You're not getting ECB rates because ECB recently enforced some rules on their database, apparently to reject incoming requests that might look like bots that are scraping data. I've run into the same issue on other servers, from various geo locations and various hosting companies.

    There are several suggested workarounds:
    a) lat9's suggestion above to specify a referrer.
    b) change your primary currency server to the built-in alternate of BOC (may wanna update to the latest /admin/includes/functions/localization.php from v1.5.6)
    c) add a different currency exchange source using one of the available plugins (I recommend OpenExchangeRates, but you need to sign up for free api access as explained in the plugin.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. The primary exchange rate server (oanda) failed
    By MeltDown in forum All Other Contributions/Addons
    Replies: 14
    Last Post: 7 May 2017, 04:27 AM
  2. v155 How to use the "Currency Exchange Rate"
    By su35 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 21 Jul 2016, 06:11 PM
  3. Can I set the type of currencies and exchange rate?
    By AbbyTan in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 23 Sep 2015, 01:13 PM
  4. v151 Incorrect exchange rate?
    By DML73 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 4
    Last Post: 30 Apr 2015, 05:11 PM

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