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

procket_mktmp #41

Open
tduccuong opened this issue Oct 17, 2017 · 5 comments
Open

procket_mktmp #41

tduccuong opened this issue Oct 17, 2017 · 5 comments

Comments

@tduccuong
Copy link

Hi, using version 0.9.2 I am randomly getting this error:

{function_clause,[{lists,nth,[1,[]],[{file,"lists.erl"},{line,170}]},{procket_mktmp,template,3,[{file,"_build/default/lib/procket/src/procket_mktmp.erl"},{line,63}]},{procket,make_unix_socket_path,1,[{file,"_build/default/lib/procket/src/procket.erl"},{line,357}]},{procket,open,2,[{file,"_build/default/..."},...]},...]}}},...}

An advice is much appreciated.
Thanks a lot
Cuong

@msantos
Copy link
Owner

msantos commented Oct 17, 2017

Thank you for letting me know about this! Should be fixed in version 0.9.3.

@msantos msantos closed this as completed Oct 17, 2017
msantos added a commit that referenced this issue Oct 17, 2017
Reported in:

#41

Thanks @tduccuong!
@tduccuong
Copy link
Author

Hi @msantos,

I think the patch did not cut it! I still get the same error:

{{function_clause,[{lists,nth,[1,[]],[{file,"lists.erl"},{line,170}]},{procket_mktmp,template,3,[{file,"_build/default/lib/procket/src/procket_mktmp.erl"},{line,63}]},{procket,make_unix_socket_path,1,[{file,"_build/default/lib/procket/src/procket.erl"},{line,357}]},{procket,open,2,[{file,"_build/default/lib/procket/src/procket.erl"},{line,313}]}

Some how the Chars is an empty list eventhough it is a constant!

Could you pls take another look?

Thanks a lot,
Cuong

@msantos
Copy link
Owner

msantos commented Oct 20, 2017

Weird! I may have messed something up!

Could you check you are using the latest version of the procket_mktmp module?

> procket_mktmp:module_info().
[{module,procket_mktmp},
...
 {attributes,[{vsn,[152993229612997397851889811591875413266]}]},
...
 {md5,<<115,25,108,153,174,225,51,100,148,115,34,225,63,
        78,69,18>>}]

The error we were seeing is a little obscure: it happens because lists:nth/2 is trying to access an element outside of the list:

> lists:nth(4, "abc").
** exception error: no function clause matching lists:nth(1,[]) (lists.erl, line 170)

@msantos msantos reopened this Oct 20, 2017
@tduccuong
Copy link
Author

hi,

here is the module info:

...
{vsn,[151734941919204720059147883669516481264]}]},
...
{md5,<<114,39,22,58,45,57,214,70,210,36,66,126,15,168,
        114,240>>}]
...

I have deleted all and rebuilt from beginning for both "master" and "v0.9.3" branches. But get that same above vsn.

@msantos
Copy link
Owner

msantos commented Oct 21, 2017

That's version 0.9.2:

$ git checkout 0.9.2
$ rebar3 do clean, compile, shell
1> procket_mktmp:module_info().
...
 {attributes,[{vsn,[151734941919204720059147883669516481264]}]},
 {md5,<<114,39,22,58,45,57,214,70,210,36,66,126,15,168,
        114,240>>}]

Maybe you have another version of procket in your path. You can check by running:

code:which(procket_mktmp).

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

No branches or pull requests

2 participants