R Studio crashing on Mac OS X 10.11.6 - mysql

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

Related

mariadb ERROR 2026 (HY000): SSL connection error: unsupported protocol

I got a mairadb 10.1 on ubuntu 18.04 where I wannt to connect via SSL. In november it worked, but my selfmade certificates runed out. So I created some new ones, but since then I got this errormessage when I try to connect (in python-mariadb the code looks similary, so I guess its a mariadb problem.)
ERROR 2026 (HY000): SSL connection error: unsupported protocol
When I connect via localhost from the server to the server, it works with an ssl connection.
I tried then to use another server, this time its a debian buster with mariadb 10.3 and it behaves the same.
Sites I already visited but haven't brought me further:
https://github.com/PyMySQL/PyMySQL/issues/817
MariaDB SSL connection error: Unsupported record version Unknown-0.0
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#openssl-defaults
sudo openssl x509 -text -noout -in boba-server-cert.pem
Certificate:
Data:
Version: 1 (0x0)
Serial Number: 1 (0x1)
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = ..., ST = ..., L = ..., O = ..., CN = CA B
Validity
Not Before: Dec 21 10:48:33 2020 GMT
Not After : Dec 21 10:48:33 2021 GMT
Subject: C = .., ST = ..., L = ..., O = ..., CN = [domain]
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
...

Fiware error: Access-Control-Allow-Origin

I'm making a call to the contextBroker and it gives me this error.
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 405.
From postman or from freeboard I do not get any of this.
getContextBroker(){
console.log("Consumimos el servicio getContextBroker");
let headers = new Headers ({'Accept': 'application/json', 'Fiware-Service': 'x', 'Fiware-ServicePath': '/x', 'Access-Control-Allow-Origin': '*'});
let options = new RequestOptions ({headers : headers});
return this._http.get(this.urlcontextBrokers, {headers : headers}).map(res => res.json());
}
}
how can I solve that?
I've tried adding: 'Access-Control-Allow-Origin': '*'
But it still does not work
EDIT:
ps ax | grep contextBroker:
862 pts/4 S+ 0:00 grep contextBroker
3792 ? Ssl 27:35 /usr/bin/contextBroker -port 1026 -logDir /var/log/contextBroker -pidpath /var/run/contextBroker/contextBroker.pid -dbhost localhost -db orion -multiservice -logAppend
version:
{
"orion": {
"version": "1.7.0",
"uptime": "12 d, 18 h, 24 m, 20 s",
"git_hash": "e544780eb64a4a2557c1f51dde070b8d82b86c49",
"compile_time": "Wed Feb 8 13:30:24 CET 2017",
"compiled_by": "fermin",
"compiled_in": "centollo"
}
}
EDIT02
Hello, as I said, I do not want to use the cors, I have eliminated that from the header in such a way:
   getContextBroker () {
     console.log ("We consume the getContextBroker service");
     let headers = new Headers ({'Accept': 'application / json', 'Fiware-Service': 'IoFAlmeria', 'Fiware-ServicePath': '/ ARMpalmerillas'});
     let options = new RequestOptions ({headers: headers});
     return this._http.get (this.urlcontextBrokers, {headers: headers}). map (res => res.json ());
   }
}
and I keep giving the same error:
OPTIONS http: // XXX: 1026 / v2 / entities / 405 (Method Not Allowed)
Failed to load http: // XXX: 1026 / v2 / entities /: Response to preflight request does not pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http: // localhost: 4200' is therefore not allowed access. The response had HTTP status code 405.
it has to be the problem of the fiware API since I have designed one with nodejs and I have no problem changing the URL
Update:
Limpiando repositorios:base epel extras fiware mongodb-org-3.2
: mysql-connectors-community mysql-tools-community
: mysql57-community nodesource updates
Limpiando todo
Cleaning up list of fastest mirrors
[root#UAL-IoF2020 ~]# yum install contextBroker
Complementos cargados:fastestmirror, refresh-packagekit, security
Configurando el proceso de instalación
Determining fastest mirrors
epel/metalink | 25 kB 00:00
* base: ftp.uma.es
* epel: ftp.uma.es
* extras: ftp.uma.es
* updates: ftp.uma.es
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:00
epel | 4.7 kB 00:00
epel/primary_db | 6.0 MB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
fiware | 951 B 00:00
fiware/primary | 45 kB 00:00
mongodb-org-3.2 | 2.5 kB 00:00
mongodb-org-3.2/primary_db | 78 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-connectors-community/primary_db | 18 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql-tools-community/primary_db | 38 kB 00:00
mysql57-community | 2.5 kB 00:00
mysql57-community/primary_db | 139 kB 00:00
nodesource | 2.5 kB 00:00
nodesource/primary_db | 51 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 6.4 MB 00:00
El paquete contextBroker-1.7.0-1.x86_64 ya se encuentra instalado con su versión más reciente
Nada para hacer
CORS requests are only supported by Orion Context Broker version 1.10 and above.
As #JoseManuelCantera has pointed out, you do not need to add any CORS specific headers to your request, those are handled by your client (browser, Postman etc.)
You need to:
Upgrade your version to 1.10
Start Orion in CORS mode
You can start Orion in CORS mode for any origin (Orion will accept CORS requests from any origin) as below:
contextBroker -corsOrigin __ALL
Please take a look at the CORS documentation for Orion for more information.
UPDATE
Please allow me to shortly explain CORS pre-flight logic. If your request is not a simple request, your browser will do a pre-flight request prior to yours with the OPTIONS method. If Orion is not started in CORS mode, you will always get method not allowed as a response to your non-simple requests.
So what is the problem, why are you getting different results with different clients? Postman (curl etc.) does exactly what you want it to do and sends the requests as you have configured. It does not check if the request you are sending should be pre-flighted or not.
On the other hand, your browser does check your request and do a pre-flight if necessary. You have no control over this other than modifying your request.
The Javascript framework you are working with is probably adding a header to the request rendering it a "non-simple" request. For example: X-Requested-With. Please see this question.
My suggestion is to take a look at the details of the request your browser sends (headers, methods etc.) and see what makes it a non-simple request. Then do the necessary changes on your js code to make sure your request falls within the scope of simple requests.
Having said that, you will need to upgrade your Orion version eventually since for example, a DELETE request is never going to be treated as a simple request when sent over a browser.
I think you need to upgrade to version 1.10 so that you can use CORS.
You do not need to add any header ;) and actually the Access-Control-Allow-Origing header is sent in the server response not by the client request

