Skip to content
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

what can i do , I Can't get any useful information in the error message #7

Open
fschenkun22 opened this issue May 18, 2022 · 3 comments

Comments

@fschenkun22
Copy link

[2022-05-18_15:23:03] Failed updating IPv6 host address
  This could be caused by many things, including:
  the dynv6.com service being down,, irresponsive, or malfuctioning,
  no reachable Internet route (via IPv6) to the https://dynv6.com service,
  a wrong or invalid value for <host>,
  or a wrong or invalid value for <token>.
@linxin2020
Copy link

I also encountered the same problem. Now I confirm that it is not the call problem, but the project problem; This project has not been maintained for too long, and the dynv6 API has changed.

@zen010101
Copy link

zen010101 commented Aug 6, 2023

update the dynephant.au3 file:

Func UpdateDynv6HostRecord($dynv6Host, $dynv6Token, $ipVersion = 6)
	; construct URL with payload for dynv6 update
	$dynv6Protocol = "https"
	$dynv6ServerBase = "dynv6.com/api/update"
	; hosts issued by dynv6.com are on the dynv6.net 2nd level domain!
	$dynv6HostSuffix = "dynv6.net" ; "dynv6.net" is the only valid value (for now)
	$dynv6HostFqdn = $dynv6Host & "." & $dynv6HostSuffix
	If $ipVersion = 4 Then
		$dynv6ServerPrefix = "ipv4."
		$dynv6IpString = "ipv4=auto"
	Else
		; no fancy errors for invalid $ipVersion, just assume 6
		;$dynv6ServerPrefix = "ipv6."
		$dynv6ServerPrefix = ""
		$dynv6IpString = "ipv6=auto"
	EndIf
	$dynv6Url = $dynv6Protocol & "://" & $dynv6ServerPrefix & $dynv6ServerBase
	;$dynv6Url = $dynv6Protocol & "://" & $dynv6ServerBase
	$dynv6Url &= "?" & "hostname=" & $dynv6HostFqdn ; TODO: URL Encoding
	$dynv6Url &= "&" & $dynv6IpString
	$dynv6Url &= "&" & "token=" & $dynv6Token ; TODO: URL Encoding
	;ConsoleWriteError("$dynv6Url=" & $dynv6Url & @LF)
	$dynv6UpdateResultBinary = InetRead($dynv6Url, $INET_FORCERELOAD)
	If Not @error Then
		$dynv6UpdateResultString = BinaryToString($dynv6UpdateResultBinary)
		;ConsoleWriteError("$dynv6UpdateResultBinary=" & $dynv6UpdateResultBinary & @LF)
		;ConsoleWriteError("$dynv6UpdateResultString=" & $dynv6UpdateResultString & @LF)
		If ($dynv6UpdateResultString == ("addresses updated")) Or ($dynv6UpdateResultString == ("addresses unchanged")) Then
			; this will actually trigger - "host updated\n" may be returned
			; with the HTTP status code 200
			;ConsoleWriteError("It Worked! - " & $dynv6UpdateResultString)
			Return 0
		ElseIf $dynv6UpdateResultString == ("invalid host") Then
			; this will never happen - "invalid host\n" may be returned
			; but the HTTP status code returned will be 404 (Not Found)
			; resulting in an InetRead error instead
			;ConsoleWriteError("It Failed! - " & $dynv6UpdateResultString & @LF)
			Return 1
		ElseIf $dynv6UpdateResultString == ("invalid authentication_token") Then
			; this will never happen - "invalid authentication_token\n" may be returned
			; but the HTTP status code returned will be 401 (Unauthorized)
			; resulting in an InetRead error instead
			;ConsoleWriteError("It Failed! - " & $dynv6UpdateResultString & @LF)
			Return 1
		Else
			; this might never happen - some unknown string may be returned
			; but the HTTP status code returned may be 4xx (Error)
			; resulting in an InetRead error instead
			;ConsoleWriteError("Wha??????! - " & $dynv6UpdateResultString & @LF)
			Return 1
		EndIf
	Else
		; an InetRead error may be returned for a bad URL,
		; any HTTP status code that is an error, or
		; any other reason that the client is unable to reach the server
		;ConsoleWriteError("InetRead Error! Bytes Downloaded: " & @extended & @LF)
		Return 1
	EndIf
EndFunc   ;==>UpdateDynv6HostRecord

@zen010101
Copy link

or you can use powershell script:

$intervalSeconds = 60
$apiUrl = "https://dynv6.com/api/update?hostname=mechrevo16.dynv6.net&ipv6=HERE_IS_YOUR_TOKEN"

while ($true) {
    $response = Invoke-RestMethod -Uri $apiUrl
    Write-Host $response
    Start-Sleep -Seconds $intervalSeconds
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants