Tm1py: Error while creating new user

Created on 15 May 2020  路  2Comments  路  Source: cubewise-code/tm1py

Hello, I'm trying to create an user with the following script but didn't work. Any help on what I did wrong would be appreciated, thank you.

from TM1py.Objects import User
from TM1py.Services import TM1Service
import configparser

config = configparser.ConfigParser()
config.read(r'ConfigDemo.ini')

with TM1Service(**config['ServerA']) as tm1:
    u1 = User(name="test", groups=["ADMIN"], password= "test")
    tm1.security.create_user(u1)

I got the following error:

TM1py.Exceptions.Exceptions.TM1pyException: Text: {"error":{"code":"278","message":"Unexpected value type encountered in the payload while processing \"User\". Expecting type \"String\" but was \"Null\"."}} Status Code: 400 Reason: Bad Request

question

All 2 comments

Hi @luizg2018,

for me the script runs without errors.
Please try to upgrade to the latest version of TM1py (= the current master branch on GitHub).
To upgrade you can execute this:
pip install https://github.com/cubewise-code/tm1py/archive/master.zip --upgrade

Hi @luizg2018,

for me the script runs without errors.
Please try to upgrade to the latest version of TM1py (= the current master branch on GitHub).
To upgrade you can execute this:
pip install https://github.com/cubewise-code/tm1py/archive/master.zip --upgrade

I'm embarrassed, I was sure I was using the latest version. I upgraded it and it worked. Thank you for you help!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianboltz picture ianboltz  路  5Comments

yyzz1010 picture yyzz1010  路  3Comments

VY109 picture VY109  路  4Comments

Andy-Hofelmeyer picture Andy-Hofelmeyer  路  3Comments

hermie64 picture hermie64  路  3Comments