shabiel / M-Web-Server

A YottaDB and Caché compatible HTTP server
Apache License 2.0
24 stars 19 forks source link

Error installing in YottaDB r1.34: %YDB-E-SETECODE, Non-empty value assigned to $ECODE (user-defined error trap) #66

Closed racingmars closed 2 years ago

racingmars commented 2 years ago

I have a newly-installed Debian 11 system, with a fresh installation of YottaDB r1.34. When I follow the installation instructions for the webinit routine, it terminates with:

[... lots of warnings ...]
%YDB-W-BLKTOODEEP, Block level too deep
%YDB-E-SETECODE, Non-empty value assigned to $ECODE (user-defined error trap)

Here's my complete process from a fresh Debian 11 install:

YottaDB installation (building from source because it seems to be unhappy with ICU version otherwise):

$ sudo apt update && \
    sudo apt upgrade -y && \
    sudo apt install -y build-essential icu-devtools git curl cmake pkg-config tcsh {libconfig,libelf,libicu,libncurses,zlib1g,libicu}-dev
 [...]
$ sudo reboot
 [... a short while later ...]
$ curl https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh > /tmp/ydbinstall.sh
$ chmod +x /tmp/ydbinstall.sh
$ sudo /tmp/ydbinstall.sh --utf8 default --from-source --branch r1.34
 [...]
Since you are running systemd we changed memory settings and you need to restart
the systemd-logind service using this command "systemctl restart systemd-logind".

If your Desktop session is managed by the systemd-logind service (e.g., a Gnome
or Plasma desktop), restarting systemd-logind will restart your GUI. Save all
your work prior to issuing "systemctl restart systemd-logind".
YottaDB version r1.34 installed successfully at /usr/local/lib/yottadb/r134
YottaDB pkg-config file installed successfully at /usr/share/pkgconfig/yottadb.pc
$ sudo systemctl restart systemd-logind

YottaDB environment:

$ source /usr/local/lib/yottadb/r134/ydb_env_set
$ yottadb -version
YottaDB release:         r1.34
Upstream base version:   GT.M V6.3-011
Platform:                Linux x86_64
Build date/time:         2022-08-29 20:02
Build commit SHA:        f2f77cc184d9fe2e272d7b1d39b64434e9769804

Restoring webinit:

$ curl -L https://github.com/shabiel/M-Web-Server/releases/download/1.1.5/webinit.rsa > /tmp/webinit.rsa
$ yottadb -dir

YDB>W $ZRO
/home/mwilson/.yottadb/r1.34_x86_64/o/utf8*(/home/mwilson/.yottadb/r1.34_x86_64/r /home/mwil
son/.yottadb/r) /usr/local/lib/yottadb/r134/utf8/libyottadbutil.so
YDB>D ^%RI

Routine Input Utility - Converts RO file to *.m files.

Formfeed delimited <No>? 
Input device: <terminal>: /tmp/webinit.rsa

Routines

Output directory : /home/mwilson/.yottadb/r

webinit   

Restored 525 lines in 1 routine.

Running webinit:

