KeshiaRose / Basic-CSV-WDC

A Tableau Web Data Connector for connecting to CSVs hosted on the web.
https://basic-csv-wdc.herokuapp.com/
MIT License
26 stars 8 forks source link

Server Whitelisting Issue #9

Closed makwad closed 3 years ago

makwad commented 3 years ago

Hello, can you advise on the whitelisting server settings please. I've tried

tsm data-access web-data-connectors add --name "WDC URL CSV" --url https://basic-csv-wdc.herokuapp.com:443

-- and I get the following error when trying to refresh an extract: Unknown Failure ( status code = 5020, WebDataRequestor::InitAPIObj Unable to load URL: https://basic-csv-wdc.herokuapp.com:443/ )

I am using it with the following CSV api (which works fine on desktop): https://api.coronavirus.data.gov.uk/v2/data?areaType=utla&areaCode=E08000001&metric=newLFDTests&metric=uniqueCasePositivityBySpecimenDateRollingSum&metric=uniquePeopleTestedBySpecimenDateRollingSum&metric=newCasesBySpecimenDate&format=csv

KeshiaRose commented 3 years ago

Hi @makwad, I would suggest hosting your own version as I can update this at any time but if you choose to go with my version what you've written is exactly how you should safelist it. (I've also added this to the readme.) This error does not look like it has anything to do with the safelist, as an incorrect safelist error would look like this:

An error occurred when refreshing extracts for the Datasource 'basic-csv-wdc.herokuapp.com'; Web Data Connector with URL https://basic-csv-wdc.herokuapp.com:443 is not in the list of allowed web data connectors or does not have the correct configuration. Refresh skipped. 

I tested out the WDC with the URL you mentioned and was able to get it to refresh successfully on Tableau Server. What version of Tableau Server are you using? Also, are there any firewalls on your server that would prevent accessing the WDC? Are you able to reach the WDC from the browser on the Server machine?

-Keshia

makwad commented 3 years ago

tabprotosrv_backgrounder_1-0_2021_04_27_13_13_41.txt Hello again. I have had a good look and can't see the issue. I have attached the log to see if you can see anything. All I can see is the following ID Time Elapsed Key ART Value 209 13:13:41.417 - msg - Found no WDC whitelist entry in config for URL 'https://basic-csv-wdc.herokuapp.com:443/' 218 13:13:48.263 - web-data-connector - Web view loading finished. Loading was not successful. Loaded url is 'https://basic-csv-wdc.herokuapp.com/'

It works OK in the browser on the Server 2020.4.0.

My latest attempt: tsm data-access web-data-connectors add --name "WDC URL CSV" --url https://basic-csv-wdc.herokuapp.com:443/ --secondary https://basic-csv-wdc.herokuapp.com/.*

BTW, I have another web connector which connects/works fine. SO I don't think it's a firewall issue: tsm data-access web-data-connectors add --name "UK Coronavirus Data API" --url https://dataanalyticsscc.github.io:443/index.html --secondary https://dataanalyticsscc.github.io:443/.*,https://maxcdn.bootstrapcdn.com/.*,https://connectors.tableau.com/.*,https://ajax.googleapis.com/.*,https://dataanalyticsscc.github.io/.*,https://api.coronavirus.data.gov.uk/.*

KeshiaRose commented 3 years ago

Aha ok, so it is a safe list issue. Don't add a secondary list though as that will block anything that is not in that list from loading, like the CSV itself. By not including the secondary list at all you allow anything to load, this means other users can use the same WDC with different CSVs without making changes to the safe list. Also, perhaps get rid of the last slash? Here is the command I use to add this WDC, also don't forget to apply the changes:

tsm data-access web-data-connectors add --name "CSV WDC" --url https://basic-csv-wdc.herokuapp.com:443
tsm pending-changes apply
KeshiaRose commented 3 years ago

Also, what url are you using when you connect to the WDC in Desktop? Should just be https://basic-csv-wdc.herokuapp.com without the port.

makwad commented 3 years ago

Hi, I have reverted back to _tsm data-access web-data-connectors add --name "CSV WDC" --url https://basic-csv-wdc.herokuapp.com:443

However, the URL I am using to connect to the WDC in Desktop seems to be the issue as when I put in https://basic-csv-wdc.herokuapp.com it adds :443 on the end. I have unsuccessfully tried to amend the workbook xml which has path='/' port='443'.

So when it publishes it: image image

I have attached my workbook connector to see if you can see the issue or could you send me your desktop version that workd for you when you published to the server. CSV URL Connector.zip

Much appreciated for your help, Dilesh.

KeshiaRose commented 3 years ago

Hmm, I'm not sure what is going on then, I just tried the data source you sent over on a test server where I enabled the wdc using the exact snippet I sent you and I was able to refresh it: image What version of Server are you using? Also perhaps there are some conflicting safe list settings since you've tried a few things? Do you see multiple entries for this URL when you run

tsm data-access web-data-connectors list

image

makwad commented 3 years ago

Capture This is what I have. Does the data source I sent you look the same as mine. Capture2 Where desktop adds :443 even though I just input https://basic-csv-wdc.herokuapp.com on the WDC setup page?

KeshiaRose commented 3 years ago

Yes, that should be fine, it adds the :443 to mine as well. I don't know what else it could be, also what version of Server are you on?

makwad commented 3 years ago

Server 2020.4.0 log

KeshiaRose commented 3 years ago

Ok just spun up a 2020.4.0 server and ran the same data source you sent me. My logs are exactly the same as yours up until "Resource Manager: Memory info: ###### bytes" then after that it tries to check jquery against the safe list. Since you aren't seeing any safe list checks for jquery this makes me think that the server isn't even hitting the index.html page to see that it needs to check all the linked libraries. Are you sure that you are able to access the URL from that server machine? I don't have any other options to try at this point. If you can confirm that you have access to that URL from the machine then I would suggest opening a support ticket. image

makwad commented 3 years ago

Aha! It looks like access to https://github.com is blocked. The other links in index.html are fine. If I can't get github unblocked, I guess I will have to get it hosted locally (?) Again thanks for your help

KeshiaRose commented 3 years ago

Aha! Yes, I always suggest hosting your own version. Either locally or on something like Glitch or Heroku. You can easily set up a Glitch or Heroku project with this repo by using the deploy links in the readme. From there you can remove the references to github.com