Skip to main content

No user name & "User name mismatch" error

Answered

Comments

19 comments

  • Martin Heistermann
    Gurobi-versary
    First Comment

    I had the same issue on my machine, which was solved by changing my locale setting (i.e., LANG and LC_* environment variables); in particular, `export LC_ALL=C` fixed the issue and gurobi detected my username.

    1
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Florian!

    Did you try changing the LC_ALL environment variable?

    export LC_ALL=C

    Cheers,
    Matthias

    1
  • Olalekan Omoyele
    First Comment

    I have the same problem, but I use windows. I'd be glad if any help can be provided.

    1
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi,

    Your user name is not detected. What operating system are you using? It looks like a Linux/UNIX but what's uncommon is that your home directory is in another subdirectory "cl". Can you please run "whoami" and "uname -a" and post the results here?

    Thanks,
    Matthias

    0
  • Takayoshi Shibahara
    Gurobi-versary
    First Comment
    First Question

    Thank you for the fast reply.

     

    I'm running on Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-165-generic x86_64).

    Yes, my home directory is "/home/cl/takayoshi-s".

    (Subdirectories under "/home" is shared between multiple servers by NFS.)

     

    ---- Result of "whoami" and "uname -a" -----

    takayoshi-s@pine42:~$ whoami

    takayoshi-s

    takayoshi-s@pine42:~$ uname -a

    Linux pine42.naist.jp 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

    ---------

     

    Takayoshi Shibahara

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Takayoshi,

    This is all looking fine so far. Can you please post the output of grbprobe as well?

    Thanks,
    Matthias

    0
  • Takayoshi Shibahara
    Gurobi-versary
    First Comment
    First Question

    Hi Matthias, 

    This is the output of grbprobe.

    ----

    takayoshi-s@pine42:~/venv/GiNZA/bin$ grbprobe

    info  : grbprobe version 9.0.0, build v9.0.0rc2

    HOSTNAME=pine42.naist.jp

    HOSTID=e08e4ce7

    PLATFORM=linux64

    USERNAME=takayoshi-s

    SOCKETS=2

    CORES=36

    CPU=Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz

     

    ----

    Thanks,

    Takayoshi

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Can you successfully run "gurobi_cl --license"?

    Cheers,
    Matthias

    0
  • Takayoshi Shibahara
    Gurobi-versary
    First Comment
    First Question

    At first, there is a problem with running "gurobi_cl --license", so I run "chmod +x" for licence file.

    Then, the problem is solved. 

    After that, I reinstalled gurobipy for a new python virtual environment.

    However, the same problem(No user name & "User name mismatch" error) occurred again.

     

    ----output of "gurobi_cl --license"---

    (tax-org) takayoshi-s@pine42:~$ gurobi_cl --license

    Failed to setup a license

    ERROR 10012: Unable to open Gurobi license file '/home/cl/takayoshi-s/.local/share/gurobi/pine42/gurobi.lic'


    (tax-org) takayoshi-s@pine42:~$ ls -l .local/share/gurobi/pine42/gurobi.lic
    -rw-r--r-- 1 takayoshi-s is-student 207 Nov 28 18:51 .local/share/gurobi/pine42/gurobi.lic
    (tax-org) takayoshi-s@pine42:~$ chmod +r .local/share/gurobi/pine42/gurobi.lic
    (tax-org) takayoshi-s@pine42:~$ gurobi_cl --license
    Using license file /home/cl/takayoshi-s/.local/share/gurobi/pine42/gurobi.lic
    Set parameter LogFile to value gurobi.log
    Academic license - for non-commercial use only

    ----

     

    Thank you for your many responses. 

    Takayoshi

    0
  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    Hi Takayoshi - 

    Can you try running whoami and uname -a from within your Jupyter notebook?

    ! whoami
    ! uname -a

    Thanks, Gwyneth

     

    0
  • Takayoshi Shibahara
    Gurobi-versary
    First Comment
    First Question

    Hi Gwyneth, thank you for your advice.

    I tried both commands on Jupyter and IPython.

    -----

    On Jupyter-Notebook
    ! uname -a
    Linux pine42.naist.jp 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    ! whoami
    takayoshi-s

    On IPython
    In [1]: ! whoami
    takayoshi-s

    In [2]: ! uname -a
    Linux pine42.naist.jp 4.4.0-165-generic #193-Ubuntu SMP Tue Sep 17 17:42:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

    ----

     

    Thanks,

    Takayoshi

    0
  • Sonja Mars
    Gurobi Staff Gurobi Staff

    Thanks for all the details, we will handle your issue inside a regular support request.

    Best regards,

      Sonja

    0
  • Florian Glombik
    Gurobi-versary
    First Comment

    Hey I might have the same issue,

    I do have an academic license and I get the following error when executing my model:

    Set parameter Username
    Error code: 10009. User name mismatch (licensed to 'florian', current user is '')

    When I execute 

    whoami

    the result is

    florian


    Running

     grbprobe 

    results in 

    info  : grbprobe version 10.0.1, build v10.0.1rc0
    PLATFORM=mac64
    USERNAME=
    CPU=Apple M1
    [...other infos]

     

    gurobi_cl --license

    returns

    Set parameter Username
    Set parameter LogFile to value "gurobi.log"

    Failed to set up a license

    Error 10009: User name mismatch (licensed to 'florian', current user is '')

    How can I set the username correctly to be recognized by grbprobe and gurobi_cl?

    0
  • Florian Glombik
    Gurobi-versary
    First Comment

    Thanks for your quick response Matthias!

    export LC_ALL=C

    worked for me! For all IntelliJ Users: you might have to define the LC_ALL variable within the run configuration.

    I'm sorry for the circumstances, I only double-checked that the code accesses the correct username but did not double-check the LC_ALL value.

    0
  • Marcos Campos
    First Comment

    Hello
    I am facing a similar trouble

    When I execute 

    whoami

    the result is

    marcos


    Running

     grbprobe 

    results in 

    iinfo  : Platform is linux64 (linux) - "Ubuntu 20.04.6 LTS"
    HOSTNAME=marcos
    PLATFORM=linux64
    USERNAME=marcos
    [...other infos]

    When I run my python code, I get:

     

    Traceback (most recent call last):
      File "/home/marcos/devSandwich/main.py", line 163, in <module>
        x = runModelGoalProgramming(data, M, goals)
      File "/home/marcos/devSandwich/main.py", line 57, in runModelGoalProgramming
        m = gp.Model("goalProgramming")
      File "src/gurobipy/model.pxi", line 80, in gurobipy.Model.__init__
      File "src/gurobipy/gurobi.pxi", line 60, in gurobipy.gurobi._getdefaultenv
      File "src/gurobipy/env.pxi", line 70, in gurobipy.Env.__init__
    gurobipy.GurobiError: User name mismatch (licensed to 'root', current user is 'marcos')

     

    I have tried to add the line below in bashrc file. No success:

    export LC_ALL=C

    Please, can I have some help?

    0
  • Eli Towle
    Gurobi Staff Gurobi Staff

    gurobipy.GurobiError: User name mismatch (licensed to 'root', current user is 'marcos')

    It sounds like your named-user license was set up for the \(\texttt{root}\) user instead of \(\texttt{marcos}\). Did you use the \(\texttt{sudo}\) command when you initially ran \(\texttt{grbgetkey}\)? Could you try requesting another academic named-user license and running \(\texttt{grbgetkey}\) as user \(\texttt{marcos}\) (without \(\texttt{sudo}\))?

    0
  • Marcos Campos
    First Comment

    Hey Eli Towle

    Thank for the quick answer!

    I used your suggestin and it did worked! Thank you!

     

    0
  • Sébastien Moretti
    Gurobi-versary
    First Comment
    First Question

    Hi
    I have the same kind of issue but cannot fix it with your advices.

    I still have to use gurobi 9.0.3. Running `grbgetkey` from gurobi 9.0.3 returns this
    info  : grbgetkey version 9.0.3, build v9.0.3rc0
    info  : Contacting Gurobi key server...
    error : ERROR 101: Username field cannot be blank

    With the Linux binary of gurobi 9.5.2 I can generate the license file, but cannot use it:
    Error 10009: User name mismatch (licensed to 'XYZ', current user is '')

    0
  • Eli Towle
    Gurobi Staff Gurobi Staff

    Can you please upgrade to the latest version of Gurobi (11.0.2), then post the output of the following commands in the terminal? I'll assume you already set the \(\texttt{GUROBI_HOME}\), \(\texttt{PATH}\), and \(\texttt{LD_LIBRARY_PATH}\) environment variables appropriately. If not, please first follow the instructions for a "full installation" in the article How do I install Gurobi Optimizer?.

    whoami
    locale
    gurobi_cl --license
    LC_ALL=C gurobi_cl --license
    0

Please sign in to leave a comment.