YDB>D ^webinit
         Q:$$CACHE $ZU(168)
                    ^-----
                At column 13, line 66, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVFCN, Invalid function name
         I $$CACHE S %=$ZU(168,^%SYS("TempDir")) QUIT  ; Cache
                        ^-----
                At column 17, line 73, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVFCN, Invalid function name
         I $$CACHE N % S %=$ZU(168,DIR) QUIT
                            ^-----
                At column 21, line 79, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVFCN, Invalid function name
         I $P($P($ZV,") ",2),"(")<2012 S NMSP=$ZU(5)
                                               ^-----
                At column 40, line 91, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVFCN, Invalid function name
         I $P($P($ZV,") ",2),"(")>2011 S NMSP=$NAMESPACE
                                               ^-----
                At column 40, line 92, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVSVN, Invalid special variable name
         ZN "%SYS" ; Go to SYS
         ^-----
                At column 2, line 96, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVCMD, Invalid command keyword encountered
         N % S %=##Class(Config.Namespaces).Get(NMSP,.PROP) ; Get all namespace properties
                 ^-----
                At column 10, line 100, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         I '% W !,"Error="_$SYSTEM.Status.GetErrorText(%) S $EC=",U-CONFIG-FAIL," QUIT
                                  ^-----
                At column 27, line 101, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         S %=##class(Config.Configuration).GetGlobalMapping(NMSP,G,"",DBG,DBG)
             ^-----
                At column 6, line 110, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         I '% S %=##class(Config.Configuration).AddGlobalMapping(NMSP,G,"",DBG,DBG)
                  ^-----
                At column 11, line 111, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         I '% W !,"Error="_$SYSTEM.Status.GetErrorText(%) S $EC=",U-CONFIG-FAIL," QUIT
                                  ^-----
                At column 27, line 112, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         N % S %=##Class(Config.MapRoutines).Get(NMSP,G,.PROPRTN)
                 ^-----
                At column 10, line 115, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         I '% S %=##Class(Config.MapRoutines).Create(NMSP,G,.PROPRTN)
                  ^-----
                At column 11, line 117, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         I '% W !,"Error="_$SYSTEM.Status.GetErrorText(%) S $EC=",U-CONFIG-FAIL," QUIT
                                  ^-----
                At column 27, line 118, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         ZN NMSP ; Go back
         ^-----
                At column 2, line 119, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVCMD, Invalid command keyword encountered
         N $NAMESPACE S $NAMESPACE="%SYS"
            ^-----
                At column 5, line 127, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVSVN, Invalid special variable name
         N $NAMESPACE S $NAMESPACE="%SYS"
                         ^-----
                At column 18, line 127, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVSVN, Invalid special variable name
         n % s %=##class(Security.SSLConfigs).Exists("encrypt_only",.config,.status) ; check if conf
ig exists
                 ^-----
                At column 10, line 129, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         . s %=##class(Security.SSLConfigs).Create("encrypt_only",.prop) ; create a default ssl conf
