undefined method merge - datamapper

merb datamapper seems to be broken.
$ merb
Loading init file from /home/kristian/workspace/ruby/nightly/config/init.rb
Loading /home/kristian/workspace/ruby/nightly/config/environments/development.rb
:size option is deprecated, use String with :length instead (/usr/lib/ruby/gems/1.8/gems/merb_datamapper-1.0.12/lib/merb/session/data_mapper_session.rb:10)
~ Connecting to database...
~ Loaded slice 'MerbAuthSlicePassword' ...
~ Parent pid: 5790
/usr/lib/ruby/gems/1.8/gems/merb_datamapper-1.0.12/lib/merb_datamapper.rb:61:in `run': undefined method `merge' for #<DataMapper::Model::DescendantSet:0xb6f9bd14> (NoMethodError)
Anyone know how to fix this?
I just uninstalled merb and installed it once again, but I am still getting this error.

Try upgrading to Merb 1.0.15, which was just released a few days ago. It adds support for the new DataMapper series and resolves this specific issue.
I believe the gems are on gemcutter now, so you should probably follow these installation instructions:
http://wiki.github.com/merb/merb/howto-install

Related

Dropped rows in Spark when modifying database in MySQL

I've been following the 5 min how to for setting up an htap databse with tidb_tispark and everything works until I get to the section Launch TiSpark. My first issue occurs when executing the line:
docker-compose exec tispark-master /opt/spark-2.1.1-bin-hadoop2.7/bin/spark-shell
But I got around that by modifying the spark version to the version I found inside the container:
docker-compose exec tispark-master /opt/spark-2.3.3-bin-hadoop2.7/bin/spark-shell
My second issue occurs when executing the three line block:
import org.apache.spark.sql.TiContext
val ti = new TiContext(spark)
ti.tidbMapDatabase("TPCH_001")
When I run the last statement I get the following output
scala> ti.tidbMapDatabase("TPCH_001")
2019-07-11 16:14:32 WARN General:96 - Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/opt/spark/jars/datanucleus-core-3.2.10.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/opt/spark-2.3.3-bin-hadoop2.7/jars/datanucleus-core-3.2.10.jar."
2019-07-11 16:14:32 WARN General:96 - Plugin (Bundle) "org.datanucleus.api.jdo" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/opt/spark/jars/datanucleus-api-jdo-3.2.6.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/opt/spark-2.3.3-bin-hadoop2.7/jars/datanucleus-api-jdo-3.2.6.jar."
2019-07-11 16:14:32 WARN General:96 - Plugin (Bundle) "org.datanucleus.store.rdbms" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/opt/spark/jars/datanucleus-rdbms-3.2.9.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/opt/spark-2.3.3-bin-hadoop2.7/jars/datanucleus-rdbms-3.2.9.jar."
2019-07-11 16:14:36 WARN ObjectStore:568 - Failed to get database global_temp, returning NoSuchObjectException
This doesn't prevent me from running the query:
spark.sql("select * from nation").show(30);
But when I follow the further steps of the tutorial to modify the db from MySQL, the changes are not reflected immediately in Spark. Furthermore, at some point in the future (I believe > 5 minutes later), the row that was modified stops showing up in Spark SQL queries.
I'm rather new to this kind of setup and don't really know how to debug this issue. Searches for the warnings I received weren't illuminating.
I don't know if it's helpful but when I connect MySQL this is the server version I get:
Server version: 5.7.25-TiDB-v3.0.0-rc.1-309-g8c20289c7 MySQL Community Server (Apache License 2.0)
I'm one of the main dev of TiSpark. Sorry for your bad experience with it.
Due to my docker problem, I cannot directly reproduce your issue but it seems you hit one of the bug fixed recently.
https://github.com/pingcap/tispark/pull/862/files
The tutorial document is not quite up-to-date and points to an older version. That's why it didn't work with spark 2.1.1 as in tutorial. We will update it ASAP.
Newer version of TiSpark doesn't use tidbMapDatabase anymore but hooks with catalog directly instead. Method tidbMapDatabase remains for backward compatibility. Unfortunately, the tidbMapDatabase had a bug(when we ported it from older version) that it retrieves timestamp for query only once you call the function. That causes TiSpark always uses old timestamp to do snapshot reading and newer data would never be seen by it.
In newer version of TiSpark (TiSpark 2.0+ with Spark 2.3+), databases and tables are directly hooked into catalog services and you can directly call
spark.sql("use TPCH_001").show
spark.sql("select * from nation").show
This should give you fresh data.
So try restart your Spark driver, just try the two lines of code above and see if it works.
Let me know if this fix your problem. On the other hand, we will check our docker image to make sure if it contains the fix already.
If things still get wrong, would you please help to run below code and let us know the version of TiSpark.
spark.sql("select ti_version()").show
Again, sorry for causing you trouble and thanks for trying.
EDIT
To address your comment:
The warning is due to spark itself will try to locate the database in its native catalog first and this will cause a Failed to get warning. But the failover process will delegate the search to tispark and then behave correctly. So this warning can be ignored. It's recommended that add below lines to your log4j.properties in conf folder of your spark.
log4j.logger.org.apache.hadoop.hive.metastore.ObjectStore=ERROR
We will polish the docker tutorial image soon. Thank you so much for trying.

