8000 Problem with changing tags which contains '.' - 404007: Resource Not Found · Issue #994 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content
8000

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Cloudy17g35 opened this issue Feb 22, 2022 · 5 comments
Labels

Comments

@Cloudy17g35
Copy link
Cloudy17g35 commented Feb 22, 2022

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.
@bcantoni bcantoni added the bug label Feb 23, 2022
@bcantoni
Copy link
Contributor
bcantoni commented Feb 23, 2022

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.

@difemaro
Copy link
difemaro commented Feb 23, 2022

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

@Cloudy17g35
Copy link
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.

@bcantoni
Copy link
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.

@bcantoni bcantoni reopened this Feb 24, 2022
@bcantoni
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0