bug in lift-omniauth?

101 views
Skip to first unread message

Andrew Bucknell

unread,
Jan 25, 2013, 4:24:21 AM1/25/13
to lif...@googlegroups.com
Hi,
I am exploring lift-omniauth and encountering a problem as showin in the stacktrace below.

I am using the lift_basic app and adding omniauth support. When using lift-omniauth 2.4-0.5 the validation email on user signup fires off fine. If I modify my build.sbt to use lift-omniauth 2.4-0.6 I get the below stack trace. The signup process works fine (the user is added to the db etc) but the email fails.

Sample code illustrating this can be found at https://github.com/undrewb/lift_oauth2_test

Is there a configuration setting I am missing or is this a bug? I am new to lift and scala so Im not sure how to drill right down to diagnose the problem.

20:12:22.144 [pool-59-thread-5] ERROR net.liftweb.util.Mailer - Couldn't send mail
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'mail' or call 'Send()' was not found.
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:98) ~[appengine-api-1.0-sdk-1.4.3.jar:na]
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:50) ~[appengine-api-1.0-sdk-1.4.3.jar:na]
at com.google.appengine.api.mail.MailServiceImpl.doSend(MailServiceImpl.java:95) ~[appengine-api-1.0-sdk-1.4.3.jar:na]
at com.google.appengine.api.mail.MailServiceImpl.send(MailServiceImpl.java:32) ~[appengine-api-1.0-sdk-1.4.3.jar:na]
at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:247) ~[appengine-api-1.0-sdk-1.4.3.jar:na]
at javax.mail.Transport.send0(Transport.java:195) ~[mail-1.4.4.jar:1.4.4]
at javax.mail.Transport.send(Transport.java:124) ~[mail-1.4.4.jar:1.4.4]
at net.liftweb.util.Mailer$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:189) ~[lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:189) ~[lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$class.performTransportSend(Mailer.scala:183) ~[lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$.performTransportSend(Mailer.scala:31) ~[lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$class.msgSendImpl(Mailer.scala:257) ~[lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$.msgSendImpl(Mailer.scala:31) ~[lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$MsgSender$$anonfun$messageHandler$1.apply(Mailer.scala:167) [lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$MsgSender$$anonfun$messageHandler$1.apply(Mailer.scala:164) [lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$class.execTranslate(LiftActor.scala:321) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$MsgSender.execTranslate(Mailer.scala:163) [lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor$SpecializedLiftActor$$proc2(LiftActor.scala:289) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply$mcV$sp(LiftActor.scala:210) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply(LiftActor.scala:210) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply(LiftActor.scala:210) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$class.around(LiftActor.scala:224) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.util.Mailer$MsgSender.around(Mailer.scala:163) [lift-util_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:209) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.SpecializedLiftActor$$anonfun$2$$anonfun$apply$mcV$sp$1.apply$mcV$sp(LiftActor.scala:173) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at net.liftweb.actor.LAScheduler$$anonfun$9$$anon$2$$anon$3.run(LiftActor.scala:64) [lift-actor_2.9.1-2.5-M3.jar:2.5-M3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_12-ea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_12-ea]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_12-ea]

Andrew Bucknell

unread,
Jan 25, 2013, 5:00:30 AM1/25/13
to lif...@googlegroups.com
Additional note - Ive tried updating my build.sbt to use     "net.liftmodules" %% "omniauth" % "2.5-SNAPSHOT-0.7-SNAPSHOT" but the error persists.

Alexandre Richonnier

unread,
Jan 25, 2013, 8:35:26 AM1/25/13
to lif...@googlegroups.com
This is related to which mail library you use.

Check your dependencies.

You have probably a conflict between gae mail in  "net.databinder"          %% "dispatch-gae"             % databinderVersion
and java mail.

Alexandre Richonnier

Andrew Bucknell

unread,
Jan 25, 2013, 8:50:52 AM1/25/13
to lif...@googlegroups.com
Thanks for your reply Alexandre.

Ive had a look at my dependencies and I only have the ones in my list below. 
It looks like one of the dispatch dependencies is bringing in gae but as Im not in a gae environment I cant figure out whats changed. Im also perplexed why things work fine with omniauth 2.4-0.5 but dont seem to work with any later versions.

I'll keep digging and looking as I need to work this out - any pointers are greatly appreciated.

libraryDependencies += "org.mortbay.jetty" % "jetty" % "6.1.26" % "container"

libraryDependencies += "net.tanesha.recaptcha4j" % "recaptcha4j" % "0.0.7"

libraryDependencies ++= { 
  val liftVersion = "2.5-SNAPSHOT"
  Seq(
    "net.liftweb" %% "lift-webkit" % liftVersion % "compile",
    "net.liftweb" %% "lift-mapper" % liftVersion % "compile",
    "junit" % "junit" % "4.7" % "test",
    "ch.qos.logback" % "logback-classic" % "0.9.26",
    "org.scala-tools.testing" %% "specs" % "1.6.9" % "test",
    "mysql" % "mysql-connector-java" % "5.1.12",
    "net.liftmodules" % "facebook_2.9.1" % "2.5-M1-1.1",
    "net.liftmodules" %% "omniauth" % "2.5-SNAPSHOT-0.7-SNAPSHOT"
  )
}


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

Alexandre Richonnier

unread,
Jan 25, 2013, 9:05:35 AM1/25/13
to lif...@googlegroups.com
It's related to this change:
https://github.com/ghostm/lift-omniauth/commit/1e4e63239e8c85cd5575c7d455953818aa879355

In my case to fix this problem, I compile my own omni-auth version.

You can do the same, or open a ticket to the omni-auth developer.

Alexandre Richonnier

Andrew Bucknell

unread,
Jan 25, 2013, 9:08:32 AM1/25/13
to lif...@googlegroups.com
Thanks for your help Alexandre. I will build my own copy for now.

Alexandre Richonnier

unread,
Jan 25, 2013, 9:37:43 AM1/25/13
to lif...@googlegroups.com
... remove gae dependency, clear target. fix some code... and that all.

Andrew Bucknell

unread,
Jan 26, 2013, 3:37:43 AM1/26/13
to lif...@googlegroups.com
Thank you! I commented out the gae dependency, compiled the lib and did a publish-local. Problem solved. Really appreciate your assistance.

Viktor Hedefalk

unread,
May 22, 2013, 9:18:54 AM5/22/13
to lif...@googlegroups.com
I just struck this too. liftmodules.omniauth pulls in gae-stuff that
breaks mailing in lift:

+-net.liftmodules:omniauth_2.10:2.5-RC2-0.7 [S]
[info] | +-net.databinder:dispatch-core_2.10:0.8.9 [S]
[info] | | +-org.apache.httpcomponents:httpclient:4.1.3
[info] | | +-commons-codec:commons-codec:1.4 (evicted by: 1.6)
[info] | | +-commons-logging:commons-logging:1.1.1
[info] | | +-org.apache.httpcomponents:httpcore:4.1.4
[info] | |
[info] | +-net.databinder:dispatch-gae_2.10:0.8.9 [S]
[info] | | +-com.google.appengine:appengine-api-1.0-sdk:1.5.5
[info] | | +-net.databinder:dispatch-http_2.10:0.8.9 [S]
[info] | | | +-net.databinder:dispatch-core_2.10:0.8.9 [S]
[info] | | | | +-org.apache.httpcomponents:httpclient:4.1.3
[info] | | | | +-commons-codec:commons-codec:1.4 (evicted by: 1.6)
[info] | | | | +-commons-logging:commons-logging:1.1.1
[info] | | | | +-org.apache.httpcomponents:httpcore:4.1.4
[info] | | | |
[info] | | | +-net.databinder:dispatch-futures_2.10:0.8.9 [S]
[info] | | | | +-org.scala-lang:scala-actors:2.10.0 [S]
[info] | | | |
[info] | | | +-org.apache.httpcomponents:httpclient:4.1.3
[info] | | | +-commons-codec:commons-codec:1.4 (evicted by: 1.6)
[info] | | | +-commons-logging:commons-logging:1.1.1
[info] | | | +-org.apache.httpcomponents:httpcore:4.1.4
[info] | | |
[info] | | +-org.apache.httpcomponents:httpclient:4.1.3
[info] | | +-commons-codec:commons-codec:1.4 (evicted by: 1.6)
[info] | | +-commons-logging:commons-logging:1.1.1
[info] | | +-org.apache.httpcomponents:httpcore:4.1.4


My quickfix is to just exclude the transitive gae dep:

"net.liftmodules" %% "omniauth" % (liftModulesLiftVersion+"-0.7")
exclude("net.databinder", "dispatch-gae_2.10"),

However, this sucks since this will break RUNTIME when I update to
scala 2.11. I couldn't get either:

"net.liftmodules" %% "omniauth" % (liftModulesLiftVersion+"-0.7")
exclude("net.databinder", "dispatch-gae")

nor ExcludeAll(organization="net.databinder" name="dispatch-gae")

to remove the dependency. Any tips on how to do this better? Couldn't
find any doc about wildcard exclusion in sbt…?

And isn't this really a bug that should be fixed in lift-omniauth?

Thanks,
Viktor

Richard Dallaway

unread,
May 22, 2013, 10:23:25 AM5/22/13
to liftweb
I'm not sure what that module uses GAE for.  It builds without it, and as far as I can tell support was removed:


I'd suggest removing the library from the module if it's not used.  If it is wanted, perhaps the "val http" can be made pluggable in some way so anyone trying GAE can include the Google dependency themselves.

Richard



You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



ghostM

unread,
May 22, 2013, 12:23:34 PM5/22/13
to lif...@googlegroups.com
I've removed the GAE dependency for the time being.  Thanks for bringing this to my attention.

If anyone knows of an elegant way of having that be optionally included and provides a pull request I'll merge it into master

-Matt

Viktor Hedefalk

unread,
May 22, 2013, 3:11:52 PM5/22/13
to lif...@googlegroups.com
Great!

Isn't it enough to make Omniauth a trait + empty object extending it?
And just write a simple instruction on how to add the dep to
dispatch-gae and override Omniauth.http?

I might have a pull request in a bit.

Thanks,
Viktor

Viktor Hedefalk

unread,
May 22, 2013, 3:25:23 PM5/22/13
to lif...@googlegroups.com
Please let me know if I misunderstood - otherwise I made a pull
request in case its good enough:

https://github.com/ghostm/lift-omniauth/pull/18

Thanks,
Viktor

Richard Dallaway

unread,
May 23, 2013, 6:26:09 AM5/23/13
to liftweb
That was built and published yesterday as:

"net.liftmodules" %% "omniauth_2.5" % "0.7-SNAPSHOT"


Reply all
Reply to author
Forward
0 new messages