Coder Social home page Coder Social logo

🐛 钉钉用户列表失败 | [Bug] Key: 'DeptDetailUserInfo.DeptId' Error:Field validation for 'DeptId' failed on the 'min' tag about go-ldap-admin HOT 8 CLOSED

jiangslee avatar jiangslee commented on June 7, 2024
🐛 钉钉用户列表失败 | [Bug] Key: 'DeptDetailUserInfo.DeptId' Error:Field validation for 'DeptId' failed on the 'min' tag

from go-ldap-admin.

Comments (8)

eryajf avatar eryajf commented on June 7, 2024

您好 @jiangslee👋,我已收到您的反馈,我将安排时间考虑您提交的信息并进行回复。-- 这条信息是由自动回复的机器人发出的。

Hello @jiangslee. I have received your feedback, and I will arrange time to consider the information you submitted and reply. -- This message is sent by an automatic reply robot.

from go-ldap-admin.

eryajf avatar eryajf commented on June 7, 2024

先看看钉钉后台那边,是否真的有-7这个ID,后来你把-7排除,然后重新跑的时候是不会同步吗?

第二个问题怎么说呢,这个可以考虑,随后我看看刷一些默认数据。只不过有时候有的朋友他的数据不一定适用,所以一开始没有填充默认数据。

from go-ldap-admin.

jiangslee avatar jiangslee commented on June 7, 2024

先看看钉钉后台那边,是否真的有-7这个ID,后来你把-7排除,然后重新跑的时候是不会同步吗?

第二个问题怎么说呢,这个可以考虑,随后我看看刷一些默认数据。只不过有时候有的朋友他的数据不一定适用,所以一开始没有填充默认数据。

image

https://open.dingtalk.com/document/isvapp/common-errors

image

这个是个家校通讯录的特殊ID,我排除-7后,点击获取钉钉用户docker compose logs -f 查看到只会一直刷获取用户详情的接口,但是数据库没有一个用户入库

image

from go-ldap-admin.

eryajf avatar eryajf commented on June 7, 2024

查看到只会一直刷获取用户详情的接口,但是数据库没有一个用户入库

按说刷这个日志就是在同步用户了,你这个接口最后的结果是什么呢,正常的200吗,还是有异常报错。也可以到数据库看看user表有没有对应数据

from go-ldap-admin.

jiangslee avatar jiangslee commented on June 7, 2024
  1. 最后的结果是返回200
    image

  2. 数据库user表没有数据
    image

  3. phpLdapAdmin的people没有数据
    image

from go-ldap-admin.

eryajf avatar eryajf commented on June 7, 2024

分组的数据都正常落库了吗。从目前提供的信息来看,一切都没问题,看不出来是什么原因

from go-ldap-admin.

jiangslee avatar jiangslee commented on June 7, 2024

分组的数据都正常落库了吗。从目前提供的信息来看,一切都没问题,看不出来是什么原因

我大概定位到原因了,下面这个配置只会按已手动输入的部门ID列表进行同步,我只输入了- "^-7",没有其它部门ID所以不入库。

dingtalk:
    dept-list:    # 配置要同步的部门列表,配置留空则同步所有部门,在开头加^表示不同步此部门
        - "^-7"

查看代码逻辑:

https://github.com/eryajf/go-ldap-admin/blob/d00d6df8a114e0d4378dffeadf2c8f602b9dd13d/public/client/dingtalk/dingtalk.go#L16C5-L39

我临时改了点代码测试能入库了:
image

然后遇到新问题,再看看

{
    "code": 506,
    "data": null,
    "msg": "SyncDingTalkUsers写入用户失败:添加用户: ***, 失败: AddUser向LDAP创建用户失败:LDAP Result Code 21 \"Invalid Attribute Syntax\": mail: value #0 invalid per syntax"
}

改进思路:

  • 优化排除项功能,区分同步所有部门列表+排除项手动指定同步部门id的配置

from go-ldap-admin.

eryajf avatar eryajf commented on June 7, 2024

关于排除这个逻辑,我周末再测试验证一下,可能是有问题的。

你下边的这个错误,是说邮箱的字段语法有问题,这个建议你可以先把数据拿到看看长什么样

from go-ldap-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.