Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuid1() fails in Erlang 19.3 but not in Erlang 20 #18

Open
tommyjcarpenter opened this issue Feb 7, 2018 · 5 comments
Open

uuid1() fails in Erlang 19.3 but not in Erlang 20 #18

tommyjcarpenter opened this issue Feb 7, 2018 · 5 comments
Labels

Comments

@tommyjcarpenter
Copy link

tommyjcarpenter commented Feb 7, 2018

The same line:

uuid:to_string(uuid:uuid1()))

Fails in Erlang 19.3, but works in 20. In 19.3 it bombs with the error:

Failure/Error: {error,badarg,
                    [{uuid,to_string,1,
                         [{file,
                              "/tmp/_build/default/lib/uuid/src/uuid.erl"},
                          {line,238}]},

However,

uuid:to_string(uuid:uuid4())

works in both. I'm not an expert in Erlang, HOWEVER my guess is it has something to do with os.timestamp here: https://github.com/avtobiff/erlang-uuid/blob/master/src/uuid.erl#L101
This is just a guess of where the problem is because I recall that Erlang changed the behavior of this at some point.

@tommyjcarpenter
Copy link
Author

this also fails again in erl 21

@avtobiff avtobiff added the Bug label Dec 10, 2018
@avtobiff
Copy link
Owner

Sorry for not having time looking into this until now.

Is this related to #19 ?

What environment is used? (OS, Erlang from source or package manager etc?)

@tommyjcarpenter
Copy link
Author

RE #19 , it could be (see below*), but my original hunch was that it was related to the Erlang timestamp changes, because UUID4 works fine, and UUID1 is the method that uses the timestamp.

This is running in the standard Erlang Docker release. This issue does not happen on my personal MAC*, but only happens when I use the more recent versions of Erlang in Docker which are Unix (alpine? Ubuntu?). Because of this the host OS is different, see here: https://hub.docker.com/_/erlang/)

@avtobiff
Copy link
Owner

avtobiff commented Dec 13, 2018

I've tried OTP 19, 20, and 21; and also tried the docker images for said
releases and I can't reproduce the issue.

What version of erlang-uuid do you use? If you aren't using v0.5.2 can
you try reproducing the issue with that?

What Docker network driver are you using? I.e. do you have a proper
MAC address in the container?

@tommyjcarpenter
Copy link
Author

tommyjcarpenter commented Dec 23, 2018

Right now I wasn't pinning a particular version, I have in my rebar.config:

{uuid, ".*",  {git, "https://github.com/avtobiff/erlang-uuid.git", {branch, "master"}}},

In Docker Erlang 19 this is blowing up with

  2) util_tests:get_platform_envs_and_config_test/0
     Failure/Error: {error,badarg,
                        [{uuid,to_string,1,
                             [{file,
                                  "/tmp/_build/default/lib/uuid/src/uuid.erl"},
                              {line,245}]},

The calling line is

uuid:to_string(uuid:uuid1()).

Note uuid 4 works fine, e.g.,

uuid:to_string(uuid:uuid4()).

has no problem. That's why I suspect it's related to the timezone changes?

EDIT: this fails for me on v0.5.2 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants