Announcement

Collapse
No announcement yet.

System.NetWeb.Exception

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    System.NetWeb.Exception

    Hi, this is my first attempt at using IFTTT plugin.

    I followed the docs to install IFTTT plugin, created an IFTTT account, gave permission to access my Dropbox etc.

    I created an event that tries to create a file in my Dropbox but it fails with this error.

    5/11/2022 5:42:58 PM
    Legacy-Plugin
    IFTTT
    ERROR System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(I AsyncResult ar) --- End of inner exception stack trace --- at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSu ccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSucc ess(Task task) at Dropbox.Api.DropboxRequestHandler.d__d`3.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at HSPI_IFTTT.IFTTTApp.UploadFileToDropbox(String folder, String file) ---> (Inner Exception #0) System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(I AsyncResult ar) --- End of inner exception stack trace --- at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSu ccess(Task task) at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSucc ess(Task task) at Dropbox.Api.DropboxRequestHandler.d__d`3.MoveNext()<---

    5/11/2022 5:42:58 PM
    Legacy-Plugin
    IFTTT
    DEBUG Uploading file /IFTTT/Actions/SMS/kitchendooropen to Dropbox

    5/11/2022 5:42:58 PM
    HomeSeer
    Event
    Event Trigger "Alerts KitchenDoor is Open for 10 minutes"


    #2
    I installed Python and the Dropbox SDK on my HomeTroller machine and seems I'm able to access the dropbox API (didn't try uploading a file though).

    Ran this python script:
    Code:
    import requests
    import json from requests.exceptions import HTTPError
    
    url = "https://api.dropboxapi.com/2/check/user"
    
    headers = {
      "Authorization": "Bearer my-token",
      "Content-Type": "application/json"
    }
    data = {
      "query": "MyApp"
    }
    
    try:
        resp = requests.post(url, headers=headers, data=json.dumps(data))
        resp.raise_for_status()
        jsonResp = resp.json()
        print(f'Status: {resp.status_code}')
        print(f'Headers: {resp.headers}') 
        print(f'Response: {jsonResp}')
    except HTTPError as http_err:
        print(f'HTTP error occurred: {http_err}')
    except Exception as err:
        print(f'Other error occurred: {err}')
    And I get a 200-response:

    Code:
    C:\Users\homeseer\Desktop>py.exe dropbox.py
    Status: 200
    Headers: {'Cache-Control': 'no-cache', 'Content-Disposition': 'attachment', 'Content-Security-Policy': 'sandbox', 'Content-Type': 'application/json', 'Date': 'Wed, 11 May 2022 23:42:30 GMT', 'Pragma': 'no-cache', 'Server': 'envoy', 'X-Content-Security-Policy': 'sandbox', 'X-Content-Type-Options': 'nosniff', 'X-Frame-Options': 'sameorigin', 'X-Server-Response-Time': '12', 'X-Webkit-Csp': 'sandbox', 'Content-Length': '18', 'X-Dropbox-Response-Origin': 'far_remote', 'X-Dropbox-Request-Id': 'dc51959374af4371865e0db7c37dfa91'}
    Response: {'result': 'MyApp'}

    Comment


      #3
      Try to install the Beta version 3.0.2.1 of the IFTTT plugin, it should fix this error.

      Comment


        #4
        Thanks, that fixed the ssl error

        Code:
        5/12/2022 10:29:18 AM
        Legacy-Plugin
        IFTTT
        DEBUG Uploading file /IFTTT/Actions/SMS/kitchendooropen to Dropbox
        
        5/12/2022 10:29:18 AM
        HomeSeer
        Event
        Event Trigger "Alerts KitchenDoor is Open for 10 minutes"
        So the event created a new file in my dropbox dir but my IFTTT action failed with this.

        Click image for larger version

Name:	Screen Shot 2022-05-12 at 10.33.13 AM.png
Views:	87
Size:	61.7 KB
ID:	1544604

        Comment


          #5
          Well, it looks like the problem is in the Send SMS action, I can't really help you wit that. Does it work if you try another type of action?

          Comment


            #6
            ...the problem is in the Send SMS action
            Acknowledged. I'll look elsewhere for help with the action.

            Comment

            Working...
            X