Service fabric upgrade failing due to change in namespace

I have a service fabric application stuck in "Upgrading" mode.
The exception is:
Could not load type 'DB.IAddUser' from assembly 'DB' at
WebApi.Startup.ConfigureServices(IServiceCollection services)
My change was that of renaming the name space, from 'DB' to 'DB.Interfaces'.
This class is only used as a constructor dependency, and registered as such
Startup.cs
services.AddSingleton<IAddUser, AddUser>();
UserController.cs
private IAddUser addUser;
public UserController(IAddUser addUser){
this.addUser = addUser;
}
Why would this cause SF to get stuck?
Additionally, it only got stuck on the last upgrade domain, and not on the others.
I might be mistaken but if upgrade was successful on other upgrade domains then it is not code related issue.
Try to rollback the application upgrade and upgrade again:
Start-ServiceFabricApplicationRollback -ApplicationName fabric:/MyApp
documentation
It turns out that this had nothing to do with service fabric (as expected and as #SteppingRazor said).
The problem seems to be related to MSBuild/Azure devops build task, I had upgraded nuget package
Microsoft.VisualStudio.Azure.Fabric.MSBuild
from 1.6.7 to 1.6.8 and it seems that the build was still using older code (confirmed via a decompiler).
Reverting back to 1.6.7 solved the issue (albeit its just a workaround)

Grails 2.5.0 + mongo + hibernate

I am trying to use hibernate with mongo driver and experiencing some issues:
I have created brand new grails app, using grails 2.5.0. changed dataSource.groovy to point to mysql, uncommented mysql-connector-java:5.1.29 and everything works fine.
But when i am adding compile "org.grails.plugins:mongodb:5.0.0.RC1" to plugins section in Build Config i get this on startup:
| Error 2016-02-22 14:32:29,439 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder.evaluateMapping
what am i missing?
NB! App does not start, so all internal mappings don't matter at this point.
Here is my config files:
Datasource -> https://cldup.com/GnXUJDOy0b.txt
BuildConfig ->https://cldup.com/xtk5l1F_BW.txt
Error -> https://cldup.com/NJ7vpoX3Kb.txt
It could be useful if you show more code but seems you are not setting the mapping for mongo in the domain class definition :
static mapWith="mongo"
Here you can find an useful tutorial about this
I could not find a way to make mongodb 5.0.1 to work, after days of searching found this answer. This solution worked.
plugins {
compile (":mongodb:3.0.2") {
excludes 'grails-datastore-gorm-plugin-support'
excludes 'grails-datastore-gorm'
excludes 'grails-datastore-core'
}
}
and then in dependencies, pull the correct ones in:
dependencies {
compile 'org.grails:grails-datastore-gorm-plugin-support:3.1.3.RELEASE'
compile 'org.grails:grails-datastore-gorm:3.1.3.RELEASE'
compile 'org.grails:grails-datastore-core:3.1.3.RELEASE'
}
from here Cannot install Grails MongoDB plugin
Hope this will save someone a great deal of time and effort.

Can't Inhibit deprecation warnings in PromiseKit added throu CocoaPods

I'm tring to use PromiseKit throu CocoaPods in my project. Minimum deployment target in projsect is setted to 9.0.
Problem
I'm getting deprecation warnings in PromiseKit which I'm trying to rid of.
Warnings appear in in UIActionSheet+Promise.swift, UIAlertView+Promise.swift, NSURLConnection+Promise.swift.
Things I've done:
I've setted Pods > Building settings > Deprecated Function to No
Add inhibit_all_warnings! to Podfile and reinstall pod
Podfile
use_frameworks!
inhibit_all_warnings!
pod "PromiseKit", "~> 3.0", :inhibit_warnings => true
Question
I'm doing something wrong? Is there another way to do that?

Jenkins plugins in jruby, can't get it to work

I've tried to get this to work on several operating systems (Windows 7, OS X and Ubuntu) and I'm about to give up on this.
I've followed the guide on https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+plugin+development+in+Ruby
On Windows 7, bundle fails until I add another "rescue" for Errno::EAGAIN in faster.rb.
When I run jpi server to test the plugins I get the following error:
[...]
INFO: Injecting JRuby into XStream
LoadError: no such file to load -- jenkins/plugin/runtime
require at org/jruby/RubyKernel.java:1038
(root) at < script >:1
2012-jan-26 09:17:31 jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading plugin ruby-prototype
hudson.util.IOException2: Failed to initialize
[...]
Is this a known issue? I found that some had similar problems last year in August, the answers suggests that this is now fixed.
Suggestions or a solution to this problem would be much appreciated.
// Jens
The support for windows is just poor at the moment and the plugin ruby-prototype is no longer maintained either. It seems like moving to a unix-based OS and trying out existing official ruby plugins from jenkins-ci.org is the best bet to start developing ruby plugins.