The app create sessions for videoconferences and one of the values is a session id that takes from from tokbox. This was working for a lot of time, so in this days started to get the following error many attempts, and many other attempts runs ok, here the message from console:
REXML::ParseException (Missing end tag for 'hr' (got "body")
Line: 6
Position: 169
Last 80 unconsumed characters:
):
All seems that missing content from the tokbox id, no code change while this time lapse since this start happening.
Solved!
Update the gem, Tokbox started to remove support from no secure connections.
Also you need to change OpenTokSDK class names to OpenTok.
Related
I have been using the following URL for the past 3 years without issue. However, it has stopped returning results.
URL:
https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("ARSARS")&env=store://datatables.org/alltableswithkeys
Now returns the following:
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="0" yahoo:created="2017-11-02T09:33:25Z" yahoo:lang="en-AU">
<results/>
</query><!-- total: 9 -->
Notice how there are no results, it simply has the tag "results".
I have tried on this many different computers and browsers. I have also tried changing the currency combinations, but no luck.
Can anybody spot what I am doing wrong?
Yes, it looks like Yahoo has discontinued their Currency Converter API service.
I found a different site : https://currencylayer.com/
They let you request currency rates (1 USD = 168 other currencies). If you make less than 1000 requests per month, it is free (if you need more, they have different subscriptions : https://currencylayer.com/product).
You just need to sign up and receive your own Access Code. Once you have that, then you simply make the call http://apilayer.net/api/live?access_key= and it will return JSON of the other currency rates.
They also have code examples in PHP, JavaScript, and Java at https://currencylayer.com/documentation
Found it very easy to get started using their API right away.
I think the API is down.
I am similarly receiving "results"=nullfor the query:
http://query.yahooapis.com/v1/public/yql?q=select+%2A+from+yahoo.finance.xchange+where+pair+in+%28%22GBPEUR%22%29&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
Setting diagnostics=true in the request yields:
`
[execution-start-time] => 7
[execution-stop-time] => 12
[execution-time] => 5
[http-status-code] => 999
[http-status-message] => Request denied
[content] => http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=snl1d1t1ab
`
If anyone knows more than me about what this might imply I'd be glad to hear it!
Yahoo is aware of this issue and their engineers are working on it:
ref: https://forums.yahoo.net/t5/Yahoo-Finance-help/http-download-finance-yahoo-com-d-quotes-csv-s-GOOG-amp-f/td-p/387096
Very sadly and quite outrageously Yahoo decided to stop this service without any warning.
See admin message here
So many services depend on it, it's like Google saying they would suddenly stop their maps API... At this point I am blocking yahoo in our DNS so no one in our company will ever use Yahoo again since they are not a reliable entity.
I have a problem, that i cannot solve for a few days. I am trying to migrate from one server to another with opencart 1.5.6.1 and always getting the same error when trying to get to admin, frontpage works well..
Fatal error: Call to a member function getFirstName() on a non-object in ....../public_html/catalog/controller/common/header.php on line 50
header.php line 50
$this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL'));
What i've already tried:
recopy files few times from server to server
rewrittn admin/config.php and config.php few times
In header php. line 50 changed $this->customer->getFirstName() to $this->customer->getFirstName()
modified user permissions of config.php...
nothing helps, i still get the same error.
Please, help ! :)
I dont have a clue how to do var_dump($this->customer) :).
I don't understand why the same web site is working on one server perfectly, but when I copy all the contents of it with filezilla to another server, edit both config.php files, import database, the frontpage works fine, but admin doesn't and i always get the same error. Maybe I am doing something wrong while moving to another server ?
I'm implementing a Google Talk listener that updates me with all my contact list items' presence.
require 'xmpp4r'
require 'xmpp4r/roster'
require 'xmpp4r/roster/helper/roster'
sender_jid = Jabber::JID.new('email')
client = Jabber::Client.new(sender_jid)
client.connect('talk.google.com')
client.auth('password')
client.send(Jabber::Presence.new.set_type(':available'))
#Presence updates:
client.add_presence_callback do |pres|
puts pres.from.to_s.split("/")[0] unless pres.nil?
puts pres.show.to_s.inspect unless pres.nil?
end
Thread.stop
client.close
The code works fine and the thread continues to listen on one gmail account but gives me this error after a few contacts appear:
client.rb:33:in `stop': deadlock detected (fatal)
from client.rb:33:in `<main>'
This other account for which this error appears has a lot more contacts with varying statuses. Can't seem to figure out why this is happening. Any help would be amazing.
Thanks.
Solved the problem through the logger. It was throwing a deadlock because there was a parsing error. There are certain contacts I have with characters that weren't able to get parsed.
It seems xmpp4r has not been updated in a while and my solution was to move over to a repo that some people have updated.
If anyone is having a similar problem check out:
https://github.com/whitehat101/xmpp4r
The parsing is done through nokogiri.
UPDATE:
there are a bunch of new maintainers who have forked over many of the updates from above + fixing other issues:
https://github.com/xmpp4r/xmpp4r
On a current project which I'm currently working, i have a symfony task that runs some mass data insertion to database and runs it for at least half an hour.
When the task starts a mail notification is sent correctly, the problem is that at the of the task execution we can't send another mail to notify about the end of processing.
The mailer factory is currently configured with the spool delivery strategy but, in this specific situation, we desire to fire a notification immediately, using the sendNextImmediately() method.
I'm are getting the exception:
[Swift_TransportException]
Expected response code 250 but got code "451", with message "451 4.4.2 Timeout - closing connection. 74sm1186065wem.17
"
and the flowing error on php log file:
Warning: fwrite(): SSL: Broken pipe in /var/www/project/lib/vendor/symfony/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php on line 209
Can anyone give some help?
Is there any way that i can perhaps refresh symfony mailer to establish a new connection?
Doing a Symfony2 project, I ran across this failure too. We were using a permanently running php script, which produced the error.
We figured out that following code does the job:
private function sendEmailMessage($renderedTemplate, $subject, $toEmail)
{
$mailer = $this->getContainer()->get('mailer');
/* #var $mailer \Swift_Mailer */
if(!$mailer->getTransport()->isStarted()){
$mailer->getTransport()->start();
}
$sendException = null;
/* #var $message \Swift_Message */
$message = \Swift_Message::newInstance()
->setSubject($subject)
->setFrom($this->getContainer()->getParameter('email_from'))
->setTo($toEmail)
->setBody($renderedTemplate);
$mailer->send($message);
$mailer->getTransport()->stop();
//throw $sendException;
}
For Symfony1 Users
My guess was that the connection was being hold for too long (with no activity at all), causing an ssl connection timeout.
For now, the problem can be solved by stopping the Swift_Transport instance and starting it again explicitly, just before sending the second message.
Here is the code:
$this->getMailer()->getRealtimeTransport()->stop();
$this->getMailer()->getRealtimeTransport()->start();
$this->getMailer()->sendNextImmediately()->send($message);
I had exactly the same problem and above solutions were very helpful, but there is one thing I had to do differently: order.
$this->getMailer()->sendNextImmediately()->send($message);
$this->getMailer()->getRealtimeTransport()->stop();
It didn't worked for me if I tried to stop Transport before sending message (connection timeout was already hanging). Also You don't need to run getRealtimeTransport()->start() - it will be started automatically.
This question already has an answer here:
Overriding/Modifying Rails Class (ActiveResource)
(1 answer)
Closed 3 years ago.
I'm trying to contact a REST API using ActiveResource on Rails 2.3.2.
I'm attempting to use the timeout functionality so that if the resource I'm contacting is down I can fail quickly - I'm doing this with the following:
class WorkspaceResource < ActiveResource::Base
self.timeout = 5
self.site = "http://mysite.com/restAPI"
end
However, when I try to contact the service when I know it isn't available, the class only times out after the default 60 seconds. I can see from the error stack that the timeout error does indeed come from an ActiveResource class in my gem folder that has the proper functions to allow timeout settings, but my set timeout never seems to work.
Any thoughts?
So apparently the issue is not that timeout is not functioning. I can run a server locally, make it not return a response within the timeout limit, and see that timeout works.
The issue is in fact that if the server does not accept the connection, timeout does not function as I expected it to - it doesn't function at all. It appears as though timeout only works when the server accepts the connection but takes too long to respond.
To me, this seems like an issue - shouldn't timeout also work when the server I'm contacting is down? If not, there should be another mechanism to stop a bunch of requests from hanging...anyone know of a quick way to do this?
The problem
If you're running on Ruby 1.8.x then the problem is its lack of real system threads.
As you can read first hereand then here, there are systemic problems with timeouts in Ruby. An interesting discussion but for you in particular some comments suggest that the timeout is effectively ignored and defaults to 60 seconds - exactly what you are seeing.
Solutions ...
I have a similar issue with our own product when trying to send emails - if the email server is down the thread blocks. For me the solution was to spin the request off on a separate thread and therefore my main request-processing thread doesn't block.
There are non-blocking libraries out there for Ruby but perhaps you could take a look first at this System Timeout Gem.
An option open to anyone using Rails behind a proxy like nginx would be to set the upstream timeout to a lower number - that way you'll get notified if the server is taking too long. I'd only do this if I were really stuck for a solution.
Last but not least, it's possible that running Rails 2.3.2 on top of Ruby 1.9.1 will fix the issue.
Alternatively, you could try to catch these connection errors and retry once (after certain period of time) just to make sure the connection is really out.
retried = false
begin
#businesses = Business.find(:all, :params => { :shop_domain => #shop.domain })
retried = false
rescue ActiveResource::TimeoutError => ex
#raise ex
rescue ActiveResource::ConnectionError, ActiveResource::ServerError, ActiveResource::ClientError => ex
unless retried
sleep(((ex.respond_to?(:response) && ex.response['Retry-After']) || 5).to_i)
retried = true
retry
else
# raise ex
end
end
Inspired by this solution from Shopify for paginating a large number of records. https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/paginate-api-results-113066