iris icon indicating copy to clipboard operation
iris copied to clipboard

Error running "make targets"

Open dwang159 opened this issue 6 years ago • 5 comments

I am getting below error while running make targets on iris.

File "/iris/src/iris/bin/sync_targets.py", line 145, in if user['active']} TypeError: string indices must be integers Makefile:13: recipe for target 'targets' failed make: *** [targets] Error 1

Below are the logs from oncall server.

[10/Jan/2019:04:24:05 +0000] "GET /api/v0/users?fields=name&fields=contacts&fields=active HTTP/1.1" 401 85 "-" "python-requests/2.20.0"

Originally posted by @adityavijjanT in https://github.com/linkedin/iris/pull/333#issuecomment-452990413

dwang159 avatar Jan 10 '19 20:01 dwang159

Moving discussion to this issue. It looks like Oncall is giving you a 401, so I'd check the settings you've enabled for auth in Oncall. I'm guessing that you've toggled requirements for login before read in Oncall, which might be where the script is running into issues. Check that the script is configured with the right Oncall API key etc to allow authorization.

dwang159 avatar Jan 10 '19 20:01 dwang159

Thanks for the quick reply, I have used default config file from both oncall and iris repo, have only changed db information nd ldap integration oncall config files.

oncall config:-

auth: debug: False module: 'oncall.auth.modules.ldap_import' # for automatically import user at first connexion ldap_url: 'ldap://test.local' ldap_user_suffix: '@test.local' ldap_bind_user: 'CN=testuser,OU=Service,OU=Accounts,DC=Test,DC=Local' ldap_bind_password: 'password' ldap_base_dn: 'dc=Test,dc=local' ldap_search_filter: '(sAMAccountName=%s)' import_user: True attrs: username: 'sAMAccountName' full_name: 'cn' email: 'mail' call: 'mobile' sms: 'mobile' slack: 'cn'

  • type: dummy application: oncall iris_api_key: magic

############################ Oncall frontend settings ############################ supported_timezones:

  • 'US/Pacific'
  • 'US/Eastern'
  • 'US/Central'
  • 'US/Mountain'
  • 'US/Alaska'
  • 'US/Hawaii'
  • 'Asia/Kolkata'
  • 'Asia/Shanghai'
  • 'UTC'

index_content_setting: Page footer contents footer: |

  • Oncall © LinkedIn 2017
  • Feedback
  • About
Note displayed when a user has no phone number missing_number_note: 'No number' header_color: '#3a3a3a'

Integration with Iris, allowing for escalation from Oncall iris_plan_integration: activated: True Iris app and key settings app: oncall api_key: magic api_host: http://iris:16649

Iris Config Enabled modules for resolving complex user roles to individual usernames, processed in the order listed here. role_lookups:

  • user # support for 'role' being username
  • mailing_list # mailing list config; see bottom of file
  • oncall # oncall service integration
  • dummy # dummy role lookup used for testing purposes. Disable this in production.

oncall-api: http://oncall:8080 # oncall url oncall-app: oncall # application for oncall auth oncall-key: magic # API key for oncall auth

applications:

  • dummy_app

iris.txt oncall.txt

adityavijjanT avatar Jan 11 '19 05:01 adityavijjanT

Curious if this issue was resolved as I'm having the same problem.

alexw19 avatar Jul 29 '19 17:07 alexw19

yes this is resolved. i have sync users from oncall instead of ldap.

ldap --> oncall --> iris

https://iris.claims/docs/installation.html#integrating-iris-and-oncall

make sure your oncall api key and application are correctly configured in iris config file.

adityavijjanT avatar Jul 30 '19 04:07 adityavijjanT

After you have edited the config, what command do you run and from where?

TomMir avatar Sep 27 '19 15:09 TomMir