Why wont Cygnus receive a subscription on my CentOS 6.7?

I just finished testing the entire thing on my virtual machine environment and now I am trying to launch it on the dedicated server. And now I ran into a completely new issue. First I confirmed that I have both context Broker and centos running (on 1026 and 5050 respectively):
[root#centos conf]# netstat -ntlpd
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1026 0.0.0.0:* LISTEN 1321/contextBroker
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 1282/mongod
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1791/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1260/sshd
tcp 0 0 :::1026 :::* LISTEN 1321/contextBroker
tcp 0 0 :::8081 :::* LISTEN 2481/java
tcp 0 0 :::22 :::* LISTEN 1260/sshd
tcp 0 0 :::5050 :::* LISTEN 2481/java
[root#centos conf]# service cygnus status
Cygnus 1 status...
cygnus-flume-ng (pid 2481) is running...
Then I confirmed that I have data on contextBroker because this command gave me an appropriate response:
(curl localhost:1026/v1/queryContext -s -S --header 'Content-Type: application/json' \
--header 'Accept: application/json' -d #- | python -mjson.tool) <<EOF
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
]
}
EOF
Following the workaround to an issue with root user and logging I fixed the log4j.properties and changed the follwing:
flume.log.dir=/var/log/cygnus
I then started cygnus and got the following log:
Starting an ordered shutdown of Cygnus
Stopping sources
Stopping http-source (lyfecycle state=START)
All the channels are empty
Stopping channels
Stopping mysql-channel (lyfecycle state=START)
Stopping sinks
Stopping mysql-sink (lyfecycle state=START)
Info: Sourcing environment configuration script /usr/cygnus/conf/flume-env.sh
Warning: JAVA_HOME is not set!
+ exec /usr/bin/java -Xmx20m -Dflume.log.file=cygnus.log -cp '/usr/cygnus/conf:/usr/cygnus/lib/*:/usr/cygnus/plugins.d/cygnus/lib/*:/usr/cygnus/plugins.d/cygnus/libext/*' -Djava.library.path= com.telefonica.iot.cygnus.nodes.CygnusApplic$
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/cygnus/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/cygnus/plugins.d/cygnus/lib/cygnus-0.11.0-jar-with-dependencies.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
17 Dec 2015 13:35:37,684 INFO [main] (com.telefonica.iot.cygnus.nodes.CygnusApplication.main:235) - Starting a Jetty server listening on port 8081 (Management Interface)
17 Dec 2015 13:35:37,700 INFO [main] (org.mortbay.log.Slf4jLog.info:67) - Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
17 Dec 2015 13:35:37,700 INFO [main] (com.telefonica.iot.cygnus.nodes.CygnusApplication.main:238) - Starting Cygnus application
17 Dec 2015 13:35:37,700 INFO [Thread-1] (org.mortbay.log.Slf4jLog.info:67) - jetty-6.1.26
17 Dec 2015 13:35:37,713 INFO [lifecycleSupervisor-1-0] (org.apache.flume.node.PollingPropertiesFileConfigurationProvider.start:61) - Configuration provider starting
17 Dec 2015 13:35:37,715 INFO [conf-file-poller-0] (org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run:133) - Reloading configuration file:/usr/cygnus/conf/agent_1.conf
17 Dec 2015 13:35:37,725 INFO [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016) - Processing:mysql-sink
17 Dec 2015 13:35:37,725 INFO [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016) - Processing:mysql-sink
17 Dec 2015 13:35:37,725 INFO [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.addProperty:1016) - Processing:mysql-sink
17 Dec 2015 13:35:37,755 INFO [Thread-1] (org.mortbay.log.Slf4jLog.info:67) - Started SocketConnector#0.0.0.0:8081
17 Dec 2015 13:35:37,764 WARN [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration$AgentConfiguration.isValid:319) - Agent configuration for 'cygunsagent' does not contain any channels. Marking it as invalid.
17 Dec 2015 13:35:37,765 WARN [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration.validateConfiguration:127) - Agent configuration invalid for agent 'cygunsagent'. It will be removed.
17 Dec 2015 13:35:37,766 INFO [conf-file-poller-0] (org.apache.flume.conf.FlumeConfiguration.validateConfiguration:140) - Post-validation flume configuration contains configuration for agents: [cygnusagent]
17 Dec 2015 13:35:37,766 INFO [conf-file-poller-0] (org.apache.flume.node.AbstractConfigurationProvider.loadChannels:150) - Creating channels
17 Dec 2015 13:35:37,778 INFO [conf-file-poller-0] (org.apache.flume.channel.DefaultChannelFactory.create:40) - Creating instance of channel mysql-channel type memory
17 Dec 2015 13:35:37,782 INFO [conf-file-poller-0] (org.apache.flume.node.AbstractConfigurationProvider.loadChannels:205) - Created channel mysql-channel
17 Dec 2015 13:35:37,783 INFO [conf-file-poller-0] (org.apache.flume.source.DefaultSourceFactory.create:39) - Creating instance of source http-source, type org.apache.flume.source.http.HTTPSource
17 Dec 2015 13:35:37,791 INFO [conf-file-poller-0] (com.telefonica.iot.cygnus.handlers.OrionRestHandler.<init>:75) - Cygnus version (0.11.0.2a9c87fb7fd6156225e2eed7fbc9792f1d9c5dfe)
17 Dec 2015 13:35:37,807 INFO [conf-file-poller-0] (com.telefonica.iot.cygnus.handlers.OrionRestHandler.configure:141) - Startup completed
17 Dec 2015 13:35:37,826 INFO [conf-file-poller-0] (org.apache.flume.sink.DefaultSinkFactory.create:40) - Creating instance of sink: mysql-sink, type: com.telefonica.iot.cygnus.sinks.OrionMySQLSink
17 Dec 2015 13:35:37,839 INFO [conf-file-poller-0] (org.apache.flume.node.AbstractConfigurationProvider.getConfiguration:119) - Channel mysql-channel connected to [http-source, mysql-sink]
17 Dec 2015 13:35:37,843 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:138) - Starting new configuration:{ sourceRunners:{http-source=EventDrivenSourceRunner: { source:org.apache.flume.source.http.HTT$
17 Dec 2015 13:35:37,844 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:145) - Starting Channel mysql-channel
17 Dec 2015 13:35:37,910 INFO [lifecycleSupervisor-1-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.register:110) - Monitoried counter group for type: CHANNEL, name: mysql-channel, registered successfully.
17 Dec 2015 13:35:37,910 INFO [lifecycleSupervisor-1-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.start:94) - Component type: CHANNEL, name: mysql-channel started
17 Dec 2015 13:35:37,911 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:173) - Starting Sink mysql-sink
17 Dec 2015 13:35:37,913 INFO [lifecycleSupervisor-1-1] (com.telefonica.iot.cygnus.sinks.OrionMySQLSink.start:153) - [mysql-sink] Startup completed
17 Dec 2015 13:35:37,915 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:184) - Starting Source http-source
17 Dec 2015 13:35:37,916 INFO [lifecycleSupervisor-1-2] (com.telefonica.iot.cygnus.interceptors.GroupingInterceptor.initialize:92) - Grouping rules read:
17 Dec 2015 13:35:37,916 INFO [conf-file-poller-0] (org.apache.flume.node.Application.stopAllComponents:101) - Shutting down configuration: { sourceRunners:{http-source=EventDrivenSourceRunner: { source:org.apache.flume.source.http.HT$
17 Dec 2015 13:35:37,917 INFO [conf-file-poller-0] (org.apache.flume.node.Application.stopAllComponents:105) - Stopping Source http-source
17 Dec 2015 13:35:37,920 ERROR [lifecycleSupervisor-1-2] (com.telefonica.iot.cygnus.interceptors.GroupingInterceptor.parseGroupingRules:165) - Error while parsing the Json-based grouping rules file. Details=null
17 Dec 2015 13:35:37,921 WARN [lifecycleSupervisor-1-2] (com.telefonica.iot.cygnus.interceptors.GroupingInterceptor.initialize:98) - Grouping rules syntax has errors
17 Dec 2015 13:35:37,948 INFO [lifecycleSupervisor-1-2] (org.mortbay.log.Slf4jLog.info:67) - jetty-6.1.26
17 Dec 2015 13:35:37,973 INFO [lifecycleSupervisor-1-2] (org.mortbay.log.Slf4jLog.info:67) - Started SocketConnector#0.0.0.0:5050
17 Dec 2015 13:35:37,974 INFO [lifecycleSupervisor-1-2] (org.apache.flume.instrumentation.MonitoredCounterGroup.register:110) - Monitoried counter group for type: SOURCE, name: http-source, registered successfully.
17 Dec 2015 13:35:37,974 INFO [lifecycleSupervisor-1-2] (org.apache.flume.instrumentation.MonitoredCounterGroup.start:94) - Component type: SOURCE, name: http-source started
17 Dec 2015 13:35:37,974 INFO [conf-file-poller-0] (org.apache.flume.lifecycle.LifecycleSupervisor.unsupervise:171) - Stopping component: EventDrivenSourceRunner: { source:org.apache.flume.source.http.HTTPSource{name:http-source,state$
17 Dec 2015 13:35:37,974 INFO [conf-file-poller-0] (org.mortbay.log.Slf4jLog.info:67) - Stopped SocketConnector#0.0.0.0:5050
17 Dec 2015 13:35:37,975 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:139) - Component type: SOURCE, name: http-source stopped
17 Dec 2015 13:35:37,976 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:145) - Shutdown Metric for type: SOURCE, name: http-source. source.start.time == 1450355737974
17 Dec 2015 13:35:37,976 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:151) - Shutdown Metric for type: SOURCE, name: http-source. source.stop.time == 1450355737975
17 Dec 2015 13:35:37,976 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.append-batch.accepted == 0
17 Dec 2015 13:35:37,976 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.append-batch.received == 0
17 Dec 2015 13:35:37,976 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.append.accepted == 0
17 Dec 2015 13:35:37,976 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.append.received == 0
17 Dec 2015 13:35:37,977 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.events.accepted == 0
17 Dec 2015 13:35:37,977 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.events.received == 0
17 Dec 2015 13:35:37,977 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: SOURCE, name: http-source. src.open-connection.count == 0
17 Dec 2015 13:35:37,977 INFO [conf-file-poller-0] (org.apache.flume.source.http.HTTPSource.stop:172) - Http source http-source stopped. Metrics: SOURCE:http-source{src.events.accepted=0, src.open-connection.count=0, src.append.receiv$
17 Dec 2015 13:35:37,977 INFO [conf-file-poller-0] (org.apache.flume.node.Application.stopAllComponents:115) - Stopping Sink mysql-sink
17 Dec 2015 13:35:37,977 INFO [conf-file-poller-0] (org.apache.flume.lifecycle.LifecycleSupervisor.unsupervise:171) - Stopping component: SinkRunner: { policy:org.apache.flume.sink.DefaultSinkProcessor#76da521f counterGroup:{ name:nul$
17 Dec 2015 13:35:37,987 INFO [conf-file-poller-0] (org.apache.flume.node.Application.stopAllComponents:125) - Stopping Channel mysql-channel
17 Dec 2015 13:35:37,987 INFO [conf-file-poller-0] (org.apache.flume.lifecycle.LifecycleSupervisor.unsupervise:171) - Stopping component: org.apache.flume.channel.MemoryChannel{name: mysql-channel}
17 Dec 2015 13:35:37,987 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:139) - Component type: CHANNEL, name: mysql-channel stopped
17 Dec 2015 13:35:37,987 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:145) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.start.time == 1450355737910
17 Dec 2015 13:35:37,988 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:151) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.stop.time == 1450355737987
17 Dec 2015 13:35:37,988 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.capacity == 1000
17 Dec 2015 13:35:37,988 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.current.size == 0
17 Dec 2015 13:35:37,988 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.event.put.attempt == 0
17 Dec 2015 13:35:37,988 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.event.put.success == 0
17 Dec 2015 13:35:37,988 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.event.take.attempt == 1
17 Dec 2015 13:35:37,989 INFO [conf-file-poller-0] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:167) - Shutdown Metric for type: CHANNEL, name: mysql-channel. channel.event.take.success == 0
17 Dec 2015 13:35:37,989 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:138) - Starting new configuration:{ sourceRunners:{http-source=EventDrivenSourceRunner: { source:org.apache.flume.source.http.HTT$
17 Dec 2015 13:35:37,989 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:145) - Starting Channel mysql-channel
17 Dec 2015 13:35:37,989 INFO [lifecycleSupervisor-1-3] (org.apache.flume.instrumentation.MonitoredCounterGroup.start:94) - Component type: CHANNEL, name: mysql-channel started
17 Dec 2015 13:35:37,992 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:173) - Starting Sink mysql-sink
17 Dec 2015 13:35:37,993 INFO [lifecycleSupervisor-1-8] (com.telefonica.iot.cygnus.sinks.OrionMySQLSink.start:153) - [mysql-sink] Startup completed
17 Dec 2015 13:35:37,993 INFO [conf-file-poller-0] (org.apache.flume.node.Application.startAllComponents:184) - Starting Source http-source
17 Dec 2015 13:35:37,993 INFO [lifecycleSupervisor-1-4] (com.telefonica.iot.cygnus.interceptors.GroupingInterceptor.initialize:92) - Grouping rules read:
17 Dec 2015 13:35:37,994 ERROR [lifecycleSupervisor-1-4] (com.telefonica.iot.cygnus.interceptors.GroupingInterceptor.parseGroupingRules:165) - Error while parsing the Json-based grouping rules file. Details=null
17 Dec 2015 13:35:37,994 WARN [lifecycleSupervisor-1-4] (com.telefonica.iot.cygnus.interceptors.GroupingInterceptor.initialize:98) - Grouping rules syntax has errors
17 Dec 2015 13:35:37,994 INFO [lifecycleSupervisor-1-4] (org.mortbay.log.Slf4jLog.info:67) - jetty-6.1.26
17 Dec 2015 13:35:37,996 INFO [lifecycleSupervisor-1-4] (org.mortbay.log.Slf4jLog.info:67) - Started SocketConnector#0.0.0.0:5050
17 Dec 2015 13:35:37,996 INFO [lifecycleSupervisor-1-4] (org.apache.flume.instrumentation.MonitoredCounterGroup.start:94) - Component type: SOURCE, name: http-source started
Then I tried to subscribe the previously mentioned data to cygnus:
(curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \
--header 'Accept: application/json' -d #- | python -mjson.tool) <<EOF
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [
"pressure"
"temperature"
],
"reference": "http://localhost:5050/notify",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"pressure",
"temperature"
]
}
],
"throttling": "PT1S"
}
EOF
Even after I updated the information on context Broker thinking it would trigger an event:
(curl localhost:1026/v1/updateContext -s -S --header 'Content-Type: application/json' \
--header 'Accept: application/json' -d #- | python -mjson.tool) <<EOF
{
"contextElements": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1",
"attributes": [
{
"name": "temperature",
"type": "float",
"value": "333"
},
{
"name": "pressure",
"type": "integer",
"value": "555"
}
]
}
],
"updateAction": "APPEND"
}
EOF
But the cygnus log remainged exactly the same and its like nothing even got through to it. Which is odd considering my agent_1.conf:
# Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-cygnus (FI-WARE project).
#
# fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
# later version.
# fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see
# http://www.gnu.org/licenses/.
#
# For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es
#=============================================
# To be put in APACHE_FLUME_HOME/conf/agent.conf
#
# General configuration template explaining how to setup a sink of each of the available types (HDFS, CKAN, MySQL).
#=============================================
# The next tree fields set the sources, sinks and channels used by Cygnus. You could use different names than the
# ones suggested below, but in that case make sure you keep coherence in properties names along the configuration file.
# Regarding sinks, you can use multiple types at the same time; the only requirement is to provide a channel for each
# one of them (this example shows how to configure 3 sink types at the same time). Even, you can define more than one
# sink of the same type and sharing the channel in order to improve the performance (this is like having
# multi-threading).
cygnusagent.sources = http-source
cygnusagent.sinks = mysql-sink
cygnusagent.channels = mysql-channel
#=============================================
# source configuration
# channel name where to write the notification events
cygnusagent.sources.http-source.channels = mysql-channel
# source class, must not be changed
cygnusagent.sources.http-source.type = org.apache.flume.source.http.HTTPSource
# listening port the Flume source will use for receiving incoming notifications
cygnusagent.sources.http-source.port = 5050
# Flume handler that will parse the notifications, must not be changed
cygnusagent.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.OrionRestHandler
# URL target
cygnusagent.sources.http-source.handler.notification_target = /notify
# Default service (service semantic depends on the persistence sink)
cygnusagent.sources.http-source.handler.default_service = Trace_Data
# Default service path (service path semantic depends on the persistence sink)
cygnusagent.sources.http-source.handler.default_service_path = Sensor
# Number of channel re-injection retries before a Flume event is definitely discarded (-1 means infinite retries)
cygnusagent.sources.http-source.handler.events_ttl = 10
# Source interceptors, do not change
cygnusagent.sources.http-source.interceptors = ts gi
# TimestampInterceptor, do not change
cygnusagent.sources.http-source.interceptors.ts.type = timestamp
# GroupinInterceptor, do not change
cygnusagent.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.GroupingInterceptor$Builder
# Grouping rules for the GroupingInterceptor, put the right absolute path to the file if necessary
# See the doc/design/interceptors document for more details
cygnusagent.sources.http-source.interceptors.gi.grouping_rules_conf_file = /usr/cygnus/conf/grouping_rules.conf
# ============================================
# OrionMySQLSink configuration
# channel name from where to read notification events
cygnusagent.sinks.mysql-sink.channel = mysql-channel
# sink class, must not be changed
cygnusagent.sinks.mysql-sink.type = com.telefonica.iot.cygnus.sinks.OrionMySQLSink
# true if the grouping feature is enabled for this sink, false otherwise
cygnusagent.sinks.mysql-sink.enable_grouping = false
# the FQDN/IP address where the MySQL server runs
cygnusagent.sinks.mysql-sink.mysql_host = 127.0.0.1
# the port where the MySQL server listes for incomming connections
cygnusagent.sinks.mysql-sink.mysql_port = 3306
# a valid user in the MySQL server
cygnusagent.sinks.mysql-sink.mysql_username = root
# password for the user above
cygnusagent.sinks.mysql-sink.mysql_password = klasika
# how the attributes are stored, either per row either per column (row, column)
cygnusagent.sinks.mysql-sink.attr_persistence = column
# select the table type from table-by-destination and table-by-service-path
cygnusagent.sinks.mysql-sink.table_type = table-by-destination
# number of notifications to be included within a processing batch
cygnusagent.sinks.mysql-sink.batch_size = 1
# timeout for batch accumulation
cygunsagent.sinks.mysql-sink.batch_timeout = 30
#=============================================
# mysql-channel configuration
# channel type (must not be changed)
cygnusagent.channels.mysql-channel.type = memory
# capacity of the channel
cygnusagent.channels.mysql-channel.capacity = 1000
# amount of bytes that can be sent per transaction
cygnusagent.channels.mysql-channel.transactionCapacity = 100
#============================================
It has 5050 and notify as the reference address. I double checked the cygnus_instance_1.conf as well and it is pointing at agent_1.conf
#####
#
# Configuration file for apache-flume
#
#####
# Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-cygnus (FI-WARE project).
#
# fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
# later version.
# fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see
# http://www.gnu.org/licenses/.
#
# For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es
# Who to run cygnus as. Note that you may need to use root if you want
# to run cygnus in a privileged port (<1024)
CYGNUS_USER=cygnus
# Where is the config folder
CONFIG_FOLDER=/usr/cygnus/conf
# Which is the config file
CONFIG_FILE=/usr/cygnus/conf/agent_1.conf
# Name of the agent. The name of the agent is not trivial, since it is the base for the Flume parameters
# naming conventions, e.g. it appears in .sources.http-source.channels=...
AGENT_NAME=cygnusagent
# Name of the logfile located at /var/log/cygnus. It is important to put the extension '.log' in order to the log rotation works properly
LOGFILE_NAME=cygnus.log
# Administration port. Must be unique per instance
ADMIN_PORT=8081
# Polling interval (seconds) for the configuration reloading
POLLING_INTERVAL=30
This is the content of my config folder in /usr/cygnus/conf:
[root#centos conf]# ls
agent_1.conf cygnus_instance_1.conf flume-env.sh grouping_rules.conf krb5.conf krb5_login.conf log4j.properties.template
agent.conf.template cygnus_instance.conf.template flume-env.sh.template grouping_rules.conf.template krb5.conf.template log4j.properties README.md
I noticed that there is an exacted mirror of this in /etc/cygnus/conf but I didn't touch anything because the installation only intructs me to use the /usr/ folder.
Here is my Mysql create statement. In this table I am expecting to receive the context broker data but I get nothing of course since the log didnt register anything.
CREATE TABLE sensor_room1_room (
sensorID INT NOT NULL AUTO_INCREMENT,
recvTime mediumtext,
fiwareservicepath text,
entityId text,
entityType text,
pressure text,
pressure_md text,
temperature text,
temperature_md text,
PRIMARY KEY (sensorID));
Edit 1:
Here is the listener
[root#centos conf]# nc -l 5050
But when I tried subscribing or updating context, nothing was received on the listener side. I am not taking into account the client side of nc: nc 127.0.0.1 5050 because it successfully sends everything i type (even gibberish).
I also tried the test: /usr/cygnus/bin/cygnus-flume-ng agent --conf /usr/cygnus/conf/ -f /usr/cygnus/conf/agent_1.conf -n cygnusagent -Dflume.root.logger=DEBUG,console. I tried both 5050 and 8081 ports to subscribe to and then update context but nothing is read on the console.
Since I seriously have no idea why that subscription didn't work, but thanks to #fgalan I did manage to read the logs so I am posting the subscription that did trigger the event to cygnus:
(curl localhost:1026/v1/subscribeContext -s -S --header 'Content-Type: application/json' \
--header 'Accept: application/json' -d #- | python -mjson.tool) <<EOF
{
"entities": [
{
"type": "Room",
"isPattern": "false",
"id": "Room1"
}
],
"attributes": [
"temperature"
],
"reference": "http://localhost:5050/notify",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"pressure"
]
}
],
"throttling": "PT5S"
}
EOF
Thank you #fgalan one more time!