ig
               ^-----
                At column 8, line 132, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         . i '% w $SYSTEM.Status.GetErrorText(%) s $ec=",u-cache-error,"
                         ^-----
                At column 18, line 133, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         . s %=##class(Security.SSLConfigs).Exists("encrypt_only",.config,.status) ; get config
               ^-----
                At column 8, line 134, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         e  s %=config.Activate()
                      ^-----
                At column 15, line 135, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         d config.TestConnection("encrypted.google.com",443,.rtn)
                 ^-----
                At column 10, line 139, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         set httprequest=##class(%Net.HttpRequest).%New()
                         ^-----
                At column 18, line 151, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         . set httprequest.Https=1
                          ^-----
                At column 19, line 153, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EQUAL, Equal sign expected but not found
         . set httprequest.SSLConfiguration="encrypt_only"
                          ^-----
                At column 19, line 154, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EQUAL, Equal sign expected but not found
         set httprequest.Server=server
                        ^-----
                At column 17, line 159, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EQUAL, Equal sign expected but not found
         if port set httprequest.Port=port
                                ^-----
                At column 25, line 160, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EQUAL, Equal sign expected but not found
         set httprequest.Timeout=5
                        ^-----
                At column 17, line 161, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EQUAL, Equal sign expected but not found
         new status set status=httprequest.Get(filepath)
                                          ^-----
                At column 35, line 162, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         new response set response=httprequest.HttpResponse.Data
                                              ^-----
                At column 39, line 163, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         new sysfile set sysfile=##class(%Stream.FileBinary).%New()
                                 ^-----
                At column 26, line 164, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         set status=sysfile.FilenameSet(filename)
                           ^-----
                At column 20, line 165, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         set status=sysfile.CopyFromAndSave(response)
                           ^-----
                At column 20, line 166, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         set status=sysfile.%Close()
                           ^-----
                At column 20, line 167, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-SPOREOL, Either a space or an end-of-line was expected but not found
         D $SYSTEM.Process.SetZEOF(1) ; Cache stuff!!
           ^-----
                At column 4, line 262, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-LABELEXPECTED, Label expected in this context
         O ROPATH:("RS"):0 E  S $EC=",U-ERR-OPEN-FILE,"
                   ^-----
                At column 12, line 267, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-DEVPARPARSE, Error parsing device parameter specification
         O DIR_"test.txt":"NWS":0
                          ^-----
                At column 19, line 300, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-DEVPARPARSE, Error parsing device parameter specification
         C DIR_"test.txt":"D"
                          ^-----
                At column 19, line 304, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-DEVPARPARSE, Error parsing device parameter specification
         . O TCPIO:(:PORT:"ACT"):2
                    ^-----
                At column 13, line 385, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-DEVPARPARSE, Error parsing device parameter specification
         D CHKTF^%ut('$D(^$R("%ZVEMD")))
                          ^-----
                At column 19, line 451, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-GBLNAME, Either an identifier or a left parenthesis is expected after a ^ in this con
text
         N NS S NS=$NAMESPACE
                    ^-----
                At column 13, line 460, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVSVN, Invalid special variable name
         ZN "%SYS"
         ^-----
                At column 2, line 461, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVCMD, Invalid command keyword encountered
         S %=##class(Config.Configuration).AddGlobalMapping(NS,"%Z*","",NS,NS)
             ^-----
                At column 6, line 462, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         S A("Database")=NS S %=##Class(Config.MapRoutines).Create(NS,"%Z*",.A)
                                ^-----
                At column 25, line 463, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-EXPR, Expression expected but not found
         ZN NS
         ^-----
                At column 2, line 464, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-INVCMD, Invalid command keyword encountered
         D CHKTF^%ut($D(^$R("%ZVEMD")))
                         ^-----
                At column 18, line 467, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-GBLNAME, Either an identifier or a left parenthesis is expected after a ^ in this con
text
         D:$D(^$R(R))  F  S R=$O(^$R(R)) Q:R=""  Q:($P(R,NMSP,2)="")  D
               ^-----
                At column 8, line 475, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-E-GBLNAME, Either an identifier or a left parenthesis is expected after a ^ in this con
text
         . X "ZR  ZS @R"
           ^-----
                At column 4, line 476, source module /home/mwilson/.yottadb/r/webinit.m
%YDB-W-BLKTOODEEP, Block level too deep
%YDB-E-SETECODE, Non-empty value assigned to $ECODE (user-defined error trap)
shabiel commented 2 years ago

@racingmars Thank you for using YottaDB.

I am interested in this statement:

YottaDB installation (building from source because it seems to be unhappy with ICU version otherwise):

We (I work for YottaDB) test on Debian 11, so I am interested in learning about the ICU issue.

I figured out the problem: The mws.rsa file in the release got an encoding corruption, as I added some Japanese text to test UTF-8 handling, but somehow the Japanese isn't showing up correctly.

I am moving this project (slowly) to https://gitlab.com/YottaDB/Util/YDB-Web-Server, and should be done in the next couple of weeks I think. Do you need this fixed sooner rather than later? Can you tell me what do you plan to use the M Web Server for, or is it just a hobby thing for now?

shabiel commented 2 years ago

@racingmars I just fixed the issue. Turns out a script I was using didn't support UTF-8; It's now fixed. Please close the issue after you retry this.

racingmars commented 2 years ago

@racingmars I just fixed the issue. Turns out a script I was using didn't support UTF-8; It's now fixed. Please close the issue after you retry this.

Thanks, that did the trick! Installs correctly now and I can access the web service.

I am interested in this statement:

YottaDB installation (building from source because it seems to be unhappy with ICU version otherwise):

We (I work for YottaDB) test on Debian 11, so I am interested in learning about the ICU issue.

If that's unexpected, I'll go ahead and reproduce it when I have a chance to set up another new machine and open an issue over in the YDB repo. I'm going to be mostly away from the computer for the next few days but I'll circle back with the details when I can.

Can you tell me what do you plan to use the M Web Server for, or is it just a hobby thing for now?

Just a hobby thing :-)

shabiel commented 2 years ago

If that's unexpected...

ICU is a pain to work with, so it usually is an issue of not installing the right packages, or something like that. So please create an issue, and we have to probably improve the documentation to warn people on what to install.