getappmap / getappmap/appmap-js

inspect: inspecting Misago AppMaps fails with SQL parsing errors

Open
#448 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
53
Forks
18
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Tested app: Misago https://github.com/rafalp/Misago, misago-appmaps.zip

npx appmap inspect -i package:misago
Indexing the AppMap database
Unable to parse DECLARE ? NO SCROLL CURSOR WITHOUT HOLD FOR SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? : Syntax error found near WITH Clause (Statement)
Unparseable: DECLARE ? NO SCROLL CURSOR WITHOUT HOLD FOR SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ?
Unable to parse SELECT ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse INSERT INTO ? (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?::timestamptz, ?, ?, ?, ?, ?) RETURNING ?.? : Syntax error found near INTO Keyword (INTO Clause)
Unable to parse UPDATE ? SET ? = ? WHERE (?.? = ? AND NOT (?.? = ?)) : Syntax error found near UPDATE Keyword (UPDATE Statement)
Unable to parse UPDATE ? SET ? = ? WHERE ?.? = ? : Syntax error found near UPDATE Keyword (UPDATE Statement)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.? FROM ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unparseable: SELECT ?.?, ?.? FROM ?
Unable to parse SELECT ?.?, ?.?, ?.? FROM ? WHERE (?.? > ?::timestamptz AND ?.? = ?) : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? LEFT OUTER JOIN ? ON (?.? = ?.?) LEFT OUTER JOIN ? ON (?.? = ?.?) LEFT OUTER JOIN ? ON (?.? = ?.?) WHERE ?.? = ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.? FROM ? INNER JOIN ? ON (?.? = ?.?) WHERE ?.? = ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse DECLARE ? NO SCROLL CURSOR WITHOUT HOLD FOR SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? INNER JOIN ? ON (?.? = ?.?) WHERE ?.? IN (?, ?, ?, ?, ?) : Syntax error found near WITH Clause (Statement)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE (?.? = ? AND ?.? > ?) ORDER BY ?.? ASC  LIMIT ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE (?.? = ? AND ?.? > ?) ORDER BY ?.? ASC : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? ORDER BY ?.? ASC  LIMIT ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? ORDER BY ?.? ASC : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ?  LIMIT ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? LEFT OUTER JOIN ? ON (?.? = ?.?)  LIMIT ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SELECT (?) AS ? FROM ? WHERE ?.? IN (?, ?, ?, ?, ?)  LIMIT ? : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse SAVEPOINT ? : Syntax error found near WITH Clause (SAVEPOINT Statement)
Unparseable: SAVEPOINT ?
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? LEFT OUTER JOIN ? ON (?.? = ?.?) WHERE ?.? IN (?, ?, ?, ?, ?) : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse UPDATE ? SET ? = ? WHERE ?.? IN (?, ?, ?, ?, ?) : Syntax error found near UPDATE Keyword (UPDATE Statement)
Unable to parse RELEASE SAVEPOINT ? : Syntax error found near WITH Clause (RELEASE Statement)
Unparseable: RELEASE SAVEPOINT ?
Unable to parse UPDATE ? SET ? = ?::timestamptz WHERE ?.? = ? : Syntax error found near UPDATE Keyword (UPDATE Statement)
Unable to parse UPDATE ? SET ? = ?, ? = ?::timestamptz WHERE ?.? = ? : Syntax error found near UPDATE Keyword (UPDATE Statement)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? FOR UPDATE : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse DELETE FROM ? WHERE ?.? IN (?) : Syntax error found near DELETE Keyword (DELETE Statement)
Unable to parse SELECT ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.?, ?.? FROM ? WHERE ?.? = ? FOR UPDATE : Syntax error found near Numbered Bind Parameter (SELECT Results Clause)
Unable to parse UPDATE ? SET ? = ? : Syntax error found near UPDATE Keyword (UPDATE Statement)
appmap inspect <code-object>

Search AppMaps for references to a code object (package, function, class, query,
route, etc) and print available event info

Positionals:
  code-object  identifies the code-object to inspect                  [required]

Options:
      --version      Show version number                               [boolean]
  -v, --verbose      Run with verbose logging                          [boolean]
      --help         Show help                                         [boolean]
      --appmap-dir   directory to recursively inspect for AppMaps
                                                         [default: "tmp/appmap"]
  -i, --interactive  interact with the output via CLI                  [boolean]

TypeError: Cannot read property 'id' of undefined
    at Canonicalize.functionCall (/Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/canonicalize/classes.js:7:49)
    at Canonicalize.transform (/Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/canonicalize/base.js:46:21)
    at Array.map (<anonymous>)
    at Canonicalize.execute (/Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/canonicalize/base.js:20:14)
    at module.exports (/Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/canonicalize/classes.js:12:55)
    at canonicalize (/Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/canonicalize.js:58:12)
    at /Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/fingerprinter.js:114:39
    at Array.map (<anonymous>)
    at /Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/fingerprint/fingerprinter.js:113:55
    at buildDirectory (/Users/ptrdvrk/work/github/python/Misago/node_modules/@appland/appmap/built/src/utils.js:107:15)
✖ 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with npx appmap inspect -i package:misago and the attached Misago AppMaps. Start in built/src/fingerprint/canonicalize/classes.js, then trace through canonicalize.js, fingerprinter.js, and utils.js; done means inspection completes without the SQL parsing errors or the Cannot read property 'id' TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
cli, databases, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.