The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

When I try to send a file using sendtestfile() with a .rar file

1- SELECT "dba"."sendtestfile"('8','c:\test\test_file_01.rar')

c:\test\test_file_01.rar file with length 2495 Kb

Response at CLIENT_SERVER:

TEST FILE LENGTH: 2495621

2- SELECT "dba"."sendtestfile"('8','c:\test\test_file_02.rar')

c:\test\test_file_02.rar file with length 2999 Kb

Response at CLIENT_SERVER:

There was an error reading the results of the SQL statement. The displayed results may be incorrect or incomplete.

Invalid response from the HTTP server
SQLCODE=-988, ODBC 3 State="HY000"

WEB_SERVICES_SERVER error:

crash with an Internal Error

VERSION=16.0.0.1324
FILENAME=C:\ProgramData\SQL Anywhere 16\diagnostics\SA16_20160601_001902_6692.crash_log
OS=Windows 8 Build 9200 
PROCESSOR=X86_64
EXEC_ARCH=X86_64
EXEC_PATH=C:\Program Files\SQL Anywhere 16\Bin64\dbsrv16.exe
MODULE_PATH=C:\Program Files\SQL Anywhere 16\Bin64\dbserv16.dll
......

below are the scripts

//////////////////////////////////////////////////////////////////////////////////////////////////////

WEB_SERVICES_SERVER param:

SQL Anywhere Network Server Version 16.0.0.1324 Workgroup Edition -xs "HTTP(PORT=8080;MaxRequestSize=200000000;TO=600;KTO=600)"

//////////////////////////////////////////////////////////////////////////////////////////////////////

ALTER FUNCTION "dba"."rectestfile"( IN as_version CHAR(8), IN alb_file_data LONG BINARY )
RETURNS LONG VARCHAR
NOT DETERMINISTIC
BEGIN
DECLARE llb_file_data LONG BINARY;
RETURN 'TEST FILE LENGTH: ' + STRING(LENGTH(alb_file_data)) ;   
END

//////////////////////////////////////////////////////////////////////////////////////////////////////

CREATE SERVICE "rectestfile" 
  TYPE 'RAW' AUTHORIZATION OFF SECURE OFF URL PATH OFF USER "dba"  AS
  select "rectestfile"(:version,:file_data)

//////////////////////////////////////////////////////////////////////////////////////////////////////

CLIENT_SERVER param:

SQL Anywhere Network Server Version 16.0.0.1324 Workgroup Edition -xs "HTTP(PORT=8090;MaxRequestSize=200000000;TO=600;KTO=600)"

//////////////////////////////////////////////////////////////////////////////////////////////////////

ALTER FUNCTION "dba"."sendtestfilews"( in "version" char(8),in "file_data" long binary ) 
returns long nvarchar
url 'http://192.168.1.82:8080/test/rectestfile'
set 'HTTP(CHUNK=ON)'
type 'HTTP:POST'

//////////////////////////////////////////////////////////////////////////////////////////////////////

ALTER FUNCTION "dba"."sendtestfile"( in version char(8) , IN file_name LONG VARCHAR )  
RETURNS LONG VARCHAR   
NOT DETERMINISTIC   
BEGIN 
    DECLARE llb_file_data LONG BINARY;   
    SET llb_file_data = xp_read_file(file_name) ;  
    RETURN sendtestfilews(version,llb_file_data) ;    
END

asked 01 Jun '16, 00:46

Jose%20Rico's gravatar image

Jose Rico
26114
accept rate: 0%

edited 01 Jun '16, 08:07

Mark%20Culp's gravatar image

Mark Culp
22.3k9129262


You are seeing this with the GA (ie. first) release of SQL Anywhere version 16.

There was a fix for a crash during a POST with a '?large? payload' that checked into a later build. From the readme.html file provided with the EBFs/SPs:

================(Build #1746  - Engineering Case #751941)================

If a database server received an HTTP POST request with a large payload, 
the server could have crashed. This has been fixed.

So I would recommend trying this again with a newer SP/EBF.

permanent link

answered 01 Jun '16, 09:11

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
6.2k2890
accept rate: 30%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×43
×28
×18
×11

question asked: 01 Jun '16, 00:46

question was seen: 179 times

last updated: 01 Jun '16, 09:11