Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Cannot create enum from eu-north-1 value! #210

Closed
jurgispods opened this issue Nov 18, 2019 · 7 comments
Closed

Cannot create enum from eu-north-1 value! #210

jurgispods opened this issue Nov 18, 2019 · 7 comments

Comments

@jurgispods
Copy link

Hi,

after months of smooth operation, I just got the following error:

19/11/18 14:02:42 ERROR ApplicationMaster: User class threw exception: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
        at awscala.package$.<init>(package.scala:3)
        at awscala.package$.<clinit>(package.scala)
[...]
Caused by: java.lang.IllegalArgumentException: Cannot create enum from eu-north-1 value!
        at com.amazonaws.regions.Regions.fromName(Regions.java:88)
        at awscala.Region0$.apply(Region0.scala:12)
        at awscala.Region0$.<init>(Region0.scala:57)
        at awscala.Region0$.<clinit>(Region0.scala)
        ... 24 more

The offending line in my code is:

implicit val s3: awscala.s3.S3 = S3.at(Region.Frankfurt)

That's odd, because Frankfurt is eu-central-1 and has nothing to do with the eu-north-1 region.

It happens during an AWS EMR job. Any ideas what is going on here?

@ocworld
Copy link
Contributor

ocworld commented Nov 20, 2019

In my case, after updating awscala to 0.8.3, the error is occurred. So, I've tried to use awscala 0.8.2, it is not raised.

I do not know a reason. However, I assume that 0.8.3 version has some problems or changes for using APIs.

You can try to change dependencies option like that,

libraryDependencies += "com.github.seratch" %% "awscala" % "0.8.2" 

@seratch
Copy link
Owner

seratch commented Nov 20, 2019

diff: 0.8.2...0.8.3

-lazy val awsJavaSdkVersion = "1.11.541"
+lazy val awsJavaSdkVersion = "1.11.621"

Which AWS SDK version does your app depend on? I'm afraid the problem may be caused by some binary compatibility issues among AWS SDK versions.

@ocworld
Copy link
Contributor

ocworld commented Nov 20, 2019

Surely, the version of sdk used in my app is written in awscala's build sbt file. It is not overwritten and manually set. When I use 0.8.3, awsJavaSdkVersion is "1.11.621".

I'm not sure that it is a general problem among AWS SDK versions. However, In my case, the error is occurred not in 0.8.2 but in 0.8.3.

@jurgispods
Copy link
Author

My problem also started after an (unintentional) upgrade of this library. The AWS SDK used in EMR version 5.20.0 ist 1.11.461, which is "too old" for the current version 0.8.3. I just upgraded to a newer EMR version 5.28.0 and now everything works fine.

@seratch I dont' know if you want to add a workaround for the europe-north-1 region like here? https://github.com/seratch/AWScala/blob/master/core/src/main/scala/awscala/Region0.scala#L54

@seratch
Copy link
Owner

seratch commented Nov 20, 2019

@pederpansen Thanks. I would like to cover all the regions in that code.

@ghost
Copy link

ghost commented Nov 22, 2019

This breaks for me as well moving from "0.8.2" to "0.8.3" with same Cannot create enum from eu-north-1 value.

@seratch
Copy link
Owner

seratch commented Jan 29, 2020

Merged #212

The fix will eliminate the possibility to have this exception in future versions. Allow me to close this issue now.

@seratch seratch closed this as completed Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants