nautobot / nautobot-app-ssot

Single Source of Truth for Nautobot
https://docs.nautobot.com/projects/ssot/en/latest/
Other
37 stars 39 forks source link

Example Data Target Job - AttributeError: 'StringVar' object has no attribute 'startswith' #507

Closed nathanielfernandez closed 2 months ago

nathanielfernandez commented 3 months ago

Environment

Thread in #nautobot: https://networktocode.slack.com/archives/C01NWPK6WHL/p1724054957478579

I wanted to try the example data target job that is provided by default with the nautobot-app-ssot. I tried to supply the URL and token for target instances like the demo instance and our own nautobot instances. Made sure the proper url with protocol (https://) is provided.

I got an error related to the URL.

AttributeError: 'StringVar' object has no attribute 'startswith'

  File "/opt/nautobot/lib64/python3.11/site-packages/nautobot_ssot/jobs/examples.py", line 405, in __init__
    if not url.startswith("http"):
           ^^^^^^^^^^^^^^
AttributeError: 'StringVar' object has no attribute 'startswith'

I thought there was nothing wrong with the URL I provided. So for troubleshooting, I tried to play with the nautobot-ssot files and removed the if condition to bypass it. I still got an error with the URL.

requests.exceptions.MissingSchema: Invalid URL '<nautobot.extras.jobs.StringVar object at 0x7fd2b96355d0>/api/dcim/location-types/': No scheme supplied. Perhaps you meant https://<nautobot.extras.jobs.StringVar object at 0x7fd2b96355d0>/api/dcim/location-types/?

Asked for help in slack, and Justin Drew advised to open an issue.

image

Steps to Reproduce

  1. Make sure the example jobs are not hidden, and the data target job is also enabled.
  2. Run the Example Data Target job, provide the proper URL and token.
  3. It would error right away about the URL
Renrut5 commented 2 months ago

@jdrew82 it looks like this one is completed, in #519 but not closed.