artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Artanis] "Invalid keyword" Error when Trying to `create-table`


From: Nala Ginrut
Subject: Re: [Artanis] "Invalid keyword" Error when Trying to `create-table`
Date: Fri, 01 Feb 2019 01:39:01 +0800
User-agent: mu4e 1.0; emacs 25.1.1

Have you pulled the latest code? I happened to fix a relavent bug these
days.

Jonathan Schmeling writes:

> Hey; sorry about just dropping off, like that. Life crept up on me.
>
> But I've had some free time! And tried picking back up where I'd been
> before.
>
> I'm still pointing to Artanis's master branch and did a rebuild and
> tried running the create migration, again, but I ran into an error, once
> more; on the upside, it does seem to be different from last time, as
> opposed to being exactly the same. It's:
>
> [Migrating PEOPLE_20180910180518.scm]
> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> ;;; or pass the --no-auto-compile argument to disable.
> ;;; compiling /myapp/db/migration/PEOPLE_20180910180518.scm
> ;;; compiled
> /root/.cache/guile/ccache/2.2-LE-8-3.A/myapp/db/migration/PEOPLE_20180910180518.scm.go
> Creating table `PEOPLE'......Backtrace:
>   14 (apply-smob/1 #<catch-closure 562c90468260>)
> In ice-9/boot-9.scm:
>   705:2 13 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
> In ice-9/eval.scm:
>   619:8 12 (_ #(#(#<directory (guile-user) 562c904c9140>)))
> In /usr/local/bin/art:
>   42:12 11 (_ _ _)
> In artanis/mvc/migration.scm:
>   89:4 10 (create-table PEOPLE (ID auto (#:primary-key)) (# # #) # …)
> In artanis/fprm.scm:
>   377:18 9 (_ PEOPLE ((ID serial (#:no-edit #:not-null #)) (# …) …) …)
> In ice-9/boot-9.scm:
>   222:29 8 (map1 ((ID serial (#:no-edit #:not-null #)) (# # 32 …) …))
>   222:29 7 (map1 ((USERNAME varchar 32 (#:not-null #:unique)) (…) …))
>   222:29 6 (map1 ((PASSWORD varchar 500 (#:not-null)) (SALT # …) …))
>   222:29 5 (map1 ((SALT varchar 500 (#:not-null)) (NAME # 32 #) #))
>   222:17 4 (map1 ((NAME varchar 32 (#:default "")) (SUMMARY # # …)))
> In artanis/fprm.scm:
>   369:19 3 (->types _)
>   355:7 2 (->type/opts _)
> In srfi/srfi-1.scm:
>   501:18 1 (fold-right #<procedure 562c909a19e0 at artanis/fprm…> . #)
> In artanis/fprm.scm:
>   357:19 0 (_ "" ())
>
> artanis/fprm.scm:357:19: Throw to key `artanis-err' with args `(500
> #<procedure ->mysql-opts (x opts)> "Invalid opts `~a' for MySQL table
> definition!" "")'.
>
> My migration is pretty much the same as last time:
>
> (migrate-create
>   (create-table
>   'PEOPLE
>   '(ID auto (#:primary-key))
>   '(USERNAME char-field (#:maxlen 32 #:not-null #:unique))
>   '(PASSWORD char-field (#:maxlen 500 #:not-null))
>   '(SALT char-field (#:maxlen 500 #:not-null))
>   '(NAME char-field (#:maxlen 32 #:default ""))
>   '(SUMMARY char-field (#:maxlen 500 #:default ""))))
>
> Let me know if there's anything else you need or will help with figuring
> out what's going on and I'm happy to do so. Thanks!
>
> Jonathan
>
> On 10/2/18 12:21 AM, Nala Ginrut wrote:
>> Hi Jonathan!
>> Sorry for late reply.
>> This bug has been fixed:
>> https://gitlab.com/NalaGinrut/artanis/commit/15f5cc1f1584ef02908cce21eb6f9f4aaeda3ac8
>>
>> Please update and try.
>>
>> Best regards.
>>
>>
>> Jonathan Schmeling writes:
>>
>>> Sorry to E-mail, again, so soon but I may've found another bug.
>>>
>>> After updating to the latest in the master branch from the previous
>>> stable release, I noticed that trying to create a table with the call I
>>> had been using no longer worked.
>>>
>>> The call I'd been using was:
>>>
>>> (migrate-create
>>>    (create-table
>>>    'PEOPLE
>>>    '(ID auto (#:primary-key))
>>>    '(USERNAME char-field (#:maxlen 32 #:not-null #:unique))
>>>    '(PASSWORD char-field (#:maxlen 500 #:not-null))
>>>    '(SALT char-field (#:maxlen 500 #:not-null))
>>>    '(NAME char-field (#:maxlen 32))
>>>    '(SUMMARY char-field (#:maxlen 500))))
>>>
>>> After updating to get the session fix, it now throws the error:
>>>
>>> Creating table `PEOPLE'......Backtrace:
>>>    5 (apply-smob/1 #<catch-closure 55c8442c0b80>)
>>> In ice-9/boot-9.scm:
>>>    705:2 4 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
>>> In ice-9/eval.scm:
>>>    619:8 3 (_ #(#(#<directory (guile-user) 55c844356140>)))
>>> In /usr/local/bin/art:
>>>    42:12 2 (_ _ _)
>>> In artanis/mvc/migration.scm:
>>>    89:4 1 (create-table PEOPLE (ID auto (#:primary-key)) (# # #) # …)
>>> In artanis/fprm.scm:
>>>    375:2 0 (_ _ _ #:if-exists? _ #:engine _ #:dump _ #:primary-keys …)
>>>
>>> artanis/fprm.scm:375:2: Invalid keyword: (USERNAME varchar 32
>>> (#:not-null #:unique))
>>>
>>> Trying to isolate the error to a particular keyword, I tried removing
>>> the #:unique keyword and then the #:not-null keywords but I still got
>>> the same error. I didn't bother removing the #:maxlens since, if I
>>> remember correctly, that caused an error in the last stable release.
>>>
>>> Jonathan
>>
>> --
>> GNU Powered it
>> GPL Protected it
>> GOD Blessed it
>> HFG - NalaGinrut
>> Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058


--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
Fingerprint F53B 4C56 95B5 E4D5 6093 4324 8469 6772 846A 0058

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]