I try to implement the Parsing JSON in the background on https://flutter.io/cookbook/networking/background-parsing/ and I am getting bellow error. Error also same when I use the Android Emulator.
I am using macOs HighSierra. I install IntelliJ and Fluter and Dark plugin. I test most examples on Flutter and it all worked. I also created a demo up and its working. I don't understand why this not working. Any Help please?
Code I am using:
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:http/http.dart' as http;
// JSON::WEATHER
Future<String> getWeatherData() async {
var response = await http.get(
Uri.encodeFull("http://api.openweathermap.org/data/2.5/forecast?q=San+Francisco&units=metric&APPID=14cc828bff4e71286219858975c3e89a"),
headers: {
'Accept': 'application/json'
}
);
this.setState(() {
weatherData = json.decode(response.body);
});
return 'Success!';
}
#override
void initState() {
// TODO: implement initState
super.initState();;
this.getWeatherData();
}
// USAGE
new Text(
weatherData['list'][0]['main']['temp_min'].toString(),
style: new TextStyle(
fontSize: 10.0,
fontWeight: FontWeight.w400,
color: Colors.white,
),
),
Launching lib/main.dart on SM G935F in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build/app/outputs/apk/debug/app-debug.apk (31.4MB).
I/FlutterActivityDelegate(26125): onResume setting current activity to this
D/libGLESv2(26125): STS_GLApi : DTS is not allowed for Package : com.yourcompany.parsingjsonintheackground
Syncing files to device SM G935F...
F/flutter (26125): [FATAL:flutter/fml/message_loop.cc(23)] Check failed: loop != nullptr.
MessageLoop::EnsureInitializedForCurrentThread was not called on this
thread prior to message loop use.
F/libc (26125): Fatal signal 6 (SIGABRT), code -6 in tid 26165 (1.ui)
* *
Build fingerprint: 'samsung/hero2ltexx/hero2lte:7.0/NRD90M/G935FXXS2DRC3:user/release-keys'
Revision: '9'
ABI: 'arm64'
pid: 26125, tid: 26165, name: 1.ui >>> com.yourcompany.parsingjsonintheackground <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: '[FATAL:flutter/fml/message_loop.cc(23)] Check failed: loop != nullptr.
MessageLoop::EnsureInitializedForCurrentThread was not called on this
thread prior to message loop use.
'
x0 0000000000000000 x1 0000000000006635 x2 0000000000000006 x3 0000000000000008
x4 000000000000015f x5 0000000000000000 x6 0000007286ce8000 x7 0000000000000000
x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 ffffffffffffffff
x12 0000000000000018 x13 0000000000000000 x14 0000000000000000 x15 000bbc6bf4faa710
x16 00000072840caee0 x17 0000007284073a28 x18 000000726095d160 x19 000000725d9ab4f8
x20 0000000000000006 x21 000000725d9ab450 x22 0000000000000000 x23 000000725d9ab020
x24 000000725d9ab038 x25 000000725d9ab040 x26 000000725d9ab060 x27 000000725d9ab098
x28 000000725d9ab009 x29 000000725d9aab00 x30 0000007284070ebc
sp 000000725d9aaae0 pc 0000007284073a30 pstate 0000000060000000
backtrace:
#00 pc 000000000006ca30 /system/lib64/libc.so (tgkill+8)
#01 pc 0000000000069eb8 /system/lib64/libc.so (pthread_kill+64)
#02 pc 0000000000024198 /system/lib64/libc.so (raise+24)
#03 pc 000000000001c9b0 /system/lib64/libc.so (abort+52)
#04 pc 00000000003a6d2c /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#05 pc 00000000003a7474 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#06 pc 000000000016dab4 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#07 pc 000000000015f404 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#08 pc 0000000000189b70 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#09 pc 0000000000190b50 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#10 pc 0000000000190674 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#11 pc 00000000001921e8 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#12 pc 00000000005dc220 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#13 pc 0000000000830f4c /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#14 pc 0000000000830df8 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#15 pc 000000000074d084 /data/app/com.yourcompany.parsingjsonintheackground-1/lib/arm64/libflutter.so
#16 pc 00000000000696bc /system/lib64/libc.so (_ZL15__pthread_startPv+196)
#17 pc 000000000001dbf0 /system/lib64/libc.so (__start_thread+16)
Lost connection to device.
I answered in the related bug you opened:
https://github.com/flutter/flutter/issues/16738
Related
I am new with pyspark and want to work with SQL data. Here is what I done so far.
I can import JSON, TXT, CSV file formats into spark with no problem.
I cannot for some reason connect to mysql (hosted locally : 127.0.0.1)
I used following connection:
from os.path import expanduser, join, abspath
from pyspark.sql import SparkSession, Row,DataFrameReader, SQLContext
from pyspark import SparkContext, SparkConf
sparkClassPath = os.getenv('SPARK_CLASSPATH', './mysql-connector-java-8.0.11/mysql-connector-java-8.0.11.jar')
sqlContext = SQLContext(SparkContext.getOrCreate())
sqlContext.read.format("jdbc").options(url="jdbc:mysql://127.0.0.1/",driver = "com.mysql.jdbc.Driver",
dbtable = "product",user="root",password='').load()
It generates following error:
---------------------------------------------------------------------------
Py4JJavaError Traceback (most recent call last)
<ipython-input-141-bfc4c079a8b3> in <module>()
3 from pyspark import SparkContext, SparkConf
4 sparkClassPath = os.getenv('SPARK_CLASSPATH', './mysql-connector-java-8.0.11/mysql-connector-java-8.0.11.jar')
----> 5 sqlContext = SQLContext(SparkContext.getOrCreate())
6 sqlContext.read.format("jdbc").options(url="jdbc:mysql://127.0.0.1/",driver = "com.mysql.jdbc.Driver",
7 dbtable = "product",user="root",password='').load()
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/pyspark/context.py in getOrCreate(cls, conf)
332 with SparkContext._lock:
333 if SparkContext._active_spark_context is None:
--> 334 SparkContext(conf=conf or SparkConf())
335 return SparkContext._active_spark_context
336
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/pyspark/context.py in __init__(self, master, appName, sparkHome, pyFiles, environment, batchSize, serializer, conf, gateway, jsc, profiler_cls)
116 try:
117 self._do_init(master, appName, sparkHome, pyFiles, environment, batchSize, serializer,
--> 118 conf, jsc, profiler_cls)
119 except:
120 # If an error occurs, clean up in order to allow future SparkContext creation:
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/pyspark/context.py in _do_init(self, master, appName, sparkHome, pyFiles, environment, batchSize, serializer, conf, jsc, profiler_cls)
178
179 # Create the Java SparkContext through Py4J
--> 180 self._jsc = jsc or self._initialize_context(self._conf._jconf)
181 # Reset the SparkConf to the one actually used by the SparkContext in JVM.
182 self._conf = SparkConf(_jconf=self._jsc.sc().conf())
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/pyspark/context.py in _initialize_context(self, jconf)
271 Initialize SparkContext in function to allow subclass specific initialization
272 """
--> 273 return self._jvm.JavaSparkContext(jconf)
274
275 #classmethod
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/lib/py4j-0.10.4-src.zip/py4j/java_gateway.py in __call__(self, *args)
1399 answer = self._gateway_client.send_command(command)
1400 return_value = get_return_value(
-> 1401 answer, self._gateway_client, None, self._fqn)
1402
1403 for temp_arg in temp_args:
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/pyspark/sql/utils.py in deco(*a, **kw)
61 def deco(*a, **kw):
62 try:
---> 63 return f(*a, **kw)
64 except py4j.protocol.Py4JJavaError as e:
65 s = e.java_exception.toString()
~/Documents/spark/spark-2.2.1-bin-hadoop2.7/python/lib/py4j-0.10.4-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
317 raise Py4JJavaError(
318 "An error occurred while calling {0}{1}{2}.\n".
--> 319 format(target_id, ".", name), value)
320 else:
321 raise Py4JError(
Py4JJavaError: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext.
: java.net.BindException: Can't assign requested address: Service 'sparkDriver' failed after 16 retries (on a random free port)! Consider explicitly setting the appropriate binding address for the service 'sparkDriver' (for example spark.driver.bindAddress for SparkDriver) to the correct binding address.
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:127)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:501)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1218)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:496)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:481)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:965)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:210)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:446)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:748)
Please note mysql is up and running. Screenshot below
And so is pyspark
I wonder if someone can help guide me on how I can preempt a crash of R studio. R Studio has now crashed on three separate occasions, each time 9 minutes after running the following code in an attempt to transform a dummy-variabled data set into a dataframe:
trsf <- events.data.frame(predict(dmy, newdata = events))
In the middle of running the code, RStudio "quits unexpectedly" and I get the bomb dialog box that says "R session aborted. R encountered a fatal error. The session was terminated," and then gives me the option of starting a new session. The code that was successfully executed before running that command was:
dmy <- dummyVars(" ~ .", data = events)
Before the above command I established a connection between R Studio to my MySQL database, and then successfully read in a table from that database into R studio.
I followed the instructions at the following link to try and recover a crash report, but I couldn't find it in the locations specified:
https://support.rstudio.com/hc/en-us/articles/200554776-RStudio-Crash-Report
The following entry showed up in the Console right when R Studio crashed:
7/30/17 11:25:53.000 AM kernel[0]: low swap: killing pid 476 (rsession)
I tried updating R studio to version 1.1.319, restarted the computer, and tried again from scratch with an empty session, but to no avail, as I continue to get the fatal error message at the same point in the process. I then tried to reduce the size of the dataset queried of the table (5.8 GiB table with 7,201,341 rows large) by at least half by querying data (from 1997-2016, instead of data from 1974-2016).
I ran the following command in a terminal:
/Applications/RStudio.app/Contents/MacOS/RStudio --run-diagnostics
as mentioned here:
https://support.rstudio.com/hc/en-us/community/posts/212693307-RStudio-crash-every-time-upon-new-Rmd-file-creation
Here is the output from the text file that was created, although I'm not sure how relevant it is:
[1] "1.1.319"
$R
[1] "/usr/local/bin/R"
$pdflatex
[1] ""
$bibtex
[1] ""
$gcc
[1] "/usr/bin/gcc"
$git
[1] "/usr/bin/git"
$svn
[1] "/usr/bin/svn"
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0
SysInfo:
sysname
"Darwin"
release
"15.6.0"
version
"Darwin Kernel Version 15.6.0: Sun Jun 4 21:43:07 PDT 2017; root:xnu-3248.70.3~1/RELEASE_X86_64"
nodename
“xxxx-Mac-Pro"
machine
"x86_64"
login
"xxxx"
user
"xxxx"
effective_user
"xxxx"
R Version:
_
platform x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64, darwin15.6.0
status
major 3
minor 4.0
year 2017
month 04
day 21
svn rev 72570
language R
version.string R version 3.4.0 (2017-04-21)
nickname You Stupid Darkness
$`_`
[1] "/Applications/RStudio.app/Contents/MacOS/RStudio"
$`__CF_USER_TEXT_ENCODING`
[1] "0x1F5:0x0:0x0"
$Apple_PubSub_Socket_Render
[1] "/private/tmp/com.apple.launchd.R8X6ErkBu8/Render"
$CLICOLOR_FORCE
[1] "1"
$DYLD_FALLBACK_LIBRARY_PATH
[1] "/Library/Frameworks/R.framework/Resources/lib:/Users/xxxx/lib:/usr/local/lib:/usr/lib:::/lib:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/server"
$EDITOR
[1] "vi"
$GIT_ASKPASS
[1] "rpostback-askpass"
$HOME
[1] "/Users/xxxx"
$LANG
[1] "en_US.UTF-8"
$LC_CTYPE
[1] "en_US.UTF-8"
$LN_S
[1] "ln -s"
$LOGNAME
[1] “xxxx”
$MAKE
[1] "make"
$OLDPWD
[1] "/Users/xxxx”
$PAGER
[1] "/usr/bin/less"
$PATH
[1] "/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
$PWD
[1] "/Users/xxxx”
$R_BROWSER
[1] "/usr/bin/open"
$R_BZIPCMD
[1] "/usr/bin/bzip2"
$R_DOC_DIR
[1] "/Library/Frameworks/R.framework/Resources/doc"
$R_GZIPCMD
[1] "/usr/bin/gzip"
$R_HOME
[1] "/Library/Frameworks/R.framework/Resources"
$R_INCLUDE_DIR
[1] "/Library/Frameworks/R.framework/Resources/include"
$R_LIBS_SITE
[1] ""
$R_LIBS_USER
[1] "~/Library/R/3.4/library"
$R_PAPERSIZE
[1] "a4"
$R_PDFVIEWER
[1] "/usr/bin/open"
$R_PLATFORM
[1] "x86_64-apple-darwin15.6.0"
$R_PRINTCMD
[1] "lpr"
$R_QPDF
[1] "/Library/Frameworks/R.framework/Resources/bin/qpdf"
$R_RD4PDF
[1] "times,inconsolata,hyper"
$R_SESSION_TMPDIR
[1] "/var/folders/ml/3khdh0ns3410w6qzm2tw6psc0000gn/T//RtmpCpoqW2"
$R_SHARE_DIR
[1] "/Library/Frameworks/R.framework/Resources/share"
$R_SYSTEM_ABI
[1] "osx,gcc,gxx,gfortran,?"
$R_TEXI2DVICMD
[1] "/usr/local/bin/texi2dvi"
$R_UNZIPCMD
[1] "/usr/bin/unzip"
$R_ZIPCMD
[1] "/usr/bin/zip"
$RMARKDOWN_MATHJAX_PATH
[1] "/Applications/RStudio.app/Contents/Resources/resources/mathjax-26"
$RS_RPOSTBACK_PATH
[1] "/Applications/RStudio.app/Contents/MacOS/rpostback"
$RS_SHARED_SECRET
[1] "5ff181b1-d899-4d78-9493-06b24535ea1b"
$RSTUDIO
[1] "1"
$RSTUDIO_CONSOLE_COLOR
[1] "256"
$RSTUDIO_CONSOLE_WIDTH
[1] "80"
$RSTUDIO_PANDOC
[1] "/Applications/RStudio.app/Contents/MacOS/pandoc"
$RSTUDIO_SESSION_PORT
[1] "40358"
$RSTUDIO_USER_IDENTITY
[1] "xxxx"
$RSTUDIO_WINUTILS
[1] "bin/winutils"
$SED
[1] "/usr/bin/sed"
$SHELL
[1] "/bin/bash"
$SHLVL
[1] "1"
$SSH_AUTH_SOCK
[1] "/private/tmp/com.apple.launchd.JwE0qrvHVe/Listeners"
$TAR
[1] "/usr/bin/tar"
$TERM
[1] "xterm-256color"
$TERM_PROGRAM
[1] "Apple_Terminal"
$TERM_PROGRAM_VERSION
[1] "361.1"
$TERM_SESSION_ID
[1] "F96A6E56-2585-4164-B6BC-470CE6D70216"
$TMPDIR
[1] "/var/folders/ml/3khdh0ns3410w6qzm2tw6psc0000gn/T/"
$USER
[1] “xxxx”
$XPC_FLAGS
[1] "0x0"
$XPC_SERVICE_NAME
[1] "0"
[1] ".GlobalEnv" "tools:rstudio" "package:stats"
[4] "package:graphics" "package:grDevices" "package:utils"
[7] "package:datasets" "package:methods" "Autoloads"
[10] "package:base"
Log file: rdesktop.log
--------------------------------------------------
(Empty)
Log file: rsession-xxxx.log
--------------------------------------------------
16 Jun 2017 04:17:01 [rsession-xxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
16 Jun 2017 04:51:54 [rsession-xxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
16 Jun 2017 05:07:20 [rsession-xxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
17 Jun 2017 04:12:50 [rsession-xxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
17 Jun 2017 15:35:17 [rsession-xxxx] CLIENT EXCEPTION (rsession-xxxx): (TypeError) : undefined is not an object (evaluating 'a.n.applicable');|||org/rstudio/studio/client/workbench/views/packages/PackagesPane.java#102::setPackageState|||org/rstudio/studio/client/workbench/views/packages/Packages.java#724::setViewPackageList|||org/rstudio/studio/client/workbench/views/packages/Packages.java#700::onPackageFilterChanged|||org/rstudio/studio/client/workbench/views/packages/PackagesPane.java#277::onValueChange|||com/google/gwt/event/logical/shared/ValueChangeEvent.java#127::dispatch|||com/google/web/bindery/event/shared/SimpleEventBus.java#173::doFire|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/event/logical/shared/ValueChangeEvent.java#40::fire|||org/rstudio/core/client/widget/SearchWidget.java#163::onKeyUp|||com/google/gwt/event/dom/client/KeyUpEvent.java#55::dispatch|||com/google/web/bindery/event/shared/SimpleEventBus.java#173::doFire|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/event/dom/client/DomEvent.java#110::fireNativeEvent|||com/google/gwt/user/client/ui/Widget.java#163::onBrowserEvent|||com/google/gwt/user/client/ui/Composite.java#78::onBrowserEvent|||com/google/gwt/user/client/DOM.java#1414::dispatchEvent|||com/google/gwt/user/client/impl/DOMImplStandard.java#312::dispatchEvent|||com/google/gwt/core/client/impl/Impl.java#244::apply|||com/google/gwt/core/client/impl/Impl.java#283::entry0|||http://127.0.0.1:9408/#-1::anonymous|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Macintosh Intel Mac OS X 10_11_6) AppleWebKit/603.2.5 (KHTML, like Gecko)
17 Jun 2017 15:35:17 [rsession-xxxx] CLIENT EXCEPTION (rsession-xxxx): (TypeError) : undefined is not an object (evaluating 'a.n.applicable');|||org/rstudio/studio/client/workbench/views/packages/PackagesPane.java#102::setPackageState|||org/rstudio/studio/client/workbench/views/packages/Packages.java#724::setViewPackageList|||org/rstudio/studio/client/workbench/views/packages/Packages.java#700::onPackageFilterChanged|||org/rstudio/studio/client/workbench/views/packages/PackagesPane.java#277::onValueChange|||com/google/gwt/event/logical/shared/ValueChangeEvent.java#127::dispatch|||com/google/web/bindery/event/shared/SimpleEventBus.java#173::doFire|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/event/logical/shared/ValueChangeEvent.java#40::fire|||org/rstudio/core/client/widget/SearchWidget.java#163::onKeyUp|||com/google/gwt/event/dom/client/KeyUpEvent.java#55::dispatch|||com/google/web/bindery/event/shared/SimpleEventBus.java#173::doFire|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/event/dom/client/DomEvent.java#110::fireNativeEvent|||com/google/gwt/user/client/ui/Widget.java#163::onBrowserEvent|||com/google/gwt/user/client/ui/Composite.java#78::onBrowserEvent|||com/google/gwt/user/client/DOM.java#1414::dispatchEvent|||com/google/gwt/user/client/impl/DOMImplStandard.java#312::dispatchEvent|||com/google/gwt/core/client/impl/Impl.java#244::apply|||com/google/gwt/core/client/impl/Impl.java#283::entry0|||http://127.0.0.1:9408/#-1::anonymous|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Macintosh Intel Mac OS X 10_11_6) AppleWebKit/603.2.5 (KHTML, like Gecko)
17 Jun 2017 15:35:17 [rsession-xxxx] CLIENT EXCEPTION (rsession-xxxx): (TypeError) : undefined is not an object (evaluating 'a.n.applicable');|||org/rstudio/studio/client/workbench/views/packages/PackagesPane.java#102::setPackageState|||org/rstudio/studio/client/workbench/views/packages/Packages.java#724::setViewPackageList|||org/rstudio/studio/client/workbench/views/packages/Packages.java#700::onPackageFilterChanged|||org/rstudio/studio/client/workbench/views/packages/PackagesPane.java#277::onValueChange|||com/google/gwt/event/logical/shared/ValueChangeEvent.java#127::dispatch|||com/google/web/bindery/event/shared/SimpleEventBus.java#173::doFire|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/event/logical/shared/ValueChangeEvent.java#40::fire|||org/rstudio/core/client/widget/SearchWidget.java#163::onKeyUp|||com/google/gwt/event/dom/client/KeyUpEvent.java#55::dispatch|||com/google/web/bindery/event/shared/SimpleEventBus.java#173::doFire|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/event/shared/HandlerManager.java#117::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/user/client/ui/Widget.java#127::fireEvent|||com/google/gwt/event/dom/client/DomEvent.java#110::fireNativeEvent|||com/google/gwt/user/client/ui/Widget.java#163::onBrowserEvent|||com/google/gwt/user/client/ui/Composite.java#78::onBrowserEvent|||com/google/gwt/user/client/DOM.java#1414::dispatchEvent|||com/google/gwt/user/client/impl/DOMImplStandard.java#312::dispatchEvent|||com/google/gwt/core/client/impl/Impl.java#244::apply|||com/google/gwt/core/client/impl/Impl.java#283::entry0|||http://127.0.0.1:9408/#-1::anonymous|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Macintosh Intel Mac OS X 10_11_6) AppleWebKit/603.2.5 (KHTML, like Gecko)
18 Jun 2017 05:26:11 [rsession-xxxxxxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
20 Jun 2017 06:29:23 [rsession-xxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
21 Jun 2017 03:31:28 [rsession-xxxx] WARNING Abort requested; LOGGED FROM: bool rstudio::session::connection::checkForAbort(boost::shared_ptr<HttpConnection>, const boost::function<void ()>) /Users/rstudio/rstudio/src/cpp/session/http/SessionHttpConnectionUtils.cpp:136
Please let me know what other information I can provide and where I might find it so that I can address the problem.
Here is a screenshot of the R environment before the crash took place.
Thank you in advance
I wrote a simple Selenium test (opening a page) of a secured site in a headless mode using Chrome 59 beta version.
I'm getting an the following exception while executing my code. The exception is thrown while initializing the driver
When I rerun my script after commenting the headless option (options.addArguments("headless")) it shows Chrome and running fine but my objective is to run it as headless. Could you please provide your thoughts on resolving my problem?
Exception:
Starting ChromeDriver 2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b) on port 4971
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X 10.12.2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.14 seconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
Here are the steps:
I'm using Scala with SBT on Mac.
Chrome 59 beta version
ChromeDrive 2.29 release version.
Added the following dependencies
"org.seleniumhq.selenium" % "selenium-chrome-driver" % "3.4.0"
"org.seleniumhq.selenium" % "selenium-support" % "3.4.0"
"net.lightbody.bmp" % "browsermob-core" % "2.1.4"
Scala Code:
val username = "username"
val password = "password"
val domainname = "yoursecuredomain.com"
val browserMobProxyServer = new BrowserMobProxyServer()
browserMobProxyServer.start(0)
browserMobProxyServer.autoAuthorization(domainname, username, password, AuthType.BASIC)
val seleniumProxy = ClientUtil.createSeleniumProxy(browserMobProxyServer)
val options = new ChromeOptions()
options.addArguments("headless")
options.addArguments("--disable-gpu")
options.setBinary("""/Applications/Google Chrome.app/Contents/MacOS/Google Chrome""")
val desiredCapabilities = new DesiredCapabilities()
desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, options)
desiredCapabilities.setCapability(CapabilityType.PROXY, seleniumProxy)
val driver: WebDriver = new ChromeDriver(desiredCapabilities)
val baseUrlString = s"""https://$domainname"""
driver.navigate().to(baseUrlString)
Thread.sleep(3000)
println("title: " + driver.getTitle)
driver.quit()
browserMobProxyServer.abort()
According to the 2.29 webdriver notes page, It says that
----------ChromeDriver v2.29 (2017-04-04)----------
Supports Chrome v56-58
so u have to downgrade your chrome version to be compatible with the latest chrome webdriver.
source:
https://chromedriver.storage.googleapis.com/2.29/notes.txt
I am not getting a symbolicated crash file using Xcode 7.3.1. My current version of the app never has symbols, however an older version of the app seems OK and the crash file is symbolicated.
I have tried to manually re-symbolicate by dragging it onto a device as described in this SO answer.
I tried to manually use the symbolicatecrash utility as described by this SO Answer.
I have confirmed that the dSYM file exists in the archive and am using it in both of the above manual attempts to rebuild the symbols. Any idea what I have missed?
Some of the crash files we received from our customers are corrupt. Using Apple's instructions Getting Crash Logs Directly From a Device Without Xcode, the customer copied the crash log and pasted it into email.
Something along the way corrupted the crash file though, injecting \n characters in somewhat random spots. We manually fixed the corrupted crash file by comparing it to an example from our system and symbolication worked.
Note the incorrect new line characters in the corrupted examples below:
Corrupt:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib
0x0000000185535188 0x185534000 + 4488
1 libsystem_kernel.dylib
0x0000000185534ff8 0x185534000 + 4088
2 CoreFoundation
0x00000001865325d0 0x186455000 + 906704
Should be:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x0000000185535188 0x185534000 + 4488
1 libsystem_kernel.dylib 0x0000000185534ff8 0x185534000 + 4088
2 CoreFoundation 0x00000001865325d0 0x186455000 + 906704
Corrupt:
Thread 12 crashed with ARM Thread State (64-bit):
x0: 0x0000000109020010 x1: 0x0000000109020020 x2: 0x0000000104f5c000 x3:
0xffffffffffff63ff
x4: 0x0000000000000001 x5: 0x0000000000000001 x6: 0x0000000108f84010 x7:
0x0000000000000000
x8: 0x0000200000000000 x9: 0x0000000000000000 x10: 0x0000000000000002 x11:
0x0000000174c4bb28
Should be:
Thread 12 crashed with ARM Thread State (64-bit):
x0: 0x0000000109020010 x1: 0x0000000109020020 x2: 0x0000000104f5c000 x3: 0xffffffffffff63ff
x4: 0x0000000000000001 x5: 0x0000000000000001 x6: 0x0000000108f84010 x7: 0x0000000000000000
x8: 0x0000200000000000 x9: 0x0000000000000000 x10: 0x0000000000000002 x11: 0x0000000174c4bb28
Corrupt:
Binary Images:
0x100910000 - 0x10093ffff dyld arm64 <f54ed85a94253887886a8028e20ed8ba> /usr/lib/dyld
0x188638000 - 0x188639fff libSystem.B.dylib arm64 <1b4d75209f4a37969a9575de48d48668>
/usr/lib/libSystem.B.dylib
0x18863a000 - 0x18868ffff libc++.1.dylib arm64 <b2db8b1d09283b7bafe1b2933adc5dfd>
/usr/lib/libc++.1.dylib
Should be:
Binary Images:
0x100910000 - 0x10093ffff dyld arm64 <f54ed85a94253887886a8028e20ed8ba> /usr/lib/dyld
0x188638000 - 0x188639fff libSystem.B.dylib arm64 <1b4d75209f4a37969a9575de48d48668> /usr/lib/libSystem.B.dylib
0x18863a000 - 0x18868ffff libc++.1.dylib arm64 <b2db8b1d09283b7bafe1b2933adc5dfd> /usr/lib/libc++.1.dylib
edit 2 : Fixed it myself, see comments.
I am trying to access my Zf2 app via the terminal.
The idea is that a cron script will call the app on a regular basis, and a corresponding action will look for things in the database and update when needed.
When accessing the controller/action via the browser, everything's fine.
When accessing it via the terminal, I'm getting a mysql-related error and I'm a bit lost with it.
Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)
The command from the terminal is :
php index.php stories update
Here is my route :
'console' => array(
'router' => array(
'routes' => array(
'updatestories' => array(
'options' => array(
'route' => 'stories update',
'defaults' => array(
'controller' => 'Application\Controller\Index',
'action' => 'updatestories'
)
)
)
)
)
),
The action 'updatestories' is :
public function updatestoriesAction(){
$request = $this->getRequest();
// Make sure that we are running in a console and the user has not tricked our
// application into running this action from a public web server.
if (!$request instanceof ConsoleRequest){
throw new \RuntimeException('You can only use this action from a console!');
}
$talents = $this->getStoriesTable()->fetchAll();
var_dump($talents);
return "end of script. !\n";
}
And here's the error I get only when reaching it via the terminal:
Warning: PDO::__construct(): [2002] No such file or directory (trying
to connect via unix:///var/mysql/mysql.sock) in
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Connection.php
on line 281
====================================================================== The application has thrown an exception!
====================================================================== Zend\Db\Adapter\Exception\RuntimeException Connect Error:
SQLSTATE[HY000] [2002] No such file or directory
---------------------------------------------------------------------- /Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Connection.php:289
0
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php(244):
Zend\Db\Adapter\Driver\Pdo\Connection->connect() 1
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Sql/Sql.php(120):
Zend\Db\Adapter\Driver\Pdo\Pdo->createStatement() 2
/Users/gregorychiche/Sites/repos/module/Talents/src/Talents/Model/StoriesTable.php(35):
Zend\Db\Sql\Sql->prepareStatementForSqlObject(Object(Zend\Db\Sql\Select))
3
/Users/gregorychiche/Sites/repos/module/Application/src/Application/Controller/IndexController.php(123):
Talents\Model\StoriesTable->fetchAll() 4
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83):
Application\Controller\IndexController->updatestoriesAction() 5
[internal function]:
Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
6
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468):
call_user_func(Array, Object(Zend\Mvc\MvcEvent)) 7
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207):
Zend\EventManager\EventManager->triggerListeners('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 8
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117):
Zend\EventManager\EventManager->trigger('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 9
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114):
Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Console\Request),
Object(Zend\Console\Response)) 10 [internal function]:
Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) 11
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468):
call_user_func(Array, Object(Zend\Mvc\MvcEvent)) 12
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207):
Zend\EventManager\EventManager->triggerListeners('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 13
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(309):
Zend\EventManager\EventManager->trigger('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 14
/Users/gregorychiche/sites/repos/public/index.php(24):
Zend\Mvc\Application->run() 15 {main}
====================================================================== Previous Exception(s):
====================================================================== exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such
file or directory' in
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Connection.php:281
Stack trace: 0
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Connection.php(281):
PDO->__construct('mysql:dbname=ta...', 'root', 'root', Array) 1
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Adapter/Driver/Pdo/Pdo.php(244):
Zend\Db\Adapter\Driver\Pdo\Connection->connect() 2
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Db/Sql/Sql.php(120):
Zend\Db\Adapter\Driver\Pdo\Pdo->createStatement() 3
/Users/gregorychiche/Sites/repos/module/Talents/src/Talents/Model/StoriesTable.php(35):
Zend\Db\Sql\Sql->prepareStatementForSqlObject(Object(Zend\Db\Sql\Select))
4
/Users/gregorychiche/Sites/repos/module/Application/src/Application/Controller/IndexController.php(123):
Talents\Model\StoriesTable->fetchAll() 5
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83):
Application\Controller\IndexController->updatestoriesAction() 6
[internal function]:
Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
7
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468):
call_user_func(Array, Object(Zend\Mvc\MvcEvent)) 8
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207):
Zend\EventManager\EventManager->triggerListeners('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 9
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117):
Zend\EventManager\EventManager->trigger('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 10
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114):
Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Console\Request),
Object(Zend\Console\Response)) 11 [internal function]:
Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) 12
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468):
call_user_func(Array, Object(Zend\Mvc\MvcEvent)) 13
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207):
Zend\EventManager\EventManager->triggerListeners('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 14
/Users/gregorychiche/Sites/repos/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(309):
Zend\EventManager\EventManager->trigger('dispatch',
Object(Zend\Mvc\MvcEvent), Object(Closure)) 15
/Users/gregorychiche/sites/repos/public/index.php(24):
Zend\Mvc\Application->run()
What am I missing ? I don't understand why the code is working when accessing via browser (if I remove that but of code that throws exception obviously) but not when using terminal. I thought zf2 was taking care of all depedencies.
Thanks in advance
edit 1 : getStoriesTable() is as follow. it works mighty fine when used in browser-context
public function getStoriesTable()
{
if (!$this->storiesTable) {
$sm = $this->getServiceLocator();
$this->storiesTable = $sm->get('Talents\Model\StoriesTable');
}
return $this->storiesTable;
}
edit 2 : Fixed it myself, see comments.
Greg
Issue is mysql is not working on localhost.
In most cases change in global.php hostname to 127.0.0.1