mysql freeradius

I just installed freeradius-server-2.2.0 from tarball.
I want to connect freeradius using mysql server.
But when i running radius on foreground with radiusd -X and I got error message like bellow :
Fri Mar 8 13:44:46 2013 : Debug: group_membership_query = "SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority"
Fri Mar 8 13:44:46 2013 : Debug: connect_failure_retry_delay = 60
Fri Mar 8 13:44:46 2013 : Debug: simul_count_query = ""
Fri Mar 8 13:44:46 2013 : Debug: simul_verify_query = "SELECT radacctid, acctsessionid, username, nasipaddress, nasportid, framedipaddress, callingstationid, framedprotocol FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL"
Fri Mar 8 13:44:46 2013 : Debug: postauth_query = "INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S')"
Fri Mar 8 13:44:46 2013 : Debug: safe-characters = "#abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
Fri Mar 8 13:44:46 2013 : Debug: }
Fri Mar 8 13:44:46 2013 : Error: Could not link driver rlm_sql_mysql: rlm_sql_mysql.so: cannot open shared object file: No such file or directory
Fri Mar 8 13:44:46 2013 : Error: Make sure it (and all its dependent libraries!) are in the search path of your system's ld.
Fri Mar 8 13:44:46 2013 : Error: /usr/local/etc/raddb/sql.conf[22]: Instantiation failed for module "sql"
Fri Mar 8 13:44:46 2013 : Error: /usr/local/etc/raddb/sites-enabled/default[177]: Failed to find "sql" in the "modules" section.
Fri Mar 8 13:44:46 2013 : Error: /usr/local/etc/raddb/sites-enabled/default[69]: Errors parsing authorize section.
It's also happen on my freeradius ldap?
[error LDAP]
/usr/local/etc/raddb/modules/ldap[29]: Failed to link to module 'rlm_ldap': rlm_ldap.so: cannot open shared object file: No such file or directory
/usr/local/etc/raddb/sites-enabled/default[305]: Failed to find "ldap" in the "modules" section.
/usr/local/etc/raddb/sites-enabled/default[305]: Failed to parse "ldap"
How i can solve this issue ?
i've installed libmysqlclient-dev on my ubuntu.
I'm running on Ubuntu 12.04.
Help me to solve this.
Thanks
You did re-run configure right, after installing the development headers?
When building from source you will need to do a:
./configure <options> && make && make install
To actually install the module.

