Skip to content

Problem with changing tags which contains '.' - 404007: Resource Not Found #994

Closed

Description

@Cloudy17g35

Describe the bug

Hi!

I tried to change tags in a workbook.

My tags are as following: my_tag.foo

I cannot change it because i'm getting: 404007: Resource Not Found.

NOTE: When i was trying to use code below with tags without a dots it worked. It only don't works for tags with dot.

It's quite huge problem because I need to replace this dots in almost 400 workbook tags 😢

I found something related like #675 or #578 but i did not get much from it.

Versions

Details of environment:

  • Tableau Server Version: 2021.4.2 (20214.21.1217.2252) 64-bit Linux
  • Python 3.9.7
  • tableauserverclient 0.17.0.

To Reproduce

Here's code:

# here i just use methods which allows me to get to the site, importing TSC
from login_to_client import get_auth, get_server
import tableauserverclient as TSC
# getting to the site
tableau_auth = get_auth(site)
server = get_server()
with server.auth.sign_in(tableau_auth):
    
    # getting list with all workbooks on the server
    all_workbooks , pagination_item = server.workbooks.get()
    
    # grab first workbook
    workbook = all_workbooks[0]
    workbook_tags = workbook.tags
    
    # logging info about tags
    myloger.info(workbook_tags)
    
    try:
        # i try to set tags to empty set
        workbook.tags = set()
        # updating workook
        server.workbooks.update(workbook)
        myloger.info('updating has been finished')
    except Exception as e:
        myloger.error(e)

This code works without any problem when there's no dot in the tag name.

The problem occurs when there's a dot.

Results

MyLogger[9716] INFO {'my_tag.foo'}

MyLogger[9716] ERROR 
404007: Resource Not Found
Tag 'my_tag' could not be found.

Activity

  1. bcantoni commented on Feb 23, 2022

    @bcantoni
    Contributor

    I can reproduce the same on Tableau Online which is currently on version 20221.22.0219.1914.

    I tried the actual REST API call that TSC makes and it also fails:

    • curl -X DELETE https://10ax.online.tableau.com:443/api/3.15/sites/<site-id>/workbooks/<workbook-id>/tags/testy.tester
    • Returns a 404 error (404007) with message "Tag 'testy' could not be found", just as reported above.
    • The period character is valid in URLs without escaping, so this should work (escaping it as %2E also did not work)

    This looks like a problem on the server backend side.

  2. difemaro commented on Feb 23, 2022

    @difemaro

    Changing the line 33 on resource_tagger.py from:
    self.delete_request(url)

    To
    self.delete_request(url + '.')

    It seems the rest api service from Tableau, truncates the DELETE url, to the previous character to the last point found.

    image

    Regards,

    Diego Martinez
    Tableau Ambassador

  3. Cloudy17g35 commented on Feb 24, 2022

    @Cloudy17g35
    Author

    @difemaro solution is working for situation when we both have a dot in the tag or we don't have it.

    I think that it resolves this problem.

  4. bcantoni commented on Feb 24, 2022

    @bcantoni
    Contributor

    I reported this internally, so let's reopen this bug until we can get a proper fix.

    In the meantime, the workaround above sounds like it works for anyone who runs into this.

  5. bcantoni commented on Mar 14, 2022

    @bcantoni
    Contributor

    The internal team at Tableau is fixing this issue with the REST API (issue number 1379992).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions