question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Insufficient error reporting on alpha1

See original GitHub issue

Error is:

  File "/usr/local/lib/python3.7/dist-packages/edgedb/asyncio_con.py", line 71, in fetchone
    query, args, kwargs)
  File "edgedb/protocol/protocol.pyx", line 476, in execute_anonymous
  File "edgedb/protocol/protocol.pyx", line 189, in _parse
edgedb.errors.InternalServerError: 'cookie_id'

The query is:

            WITH
                NewUser := (INSERT User {
                    first_name := <str>$first_name,
                    last_name := <str>$last_name,
                    email := <str>$email,
                    password := <str>$password,
                }),
                NewSession := (INSERT Session {
                    cookie := <str>$cookie_id,
                    expires := <datetime>$expires,
                    user := NewUser,
                })
            SELECT NewUser {
                id
            }

Schema is:

    type User {
        property first_name -> str;
        property last_name -> str;
        required property email -> str {
            constraint exclusive;
        };
        property password -> str;
    }
    type Session {
        required property cookie -> str;
        required property expires -> datetime;
        multi link user -> User;
        index cookie_idx on (__subject__.cookie);
    }

Small change like this:

            WITH
                NewUser := (INSERT User {
                    first_name := <str>$first_name,
                    last_name := <str>$last_name,
                    email := <str>$email,
                    password := <str>$password,
                }),
                NewSession := (INSERT Session {
                    cookie := <str>$cookie_id,
                    expires := <datetime>$expires,
                    user := NewUser,
                })
            SELECT NewSession {
                cookie
            }

makes query working. I’m not sure if the query actually makes sense. I originally wanted to do two inserts and return data from the first one. I guess there is some pruning of unused variables going on…

Edgedb version is alpha1 from the distribution. Not sure if it’s fixed in master.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
1st1commented, Jan 9, 2020

Some context on closing this: correct protocol implementation would guard against sending incorrect number of arguments or types. The server should react in a relatively nice way if it wasn’t the case, but right now we lack proper testing infrastructure to add tests for that. We’ll deal with this and many other scenarios when we start investing into proper low-level protocol testing infra.

1reaction
elpranscommented, Nov 25, 2019

The WITH clause, unlike in SQL is purely declarative, so if you don’t refer to the declared query, it never gets executed. The KeyError on the parameter name is a bug for sure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type I and type II errors - Wikipedia
In statistical hypothesis testing, a type I error is the mistaken rejection of an actually true null hypothesis (also known as a "false...
Read more >
Lipemia: causes, interference mechanisms, detection and ...
Another issue regarding automatic detection of lipemia is a lack of standardization among manufactures in reporting L-index values. Some use semi quantitative, ...
Read more >
Fix common cluster issues | Elasticsearch Guide [8.5] | Elastic
This error indicates a data node is critically low on disk space and has reached the flood-stage disk usage watermark. Circuit breaker errors:...
Read more >
Type I and II Errors and Significance Levels
Type I and II Errors and Significance Levels. Type I Error Rejecting the null hypothesis when it is in fact true is called...
Read more >
Apache Log4j Security Vulnerabilities
Apache Log4j Security Vulnerabilities. This page lists all the security vulnerabilities fixed in released versions of Apache Log4j 2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found