Vagrant Chef Recipe Checksum Calculations

I am running a mysql recipe that is failing. When I do vagrant up after a halt it claims that grants.sql template's checksum has changed causing it to re-run when it shouldn't.
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: Processing template[/etc/mysql/grants.sql] action create (mysql::server line 128)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] DEBUG: Current content's checksum: 3992e44304b56cebdbd4bf23183ddd78f877539c025227546e19098b0b5872ca
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] DEBUG: Rendered content's checksum: f967f212b3e7b25a08ed35d086938846c188f6e9980a1ecc42635136841587a4
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: template[/etc/mysql/grants.sql] backed up to /var/chef/backup/etc/mysql/grants.sql.chef-20120328125848
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: template[/etc/mysql/grants.sql] updated content
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: template[/etc/mysql/grants.sql] sending run action to execute[mysql-install-privileges] (immediate)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: Processing execute[mysql-install-privileges] action run (mysql::server line 137)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: execute[mysql-install-privileges] sh(/usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] ERROR: execute[mysql-install-privileges] (mysql::server line 137) has had an error
[Wed, 28 Mar 2012 12:58:48 -0700] ERROR: template[/etc/mysql/grants.sql] (/tmp/vagrant-chef-1/chef-solo-1/mysql/recipes/server.rb:128:in `rescue in from_file') had an error:
execute[mysql-install-privileges] (mysql::server line 137) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql ----
STDOUT:
STDERR: ERROR 1396 (HY000) at line 12: Operation CREATE USER failed for 'root'#'%'
---- End output of /usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql ----
Ran /usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql returned 1
Any ideas how these checksums are completed and how to fix this?
The best way to debug these issues is to take a look at the new file it created, in this case at /etc/mysql/grants.sql, and then to look at the backup at /var/chef/backup/etc/mysql/grants.sql.chef-20120328125848 (from the logs you posted). The backup is always made, so you can compare the contents of the two, and proceed to fix the Chef recipe to make sure it generates the same content.