text:
Make an error quine!
Your challenge: write a "program", for a language of your choice, that causes the compiler/interpreter/runtime to produce error output when compiling/running your program which is identical to your program's source code.
Rules:

Your program may be specific to a particular version or implementation of your language's compiler/interpreter/runtime environment. If so, please specify the particulars.
Only standard compiler/interpreter/runtime options are permitted. You cannot pass some weird flag to your compiler to get a specific result.
The program does not need to be syntactically or semantically valid, but I may give a bounty to the best syntactically valid submission.
The program must not produce any output of its own (e.g. by calling a print or output function). All output generated upon attempting to compile/run the program must originate from the compiler/interpreter/runtime.
The complete output of the compiler/interpreter/runtime must be exactly identical to your program source code.
The compiler/interpreter/runtime must generate at least one error message when invoked with your program.

This is a popularity contest. Most creative answer, as determined by upvotes, wins. If you can give a good case for using a standard loophole, you may do so.

What is "error output"? And what does it mean to "generate an error message"? More specifically: 1) Does the output have to be to stderr? 2) If the runtime logs an error to syslog and doesn't write anything to stderr, what should be compared to the source of the program? 3) If the runtime throws an exception internally when given an empty program, but requires a flag to actually print the exception and so ends up exiting with a non-zero exit code but no output, has an error message been generated?

I tried doing this in java and got a p3 oscilator. This was the shortest phase: (Compile from q.java): Error: Could not find or load main class Q

Ha, because of a syntactic ambiguity in the first sentence, I thought the challenge here was to produce a program which normally produces no output, but if you pass its own code to it as input, it produces an error.

When reporting an error, APL always prints a customizable error name, optionally an error message, the name of the program that caused the error, the (bracketed) line number where the error occurred, the line of code that caused the error, and a line with a caret indicating where parsing stopped. Any hope for participation here?

@SteveBennett Why haven't you made that challenge yet?

It's non-observable whether something is output by the runtime or the program. You could argue that a syntacticly invalid program is actually triggering a built-in function that prints an error message, making rule 4 impossible to fulfill. Is this a valid submission in Python 3?

I wonder if we can do the same but with warnings instead of errors...

Ed (1 byte)
All the other solutions thus far are long and ugly. I suppose that is because of the nature of most error messages. But a good error message is elegant in its simplicity. For that, look no further than ed.
?

Save this to a file called edscript and run with ed < edscript, or run ed<<<?.  The result:
?

The question mark is written to stderr and ed returns 1, so this actually is an error message. I wonder why ed isn't very popular?
False (0 bytes)

Run with false filename. It writes the program's source code (i.e. nothing) to stderr and returns 1.  Of course, calling false a programming language is questionable, and the zero byte quine is unoriginal, but I thought I might as well add it.  There is probably some interpreter for a language that prints no error messages, and could replace false.
Now I wish this was code golf.

I was looking through the (long) list of esolangs to find a language like this. This is the weakness of this challenge. It's not about writing a clever program, it's about cleverly choosing the language. :/

@IngoBürk Fortunately this is a popularity contest, not a golf.

The 0-byte False is also the same code that at one time won the "Worst Abuse of the Rules" award by the IOCCC for making the theoretically shortest quinine. It had plenty of compiler errors, though, and it was written in K&R C, not ISO C (which is stricter).

@IngoBürk Many real-life problems are about cleverly choosing the language, too. :P

@fluffy Wow, I completely missed that. :) I take back everything I said.

@IsiahMeadows Quinine?

@Mendeleev *Quine (Until somewhat recently, I've constantly misread "quine" as "quinine" for some reason...)

Windows Command Prompt
& was unexpected at this time.

Note that this works with | also.

& was unexpected at this time. +1

Mind blowing one

Doesn't work for languages other than english :( Sad

This should be the winner, not only because it's better than the accepted one IMO, but because it has more upvotes.

CoffeeScript, syntactically valid
As tested on their website using Chrome or Firefox.
ReferenceError: defined is not defined

You can replace defined with anything that's not a built-in variable, but I thought this version was fun. Unfortunately, undefined is not defined in particular doesn't work as a quine.
In CoffeeScript this isn't even a syntax error, because it compiles. This is technically a runtime error in JavaScript, albeit a boring one. CoffeeScript is a likely candidate to produce some more interesting runtime error quines because a lot of funny sentences are valid code. E.g. the above example compiles to
({
  ReferenceError: defined === !defined
});

defined is by definedition defined. Wha...how...?

Undefined is not defined (with a capital U) seems to work lol

Windows .EXE, 248 bytes
The version of this file is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

No, really. Save as quine.txt, then rename to quine.exe (or download it here):

Python
Spyder
Well, a rather trivial solution for the Spyder IDE is to raise a SyntaxError.
Code and identical output:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)
  File "/Users/falko/golf.py", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax

(Python 2.7.8 with Spyder 2.2.5)

Terminal
An alternative solution for Python started from command line struggles with an unexpected indent.
Command:
python golf.py

Code and identical output:
  File "golf.py", line 1
    File "golf.py", line 1
    ^
IndentationError: unexpected indent

ideone.com
On ideone.com a solution might be as follows. (Try it!)
Code and identical output:
Traceback (most recent call last):

  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/py_compile.py", line 117, in compile
    raise py_exc
py_compile.PyCompileError: SyntaxError: ('invalid syntax', ('prog.py', 1, 22, 'Traceback (most recent call last):\n'))

(This is for Python 2. An example for Python 3 is trivial but with 15 lines of "code" rather lengthy.)

General approach:
How to create your own solution in 2 minutes?

Open a new file in an IDE of your choice.
Bang your head onto the keyboard in front of you.
Compile.
Replace the code with the compiler error message.
Repeat steps 3 and 4 until the code converges.

I bet such a procedure terminates pretty quickly in most cases!

As you can probably tell, I'm using that general approach. It doesn't work when the copied code progressively increases the amount of compiler errors. :-)

@rink.attendant.6: That's when our much-valued expert knowledge about software engineering is required. ;)

@rink.attendant.6 Or when you are sent off running in circles. Try it in the Excel-VBA immediate window.

I did step 1, 2, and 3, but I couldn't do step 4, the perl code was perfectly valid!

Hey how about this in the python stock IDE, SyntaxError: invalid syntax produces the same thing too :)

Prefer the second one because that's straight up Python; no IDE/Framework mess.

@Falko I've actually used the general approach before lol

><> - 25 Bytes
something smells fishy...

In Fish, any bad instruction outputs the error: "something smells fishy...". Since s is not a valid command, it errors immediately.

Please note that the language name is ><>, which is usually pronounced "fish".

And it's really "Something smells fishy..."

@CᴏɴᴏʀO'Bʀɪᴇɴ On the python interpreter, it is indeed something smells fishy..., but it is Something smells fishy... on the online interpreter. It's dependent on the interpreter.

@VTCAKAVSMoACE Ah, thanks.

Cuz 'fish' is the name of the shell program/language for the 90s!

Chicken
Error on line 1: expected 'chicken'

What a peculiar language

Link to language is dead.

@pppery Fixed. I should probably get this on TIO.

waiting for tio addition...

Whitespace
First I thought this is clearly impossible. But actually it is trivial as well. -.-
Fail: Input.hs:108: Non-exhaustive patterns in function parseNum'

Try it.
Yeah, my first whitespace program! ;)

Can we even call this a whitespace program?

Is this an interpreter bug?

JavaScript
Since different browsers use different JavaScript compilers, they produce different messages. These are, however, rather trivial solutions.
V8 (Chrome 36 / Node.js)
SyntaxError: Unexpected identifier

SpiderMonkey (Firefox 31)
SyntaxError: missing ; before statement

Chakra (Internet Explorer 11)
Expected ';'

In jsc: Exception: SyntaxError: Unexpected identifier 'identifier' :D

@ConfusedMr_C That's a wierd token to choke on.

@SuperJedi224 Yes. At least it works :P

Is (f=n=>console.error(\(f=${f})()`))()` cheating?

Spider Monkey!

Microsoft Excel
Formula: #DIV/0!
Error Message: #DIV/0!
In order to enter a formula without using an equals sign, go into Excel Options/Advanced/Lotus Compatibility Settings and enable Transition Formula Entry.

-2 bytes: #REF!

Commodore 64 Basic
?SYNTAX  ERROR

When run on the emulator of your choice (or an actual Commodore 64), produces
?SYNTAX  ERROR

This is, in fact, a syntactically-valid one-line program.  The question mark is a shortcut for PRINT, and SYNTAX and ERROR are valid variable names.  The error occurs because the parser gets confused by the substring OR in ERROR.

If the parser gets confused and throws a syntax error, doesn't that make it not syntactically valid?

@MartinBüttner, that really depends on which you consider the authority for "valid syntax": the language description, or the language implementation.

I see, so technically is syntactically valid but it's tripping up the parser due to a bug of a particular implementation?

More or less, confounded by the fact that there is only one implementation.

Nitpick: CBM BASIC actually prints two spaces, not one, between "SYNTAX" and "ERROR".  Unfortunately I can't edit this answer to correct it, as Stack Exchange imposes a silly 6-character minimum for edits.

@Psychonaut, fixed.

ERROR isn't a valid variable name in Commodore BASIC; ERR would be.

Java 8 compilation error quine (12203 bytes)
Generated on windows + mingw with java 1.8.0_11 jdk, using this command:
echo a > Q.java; while true; do javac Q.java 2> Q.err; if [ $(diff Q.err Q.java | wc -c) -eq 0 ]; then break; fi; cat Q.err > Q.java; done

May not be the shortest one, may not be the longest one either, more a proof of concept. Works because error output shows at most 100 errors.
Q.java:1: error: class, interface, or enum expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:1: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                      ^
Q.java:1: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                                 ^
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
                                      ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:1: error: = expected
Q.java:1: error: class, interface, or enum expected
                                           ^
Q.java:2: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
      ^
Q.java:2: error: ';' expected
Q.java:1: error: class, interface, or enum expected
       ^
Q.java:2: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
        ^
Q.java:2: error: = expected
Q.java:1: error: class, interface, or enum expected
               ^
Q.java:2: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                      ^
Q.java:2: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                                 ^
Q.java:2: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
                                      ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:2: error: = expected
Q.java:1: error: class, interface, or enum expected
                                           ^
Q.java:3: error: illegal start of type
^
^
Q.java:4: error: = expected
Q.java:1: error: <identifier> expected
 ^
Q.java:4: error: <identifier> expected
Q.java:1: error: <identifier> expected
      ^
Q.java:4: error: ';' expected
Q.java:1: error: <identifier> expected
       ^
Q.java:4: error: illegal start of type
Q.java:1: error: <identifier> expected
        ^
Q.java:4: error: = expected
Q.java:1: error: <identifier> expected
               ^
Q.java:5: error: '(' expected
Q.java:1: error: class, interface, or enum expected
 ^
Q.java:5: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
      ^
Q.java:5: error: ';' expected
Q.java:1: error: class, interface, or enum expected
       ^
Q.java:5: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
        ^
Q.java:5: error: = expected
Q.java:1: error: class, interface, or enum expected
               ^
Q.java:5: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                      ^
Q.java:5: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                                 ^
Q.java:5: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
                                      ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:5: error: = expected
Q.java:1: error: class, interface, or enum expected
                                           ^
Q.java:6: error: illegal start of type
                      ^
                      ^
Q.java:7: error: = expected
Q.java:1: error: <identifier> expected
 ^
Q.java:7: error: <identifier> expected
Q.java:1: error: <identifier> expected
      ^
Q.java:7: error: ';' expected
Q.java:1: error: <identifier> expected
       ^
Q.java:7: error: illegal start of type
Q.java:1: error: <identifier> expected
        ^
Q.java:7: error: = expected
Q.java:1: error: <identifier> expected
               ^
Q.java:8: error: '(' expected
Q.java:1: error: class, interface, or enum expected
 ^
Q.java:8: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
      ^
Q.java:8: error: ';' expected
Q.java:1: error: class, interface, or enum expected
       ^
Q.java:8: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
        ^
Q.java:8: error: = expected
Q.java:1: error: class, interface, or enum expected
               ^
Q.java:8: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                      ^
Q.java:8: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                                 ^
Q.java:8: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
                                      ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:8: error: = expected
Q.java:1: error: class, interface, or enum expected
                                           ^
Q.java:9: error: illegal start of type
                                 ^
                                 ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
 ^
Q.java:10: error: <identifier> expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
      ^
Q.java:10: error: ';' expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
       ^
Q.java:10: error: illegal start of type
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
        ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
               ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                       ^
Q.java:10: error: illegal start of type
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                               ^
Q.java:10: error: <identifier> expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                ^
Q.java:10: error: unclosed character literal
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                  ^
Q.java:10: error: ';' expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                    ^
Q.java:10: error: unclosed character literal
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                       ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                     ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                           ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                      ^
Q.java:10: error: = expected
Q.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
                                                                                ^
Q.java:11: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
      ^
Q.java:11: error: ';' expected
Q.java:1: error: class, interface, or enum expected
       ^
Q.java:11: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
        ^
Q.java:11: error: = expected
Q.java:1: error: class, interface, or enum expected
               ^
Q.java:11: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                      ^
Q.java:11: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                                 ^
Q.java:11: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
                                      ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:11: error: = expected
Q.java:1: error: class, interface, or enum expected
                                           ^
Q.java:12: error: illegal start of type
                                      ^
                                      ^
Q.java:12: error: <identifier> expected
                                      ^
                                       ^
Q.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
   ^
Q.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
      ^
Q.java:13: error: <identifier> expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
              ^
Q.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
               ^
Q.java:13: error: ';' expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                  ^
Q.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                               ^
Q.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                   ^
Q.java:13: error: unclosed character literal
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                        ^
Q.java:13: error: = expected
  (use -source 1.4 or lower to use 'enum' as an identifier)
                                                          ^
Q.java:14: error: <identifier> expected
Q.java:1: error: = expected
      ^
Q.java:14: error: ';' expected
Q.java:1: error: = expected
       ^
Q.java:14: error: illegal start of type
Q.java:1: error: = expected
        ^
Q.java:14: error: = expected
Q.java:1: error: = expected
               ^
Q.java:14: error: illegal start of type
Q.java:1: error: = expected
                 ^
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
^
Q.java:15: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
 ^
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
      ^
Q.java:15: error: illegal start of type
Q.java:1: error: class, interface, or enum expected
       ^
Q.java:15: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
        ^
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
          ^
Q.java:15: error: ';' expected
Q.java:1: error: class, interface, or enum expected
               ^
Q.java:15: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                      ^
Q.java:15: error: <identifier> expected
Q.java:1: error: class, interface, or enum expected
                                 ^
Q.java:15: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Q.java:1: error: class, interface, or enum expected
                                      ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Q.java:15: error: = expected
Q.java:1: error: class, interface, or enum expected
                                           ^
Q.java:16: error: illegal start of type
                                           ^
                                           ^
Q.java:17: error: = expected
Q.java:2: error: <identifier> expected
 ^
Q.java:17: error: <identifier> expected
Q.java:2: error: <identifier> expected
      ^
Q.java:17: error: ';' expected
Q.java:2: error: <identifier> expected
       ^
Q.java:17: error: illegal start of type
Q.java:2: error: <identifier> expected
        ^
Q.java:17: error: = expected
Q.java:2: error: <identifier> expected
               ^
100 errors

Bash (32)
Save as file named x:
x: line 1: x:: command not found

When run:
>> bash x
x: line 1: x:: command not found

ArnoldC
missing IT'S SHOWTIME on first line

Paste the code into this compiler.

What's funny is that IT'S SHOWTIME is in fact on the first line

Should make a PR to fix that :P

TrumpScript - Making PPCG Great Again (TrumpScript)
When trying to run this language on a windows PC, the output is always:
Make sure the currently-running OS is not Windows, because we're not PC

So when running this program:
Make sure the currently-running OS is not Windows, because we're not PC

It won't even parse it because the OS check fails, and you get the error message. Examples can be given for Mac as well if anyone wants them haha. God I've wanted to use this in PPCG for awhile now, good that I finally get to.
Full list of errors that can be triggered using environmental specifics:
https://github.com/samshadwell/TrumpScript/blob/master/src/trumpscript/utils.py

Bonus Answer: ArnoldC (ArnoldC)
ArnoldC requires root declaration of IT'S SHOWTIME, meaning main(), so:
WHAT THE FUCK DID I DO WRONG

Results in the only error message in ArnoldC...
WHAT THE FUCK DID I DO WRONG

Which, is actually... hilarious. You have to run it non-verbose though w/o stack traces.

These should be two separate answers.

Z-machine interpreter
I don't know the word "know".

Test against this popular interpreter.  Also there's some sort of mostly harmless game hosted there.

Interpreter no longer functions due to lack of Flash support. Link an HTML5 version?

Good callout - I've updated the link!

This quine made me laugh simply due to the hitchhikers guide reference :)

Mathematica
Syntax: "needed." is incomplete; more input is needed.

A . in Mathematica means either a decimal point or function Dot. In this case, the . appears at the end of an expression and cannot be interpreted.

I didn't think it was possible.

Julia 0.2.0
Another syntax error found iteratively until a fixed point was reached:
ERROR: syntax: extra token "token" after end of expression

AppleScript
A identifier can’t go after this identifier.
Both A and identifier can be identifiers, so AppleScript says no.

it should be an identifier... come on....

C++ (g++)
The file must be saved as 1.pas.
g++: error: 1.pas: Pascal compiler not installed on this system

Does it still work if the Pascal compiler is installed in the system?

@SuperJedi224 At least installing FreePascal doesn't help. I suppose GNU Pascal might be the right Pascal compiler, but I didn't try.

INTERCALL, 90 bytes
Fatal error: A INTERCALL program must start with the mandatory header to prevent golfing.\n

Includes a trailing newline at the end. Note that this isn't STDERR, but it was considered to be error output by many, so I posted it here.
This is the "mandatory header":
INTERCALL IS A ANTIGOLFING LANGUAGE
SO THIS HEADER IS HERE TO PREVENT GOLFING IN INTERCALL
THE PROGRAM STARTS HERE:

The link to the repo is broken.

@connectyourcharger Hm, looks like there's no repo anymore.

Yeah, Google searches yield nothing except for repos for Intercal.

@connectyourcharger No need to; there are only 8 repos called "intercall" (case-insensitive), and none of them are about the language, so it's safe to say it's gone for good (no, there's nothing in the Wayback Machine either).

Pepe, 9 bytes
RRRERROR!

Link to interpreter (paste the code above, permalink removes the ! and O)
Explanation:
The interpreter ignores characters other than R,r,E,e so the code is:
RRRERRR

Now to explain:
  RE    # Push 0
RR      # (RR flag: doesn't exist)
    RRR # There is no command RRR, so output RRRERROR!

I like the enthusiasm of this error message.

C
I applied the method of repeatedly copying the error messages to the source.  It converged in 2 cycles.  Compiled on OSX 10.9 with 'cc -c error.c'.
error.c:1:1: error: unknown type name 'error'
error.c:1:1: error: unknown type name 'error'
^
error.c:1:6: error: expected identifier or '('
error.c:1:1: error: unknown type name 'error'
     ^
2 errors generated.

Note: This is not so much an answer as it is a methodology to get one.  The result might change depending on your OS or the version of cc you are using.
The exact method to get the result is to execute the instructions
$ cc -c error.c 2>out ; mv out error.c ; cat error.c

repeatedly until the output stops changing.

I retried.  It didn't work at first.  To make it work you have to execute cc -c error.c 2>out and then mv out error.c.  And with the version of cc I have today it takes a few more iterations.

You may want to note that in your answer, that it requires a specific version of OSX cc; otherwise it is invalid and must be deleted per community guidelines.

@MDXF: It works with clang. Here is a link to tio.run, 122 bytes: https://tio.run/##S9ZNzknMS///Xy85PyVVryQzXy/ZyhAIFVKLivKLgFRFQWpySWqKQmZKal5JZlpmapFCfpGCuoY6Fxla4rgMIaoU0lPzUosSgar0/v8HAA

You get a nice long one with gcc -v -Wall -pedantic but it still converges quickly e.g. error.c:1:1: error: unknown type name 'Apple' Apple clang version 11.0.3 (clang-1103.0.32.62)

Applescript (in Script Editor)
Syntax Error
A "error" can't go after this identifier.

it's an error?

The article "A" appears before words which start with a consonant or a consonant sound. For words which begin with a vowel or a vowel sound, the correct article is "an". I'm just being nitpicky :)

@cat I see.  Yep, I never claimed grammatical correctness :)

GHCi (a Haskell interpreter/shell)
Code.hs:1:1: Parse error: naked expression at top level

Usage:
Write the code in a file named Code and load with GHCi.
A nice fact is that, if the words were actual identifiers, this would be a legal expression (as long as it would typecheck). This is basically due to the fact that : is a built in operator, . is used for module-qualified names, and whitespace is used to denote function application.

. isn't an operator here. It's part of a qualified name. What version of GHCi is this for?

@dfeuer yeah, my bad. Feel free to fix it. The ghci version is probably around whatever was out at the time.

BBC Basic, 7 bytes (or 0 Bytes)
This is a valid 7 byte entry:
Mistake

This is the error message produced by the interpreter when it is completely unable to make sense of the code.
On the other hand, this is not:
ERROR

This is a valid keyword in BBC Basic which is supposed to deliberately introduce an error of a specified code into the program, but the syntax is wrong (no code is given.) Therefore it returns Syntax error (which in turn returns Mistake when it is run.)
In general the procedure described by Falko in his answer leads to Mistake in BBC basic. There are a few exceptions. anything producing the errorsDATA not LOCAL or ON ERROR not LOCAL leads to the famous zero byte quine: an empty source code produces an empty file.
Given that most error messages in BBC basic are lowercase (and therefore not valid keywords) I am pretty sure that any invalid input will ultimately lead to one of these possibilities.

Ruby 2 on Windows
Code:
error.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
error.rb:1: syntax error, unexpected tI...
          ^

The code was found by testing and iterating the process over and over until a fix-point was reached. The code must be inside the file "error.rb".
Demo:
C:\>type error.rb
error.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTR
ING_DBEG or tSTRING_DVAR or tSTRING_END
error.rb:1: syntax error, unexpected tI...
          ^

C:\>ruby.exe error.rb
error.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTR
ING_DBEG or tSTRING_DVAR or tSTRING_END
error.rb:1: syntax error, unexpected tI...
          ^

C (gcc)
error.c:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
 error.c:1:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
      ^
compilation terminated due to -Wfatal-errors.

Compile with gcc -Wfatal-errors error.c.

CJam 0.6.2
Syntax error:
java.lang.RuntimeException: y not handled

Try it online.

x86 assembly
Bytecode:
53 65 67 6d 65 6e 74 61 75 69 6f 6e 20 66 61 75
6c 74 20 28 63 6f 72 65 20 64 75 6d 70 65 64 29

i.e. the text
Segmentation fault (core dumped)

Crashes immediately because the second instruction (the first being just "push %[er]bx") is
insl (%dx), %gs:(%di)

which fails because (a) ins cannot take segment overrides, (b) %dx and %di are almost certainly uninitialized, (c) %di is a 16-bit memory address and therefore can't be accessed in long mode, (d) ins is an invalid instruction outside of real mode.
The exact output may vary depending on what system this is run on, but it is likely that it will contain some form of illegal instruction.

To be precise, the text Segmentation fault (core dumped) is generated by your shell. If you set +m before running your program, you won’t see anything.

m4 (before 1.4.18-3 Termux patch), Termux, Android 11, 35 bytes
Who said the error had to be caused directly?
FORTIFY: %n not allowed on Android

Includes trailing newline.
m4 uses a very old version of Gnulib.
Since Android doesn't support %n in printf, Gnulib will replace every printf function in libc with its own custom implementation.
However, stupidly, said function will still use libc's snprintf function internally (which it is supposedly trying to replace because it doesn't work ), and when using it, it attempts to use %n every single time it is called, even if %n isn't in the original format string.
%n used to be silently ignored on Android (similar to macOS), but Android 11 made these errors fatal, causing this error to be printed followed by abort().
I used set +m to prevent Bash from printing the signal error, and I had to compile from source to undo the -3 patch.
The file itself doesn't matter: m4 is guaranteed to crash no matter what. This includes running with no arguments.
See this Github issue

zsh (Linux)
zsh: command not found: zsh:
Should work with some small changes in just about any other shell.

CoffeeScript
Fails on first error, so it's fairly easy to do:
E:\foo.coffee:1:3: error: unexpected \
E:\foo.coffee:1:3: error: unexpected \
  ^

Demo
E:\>coffee -c foo.coffee
E:\foo.coffee:1:3: error: unexpected \
E:\foo.coffee:1:3: error: unexpected \
  ^

E:\>

Forth
Try it here
This was surprisingly easy to come up with.
a : error(-13): word not found

Bash
$ bash: bash:: command not found
bash: bash:: command not found

ArnoldC, 28 bytes
WHAT THE FUCK DID I DO WRONG

This is the only error message in ArnoldC, though you do have to turn off stack traces.

GNU Make 4.1
make: *** No rule to make target 'No', needed by 'make'.  Stop.

This is syntactically valid:

Make tries to evaluate the target named make (first target is the default),
which depends on the target named No,
which it has no rule for.

But don't ***, 'No', and Stop. contain syntactically invalid tokens? Also, have you noticed that your profile shows a picture of someone rushing but your name is eush77?

@MDXF Oh, no. *** is a wildcard, 'No' is quoted, and the dot in Stop. is allowed (as in filenames, e.g. Stop.c). You can run make --debug to see for yourself that it proceeds exactly as I described. You can also touch No to see the message change :)

@MDXF I'm sorry, I didn't get the joke about rushing and the first letter of my name. Is it somehow unusual on this site?

Ah, okay. +1 and I didn't mean for it to be a joke; I thought you may have had a typo in your username. My bad.

@MDXF I never thought about my username this way! No, its origin is totally unrelated to the pic :-)

Malbolge, 32 bytes
invalid character in source file

Try it online!

Piet, using npiet interpreter
cannot read from `Error.txt'; reason: unknown PPM format

Save as 'Error.txt' and put it in the same folder as the npiet executable. If you want to golf, you can of course choose a shorter filename and adjust the code to match.

Glad someone else thought of Piet. I really want to make my own image-based esolang some day.

Lua
Code:
lua: ERROR.lua:1: function arguments expected near '.'

It seems fairly easy to do with lua. I also modified it to work on ideone.com as:
luac: prog.lua:1: function arguments expected near '.'

Try it.

Yeah, got it in few iterations starting from single local. Won't you mind if I'll explain this in answer's body?

Rebol
Interestingly, the error message here parses as symbols/tokens:
x
** Script error: x has no value
** Where: do either either either -apply-
** Near: do intern code

So despite looking error-like, it could be made a valid Rebol program if you gave all the words meanings.
However if you wanted an error at the parse phase vs. a runtime error in the code, the program/error could be:
1A
** Syntax error: invalid "integer" -- "1A"
** Where: to case load either either -apply-
** Near: (line 1) 1A

So given that distinction is possible, you can do fun things if you redefine ** from exponentiation into something else (which I can't think of how to make useful for this particular challenge, given it's a quine.)
(Note: Trying to abuse it for a trick uncovered a peculiarity of what happens when ** (an infix operator) is redefined and then used immediately after.  I tried:
**: function [:a :b :c :d :e :f] []
** Syntax error: invalid "integer" -- "1A"
** Where: to case load either either -apply-
** Near: (line 1) 1A

My goal was to override the ** so that it would accept its arguments unevaluated.  That way ** Syntax error: invalid "integer" -- "1A" (or whatever) would not attempt to assign invalid to error, but pass the symbols to **.  But because ** is infix it attempted to raise the function body to the power of Syntax prior to the completion of the assignment of **:.
It can be remedied by putting any token between the [] and the **.  But it helps to remember how your language evaluator works.  :-P)

R (GUI)
Error: unexpected symbol in "Error: unexpected symbol"

The issue here is replicating the ", which causes the error message to change from unexpected symbol to unexpected string constant. Pretty much any error R throws will have the form Error: <something> in "<bad code>", so you will pretty much always have to contend with the quoting. I tried this several other ways and always ended up falling back here.

Pyth
    s_push: parser stack overflow
Traceback (most recent call last):
  File "pyth.py", line 752, in <module>
    exec(code_to_remove_tools + py_code_line, environment)
MemoryError

Try it online!

Javascript (Chrome/V8), 65 41 39 Bytes
Uncaught =u=_=>{throw`=u=${u};u()`};u()

Try it online!

Python 3, 28 bytes
SyntaxError: invalid syntax

Triangularity, 46 bytes
I smell no triangularity. YOU SHALL NOT PASS!

Try it online!
The language requires programs to be in the form of a triangle. If not, it denies you the gate to programming in the world of triangles. It will not let you pass.

Rust v1.45.2 (via Rust Playground)
Code (1126 bytes):
error: unknown start of token: `
 --> src/lib.rs:1:32
  |
1 | error: unknown start of token: `
  |                                ^
  |
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
  |
1 | error: unknown start of token: '
  |                                ^

error: unknown start of token: `
 --> src/lib.rs:4:36
  |
4 | 1 | error: unknown start of token: `
  |                                    ^
  |
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
  |
4 | 1 | error: unknown start of token: '
  |                                    ^

error: character constant must be escaped: '
 --> src/lib.rs:7:56
  |
7 | help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
  |                                                        ^

error: unterminated character literal
 --> src/lib.rs:9:36
  |
9 | 1 | error: unknown start of token: '
  |                                    ^

error: aborting due to 4 previous errors

error: could not compile `playground`.

Try it online (error message might differ in future versions of the language, though)
Compile errors in Rust all start with "error:", so copy/pasting the errors into the source a bunch of times eventually leads to these error messages. Default settings for the Rust Playground were used. That means 2018 edition, stable branch, and debug mode. I don't know what the target triple is.

Vyxal, 42 bytes
slice expected at least 1 arguments, got 0

Try it Online!

Go
Another fairly easy one using the "general approach" provided in the other answer. I still like my JavaScript ones better.
can't load package: package :
prog.go:1:1: expected 'package', found 'IDENT' can
prog.go:2:2: invalid package name _

Try it.

Lua (console), 35 bytes
This is what you get in the Lua console with the usual iterative approach:
stdin:1: '<name>' expected near '1'

which is a bit shorter than the one obtained for putting the code in a file.

ksh
$ ksh: ksh::  not found.
ksh: ksh::  not found.

Also works with bash: bash: bash:: comand not found

@shelvacu on my build of bash, bash: command not found errors with bash:: command not found, which errors with bash::: command not found. Am I doing something wrong?

@ConfusedMr_C must be a case of different versions. I am running 4.3.042-3 on x64 Arch Linux, and it works.

@shelvacu I'm running x64 Ubuntu, with whatever version of bash came with Ubuntu 14.04.3. Also, you can do zsh: command not found: zsh: in zsh.

@shelvacu Sorry, I just found out, I'm using 4.3.11(1)-release on x64 Ubuntu 14.04.3.

@DarkAjax ksh version 93u+ returns ksh: ksh::: not found.

@VoteToSpam You are probably running bash in a repl. You can get the right message using bash -c 'bash: bash:: ...'.

Perl
syntax error at quine.pl line 2, at EOF
Execution of quine.pl aborted due to compilation errors.

Replace quine.pl with whatever you named the file and enjoy.

Is it even possible to have a syntax error in perl? From what I've read online (mainly here) it seems as though perl accepts anything?

Java, in Eclipse
Syntax error on tokens, delete these tokens

Factor
No word named "No" found in current vocabulary search path

Guess what it prints?
No word named "No" found in current vocabulary search path

SmileBASIC
NEXT without FOR in 0:1

Whenever the pre-run parser encounters a NEXT which isn't paired with a FOR, it produces the error NEXT without FOR in slot:line. Here, the code is in slot 0 and on line 1.

Syntax error in 0:1 is shorter

I had that first, but this is a popularity-contest, so I went with something more creative.

Processing IDE
Probably the friendliest error message I've ever seen.
Syntax error, maybe a missing semicolon?

Result

Technically this is cheating a bit because the pane below it prints expected SEMI, found 'error'. Unfortunately the word error is written in single quotes, so trying to copy that into the source of the program causes it to spit out a massive "Badly formed character constant" error... which does not include any singly-quoted words allowing for it to quine itself.

A Pear Tree
a partridge

Try it online!
Almost every program (that isn't very long) prints a partridge in A Pear Tree.
One of the goals of the language was to be good at polyglot challenges; as such, it tries to find a substring of the program that has a very specific property that rarely occurs by chance, and starts running the program there. If it can't find an appropriate entry point, it prints an error. The actual text of the error message was chosen for the The Twelve Days of Christmas reference. (Actually, the design for the language worked the other way round; the main goal was to have a language which errored out on almost any source code, so that it would make the reference in question, so I set about trying to work out what sort of language design would naturally end up doing that.)

(t)csh
Unmatched '.

The trailing newline is needed to produce an exact match. Run it with csh quine.csh (or just type it into the shell, that works too).

Cubically, 94 bytes

Notepad: 0

   000
   000
   000
111222333444
111222333444
111222333444
   555
   555
   555

There are newlines at the start and end. (Cubically automatically dumps its memory to STDERR when the program finishes.)
Try it online!

Technically this isn't an error. so it does not "generate at least one error message"

This seems to be an error message as far as I can tell.  It does output to STDERR afterall.

Rust, 323 166 164 bytes
Call your program a. and use rustc a..
error: unknown start of token: \
 --> a.:1:32
  |
1 | error: unknown start of token: \
  |                                ^

error: aborting due to previous error

Pip, 71 bytes
code and error:
R is not a unary operator
Fatal error while parsing, execution aborted.

also:
Hit end of tokens while parsing expression
Fatal error while parsing, execution aborted.

Try it online!

Setanta, 97 bytes
Eisceacht ar líne 1: Suíomh 19: Ag súil le uimhir, téacs, bool, athróg, liosta, nó gníomh.

Try it here!

Grok, 20 bytes
You don't grok Grok.

Try it Online!
Grok has only one error message, and one of the ways to trigger it is to try to execute an invalid command. In this case, oun'tgrG. are all invalid commands, so when the execution reaches the first o, it errors out, printing the source code.

Desmos
Sorry, I don't understand the '"' symbol.
https://www.desmos.com/calculator/q0w3njcgxe

Welcome to Code Golf! I seem to get a different error when I go to that link: You need something on both sides of the '.' symbol.

I couldn't make the code you posted work, but Sorry, I don't understand the '"' symbol. seems to do the trick.

Yes, I had tested it without the period. editing now.

Dupe answers are allowed per meta consensus, but keep in mind that this is essentially a dupe answer of this post. You also need to include the byte count in the header of your post. In your case that would be 41 bytes.

Python 3, 105 bytes
  File ".code.tio", line 1
        File ".code.tio", line 1
        ^
IndentationError: unexpected indent

Try it online!

Befunge on Wasabi v1.4
There is an interpreter for Befunge called Wasabi, and when an error appears the error message is in the format of a dialog box. This is the program:
Unsupported Command : 'U' at (1, 0). Ignore next syntax error(s)?

To test, download Wasabi v1.4 and insert the above program.

MATLAB, 66 bytes
Undefined function 'Undefined' for input arguments of type 'char'.

This outputs the same to STDERR (shown in the console in red):

This is actually pretty unknown functionality (and it's rarely useful), which is why the MATLAB submission in the "Hello World!"-challenge may be improved.
This works because MATLAB will automatically interpret a command on the form <word_1 word_2 word_3 word_4>, with no surrounding brackets, as a function on the form:
word_1('word_2')`

That is, it calls a function word_1 and gives the single input argument after the first, and in front of the second space as a string input to that function.
"Real life"-examples that can be used for golfing:
disp Hello   % Shorter than disp('Hello')
Hello

disp Hello World!
Hello

nnz variable
ans =
     8

Note that it will always interpret it as a string, it will not evaluate it:
variable = 3;
nnz variable
ans =
     8
nnz(variable)
ans =
     1

In my current MATLAB version (R2016b), this can be considerably shortened to 43 bytes: Undefined function or variable 'Undefined'..

Really, it doesn't treat the words after Undefined as string inputs? What happens if you do Undefined('function','or','variable')? In previous versions these commands are equivalent. It doesn't tell you that the character input is invalid? It makes sense, but it's definitely new behavior. What about a=2;b={};a(b). Or just a({1}) without initializing anything first?

It does, hence "function or variable". However, I think the old error message was misleading, because 'Undefined' does not have to be a function, but could indeed be a variable, and many (most) functions are defined for arbitrary input, seeing as there is no native way that I know of to define a function like y=f(uint32 x), so saying that a function is not defined for 'char' does not make sense.

As for your examples: Undefined('function','or','variable') returns Undefined function or variable 'Undefined'. (indeed, you could be indexing into the variable Undefined); the latter two examples give Function 'subsindex' is not defined for values of class 'cell'.

I agree, the new behavior makes more sense than the old one... I'm just surprised that they changed it. It makes this slightly outdated.

I don't have the new MATLAB version so I can't test it and create a screenshot myself. Feel free to add it as a separate answer if you like :)

Well, this is officially a popcon and it reduces a somewhat interesting error quine to the most basic one possible, so I won't post a new one. And yes, your Q&A should now include an 'up to' version number (although I don't feel like combing through the changelogs to see when they changed it).

NASM for x86: 45 bytes
e.asm:1: error: parser: instruction expected
Assemble (or attempt to assemble) with nasm e.asm
Just in case:
0:beau@beau-Latitude-E6330:[~/asm/q]$ nasm -v
NASM version 2.12.02 compiled on Feb  5 2017
0:beau@beau-Latitude-E6330:[~/asm/q]$

−3 B: The file name can be e.

Turing Machine Code, 70 bytes
Syntax error on line 1: <current symbol> should be a single character!

Try it online!

Husk, 39 bytes
Could not infer valid type for program

Try it online! The infamous error that everyone is familiar with. Interestingly, I had trouble finding any other error quines: Parse error (missing \): ¶ is nearly one in verbose mode, but it outputs Parse error (missing \): ): ¶¶.

Haha.. Use the error to generate the error.

Swift
This is a bit of a stretch. Bear with me.
The source MUST be encoded as UTF-16. Formatting the following as UTF-16:
swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
??^@s^@w^@i^@f^@t^@.^@s^@w^@i^@f^@t^@:^@1^@:^@1^@:^@ ^@e^@r^@r^@o^@r^@:^@^@i^@n^@p^@u^@t^@ ^@f^@i^@l^@e^@s^@ ^@m^@u^@s^@t^@ ^@b^@e^@\^@e^@n^@c^@o^@d^@e^@d^@ ^@a^@s^@ ^@U^@T^@F^@-^@8^@ ^@i^@n^@s^@t^@e^@a^@d^@ ^@o^@f^@ ^@U^@T^@F^@-^@1^@6^@

where ^@ is emacs-speak for an embedded NUL and the ? characters are genuine ASCII question marks. Outputting to console (cat doesn't work, being ignorant of UTF16):
$ iconv -f utf-16 swift.swift
swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
??swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16

and compiling:
$ swiftc swift.swift
We get:
swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16
??swift.swift:1:1: error: input files must be encoded as UTF-8 instead of UTF-16

As desired.
CAVEATS:

The terminal is taking the 16-bit header BOM \xFF\xFE in the error message from swiftc and degrading it as ASCII ?? in the console.
When the swift compiler is run in an Emacs shell, the terminal settings do not process the unprintable ASCII characters, instead rendering them in Octal.
When the source is rendered in an Emacs buffer, which is UTF-16 aware, the first line appears correctly, and the ?? appears correctly, and but the remaining characters are shown interspersed with NUL literals rendered as ^@.
cat in the Terminal doesn't work either, being unaware of UTF-16.
A UTF16-aware output utility is needed: iconv -f utf-16 swift.swift, where the terminal emulator subsequently discards the interspersed NUL characters on the second line.
In MacOS, swiftc leverages terminal capabilities to produce bold and color escape codes. To avoid this ambiguity, you can use export TERM=dumb.

I'm claiming it's a quine as long as the source is rendered with a UTF-16 aware output utility and a terminal that discards ANSI formatting, NULs, and degrades unprintable characters to ?.
USING TextEdit
You can also make a more visually convincing argument using ˛ˇ in place of ?? where you keep the input as UTF-16 and let Swift output the (invalid) UTF-8 output with swiftc swift.swift > out 2>&1 and open out in TextEdit. Side by side, the input and output indeed are rendered identically. No less dubious under the covers, but looks a lot less dubious.
So...when you say exactly identical, what exactly do you mean?
If the output must be re-usable as the input, the quine constraint is indeed violated. And if you argue it's OK to cycle the UTF8 compiler output back to UTF16 source, that seems promising, but doesn't work because the output of swiftc is neither valid UTF-8 nor UTF-16: it is not valid to embed the BOM header midstream in either encoding. It's just terminal poo. Having fun yet?
It's an interesting foray into encoding and terminals, at the least!

Agda, 95 bytes
After a few attempts, I finally found a solution in my favorite dependently typed language! Agda includes the full filename in place of error.agda on lines 1 & 2.
error.agda:3,1-1
error.agda:3,1: Parse error
)<ERROR>
<ERROR>
<ERROR>
<ERROR>
<ERROR...

Save file as error.agda and prepend the full filepath on those first two lines for a local answer, or here: Try it online!

TI-Basic, 24 bytes
ERR:SYNTAX
1:Quit
2:Goto

lowercase characters outside strings are a syntax error

Desmos, 41 bytes
Sorry, I don't understand the '?' symbol.

Try It On Desmos!
Hover over the danger sign to view the error message.
There could be something shorter but I don't have time to go through every single error out there in Desmos lol.

Desmos
Sorry, I don't understand the '&' symbol.

Go to desmos.com/calculator and paste in the "code".

Taxi
error: parse error: likely incomplete statement

Try it online!

Cobra
test.cobra(1): error: Expecting use, assembly, namespace, class, interface or enum, but got "test".
Compilation failed - 1 error, 0 warnings
Not running due to errors above.

C++
(Using Apple LLVM in Xcode)
Unknown type name 'Unknown'
Expected ';' after top level declarator

Loader (using the official Java interpreter):
These should be run from a module named main in order to produce the exact error messages given here.
This works in the most recent version of the interpreter:
Error: Could not evaluate expression Error (module main, line 1)

Explanation:
expression:statement is a conditional. The interpreter doesn't even syntax check the stuff to the right of the colon (if it did, we'd get a different error message) unless the stuff on the left evaluates to a nonzero value. However, as "Error" is an illegal expression, the interpreter can't evaluate it, exiting the program with this error message.
In some earlier interpreter versions, this would work instead:
Exception in thread "main" java.lang.RuntimeException: Could not evaluate expression Exception in thread "main" java.lang.RuntimeException (module main,line 1)
    at Loader.expr(Loader.java:183)
    at Loader.load(Loader.java:201)
    at Loader.main(Loader.java:249)

ChucK
Here's my contribution:
[chuck]:line(1).char(8): syntax error

This works if you first type it into the editor, save it as "chuck", and then run it once. If you run it another time the number in char() goes up by eight.
ChucK can be downloaded here.

CJam
Syntax error:
java.lang.RuntimeException: y not handled

http://codegolf.stackexchange.com/a/37367

Straw
/opt/straw/straw.rb:108:in `initialize': no implicit conversion of nil into String (TypeError)
    from /opt/straw/straw.rb:108:in `new'
    from /opt/straw/straw.rb:108:in `step'
    from /opt/straw/straw.rb:225:in `run'
    from /opt/straw/straw.rb:254:in `<main>'

Try It Online!

Works only if path to interpreter is /opt/straw/straw.rb. (Not that this answer is bad, just to let you know.)

Oh, and also, Try it online! also outputs the timings for the program run and the exit code.

JavaScript
Uncaught SyntaxError: Unexpected identifier

Throws a generic Unexpected identifier error (in Chrome, at least) because it doesn't recognize Uncaught as an identifier.

I presume that the exact text this generates is not in the standard. Could you please include the browser / JavaScript engine that this submission is "programmed" in?

It generates "SyntaxError: missing ; before statement" in Firefox.

Codelike, 36 Bytes
Error at (1,1): Unknown character: E

Try it!

Ada
test.adb:1:01: compilation unit expected

Really just make an ada file, toss it at the start as above and compile with gcc filename.adb -c.

ForceLang
Works in the latest version of the reference implementation as of the time this answer was written.
Exception in thread "main" lang.exceptions.IllegalInvocationException: Exception is not a function.
    at lang.ForceLang.parse(ForceLang.java:52)
    at lang.ForceLang.main(ForceLang.java:129)

Python 3.5
Note: the source file should be named "1" for this to work
  File "1", line 1
    File "1", line 1
    ^
IndentationError: unexpected indent

GW-BASIC (least: 12 bytes)
Syntax error

Inspired by the Commodore 64 BASIC answer. Knocked off 2 bytes because IBM and DOS are better than Commodore :P You can download an emulator for GW-BASIC.
NEXT without FOR

Since GW-BASIC is a line-based language, it only evaluates the first instruction after a newline or colon :. Therefore, it reads NEXT and automatically fails it didn't read a FOR.
Apple ][ BASIC (13 bytes)
?SYNTAX ERROR

Woo, 1 less byte than the Commodore answer because the old Apples could beat a Commodore anyday :P
QBasic (43 bytes)
Parse failed: Syntax error at 1:1: Token(:)

Might be cheating because it only works on the first line.
Applesoft BASIC (69 bytes)
ParseError: Syntax error: Expected line number or separator in line 0

Also only works on the first line...

sed
By using this general approach, I have converged on several sed error quines. This may not work in your sed, in which case, you're using the wrong sed, and therefore would you please acquire necessary, error-quining sed.
Try it online! This version works in TIO, and probably not anywhere else. Open the "Debug" panel to see the error.

Where sed is macOS's default sed, and gsed is a GNU sed.

Recursiva, 7 bytes
Error!

Try it online!

Ly
Error occurred at program index 3, instruction o (zero-indexed, includes comments)
EmptyStackError: cannot pop from an empty stack

Demo (using official compiler)
This program makes use of the o in "Error", the first instruction character in the error message that produces an error. (apparently r does nothing with an empty stack)
When a stack is not empty, o takes the top entry off the selected stack and outputs it as ASCII;
EmptyStackError occurs when the selected stack is empty. So when Ly runs into this o, it causes this error, since we haven't given the stack anything yet.

VB.Net, 32 Bytes
Create a new, empty project named 'A'. Set the startup object to "Sub Main" (it's a drop-down option). Create a new class called anything. Delete everything from the class and copy/paste the following:
'Sub Main' was not found in 'A'.

This works because a single quote is a comment, so it looks like a blank file :D

aw, couldn't get exact output on TIO

ESOPUNK, 38 bytes
Invalid instruction INVALID at line 0.

Wasn't this posted after the postdated language consensus was changed?

No idea, to be honest. I'm not exactly in the race for anything, though, so I'm not particularly worried.

K (ngn/k), 2 bytes
'c

Try it online!
'c is the response from the console indicating that the variable c is undefined

Apologies, I've edited, thought what I was getting was STDERR as I was operating in the console and saw the output replicated by oK in TiO

MiLambda
ERROR_NOHALT

Try it online!
Seems like a short solution

Turing Machine But Way Worse, 258 bytes
Traceback (most recent call last):
  File "/opt/tmbww/TuringMachineButWayWorse.py", line 16, in <module>
    i[0], i[2], i[3], i[5], i[6] =  int(i[0]), int(i[2]), int(i[3]), int(i[5]), int(i[6])
ValueError: invalid literal for int() with base 10: 'Traceback'

Try it online!

The rule about languages postdating the challenge has been abolished, you can compete all you want.

@ØrjanJohansen Oh, okay

ZSH (macOS), 20 bytes excluding newline
 zsh: bad pattern: ^[

all error messages should include this: : ^[

W.Y.A.L.H.E.I.N., 253 bytes
Traceback (most recent call last):
  File "/opt/wyalhein/whenyouaccidentallylose100endorsementsinnationstates.py", line 6, in <module>
    seed = int(contents[0])
ValueError: invalid literal for int() with base 10: 'Traceback (most recent call last):\n'

Try it online!
whenyouaccidentallyloseahundredendorsementsinnationstates expects a seed on the first line, and Traceback (most recent call last): is not a valid number (unless we're talking in base 96, of course, but whenyouaccidentallyloseahundredendorsementsinnationstates doesn't).

You kinda get screwed by the length of the language name huh?

@JoKing Yeah. It was even shortened on TIO because the name was too long

C (tcc), 42 bytes
.code.tio.c:1: error: declaration expected

Try it online!

MS SQL (Server version 2012), 64 bytes
Msg 2812, Level 16, State 62, Line 1
Incorrect syntax near '16'.

Julia 1.0 (Tio)
Implementation specific, but this  one is made to run in Tio.
ERROR: LoadError: UndefVarError: syntax: extra token "token" after end of expression
Stacktrace:
 [1] include at ./boot.jl:317 [inlined]
 [2] include_relative(::Module, ::String) at ./loading.jl:1038
 [3] include(::Module, ::String) at ./sysimg.jl:29
 [4] exec_options(::Base.JLOptions) at ./client.jl:229
 [5] _start() at ./client.jl:421
in expression starting at /home/runner/.code.tio:1

Try it online!

Brain-flak
Error at character 33: Unclosed '(' character.
Try it online!
Haskell
[1 of 1] Compiling Main             ( .code.tio.hs, .code.tio.o )

.code.tio.hs:1:4: error: parse error on input ‘of’
  |
1 | [1 of 1] Compiling Main             ( .code.tio.hs, .code.tio.o )
  |    ^^
/srv/wrappers/haskell: line 5: ./.bin.tio: No such file or directory

Try it online!
Stack Cats
Error: invalid character in source code, E | E ,edoc ecruos ni retcarahc dilavni :rorrE
Try it online!
Taxi
error: parse error: likely incomplete statement
Try it online!
Hexadecimal Stacking Pseudo-Assembly language
/opt/hspal/hspal.rb:69:in `run': Illegal opcode: 170  (RuntimeError)
    from /opt/hspal/hspal.rb:75:in `<main>'

Try it online!
Quarterstaff
Traceback (most recent call last):
  File "/opt/quarterstaff/quarterstaff.py", line 142, in <module>
    QuarterstaffInterpreter(open(parser.parse_args().program).read())
  File "/opt/quarterstaff/quarterstaff.py", line 7, in __init__
    self.run(self.parse(program), {}, 0)
  File "/opt/quarterstaff/quarterstaff.py", line 35, in parse
    raise Exception
Exception

Try it online!
Haxe
Main.hx:1: characters 0-4 : Unexpected Main
Uncaught exception - load.c(181) : Module not found : .bin.tio

Try it online!
Hasm
Error with instruction <internal{PARSE}> on line 0:
    Syntax error or illegal instruction: Error with instruction <internal{PARSE}> on line 0:
Dumping core:

STACK:

OFFSTACK:

HEAP:
    0

Try it online!
Mornington Crescent
Traceback (most recent call last):
  File "/opt/mornington-crescent/esoterpret.py", line 123, in <module>
    arguments.stdin, extra)
  File "/opt/mornington-crescent/esoterpret.py", line 41, in use_language
    while not(interpreter.has_execution_finished()):
  File "/opt/mornington-crescent/modules/morningtoncrescent/morningtoncrescent.py", line 50, in has_execution_finished
    raise RuntimeError("You have to end at Mornington Crescent.")
RuntimeError: You have to end at Mornington Crescent.

Try it online!
Muriel
*** ERROR: muriel: Unknown token '*'
Try it online!
Just picked some random esolangs from TIO and keyboard hashed until I got an error, then copy + pasted.

Phooey, 21 bytes
Unknown mode for '$'

Try it online!
Phooey ignores Unknown mode for ', then tries to parse $' which is an unknown mode for $.

Is the newline needed?

Fig, 1292 bytes (UTF-8)
DEBUG:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "x" is null
    at clojure.lang.Numbers.ops(Numbers.java:1068)
    at clojure.lang.Numbers.incP(Numbers.java:141)
    at fig.compression$fromBijectiveBase$fn__191.invoke(compression.clj:26)
    at clojure.core.protocols$fn__8181.invokeStatic(protocols.clj:168)
    at clojure.core.protocols$fn__8181.invoke(protocols.clj:124)
    at clojure.core.protocols$fn__8136$G__8131__8145.invoke(protocols.clj:19)
    at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
    at clojure.core.protocols$fn__8168.invokeStatic(protocols.clj:75)
    at clojure.core.protocols$fn__8168.invoke(protocols.clj:75)
    at clojure.core.protocols$fn__8110$G__8105__8123.invoke(protocols.clj:13)
    at clojure.core$reduce.invokeStatic(core.clj:6830)
    at fig.compression$fromBijectiveBase.invokeStatic(compression.clj:26)
    at fig.compression$decompress.invokeStatic(compression.clj:39)
    at fig.compression$decompress.invoke(compression.clj:35)
    at fig.compression$decompress.invokeStatic(compression.clj:36)
    at fig.parsing$lex.invokeStatic(parsing.clj:40)
    at fig.core$_main.invokeStatic(core.clj:38)
    at fig.core$_main.doInvoke(core.clj:19)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at fig.core.main(Unknown Source)

Try it online!
The tabs sadly disable Fig's scoring system, so this is counted in UTF-8/ASCII. Still no normal Fig quine...

not anymore :P

Knight (v2 + EVAL) (knight-lang.netlify.app implementation), 32 bytes
Error: Unknown identifier 'rror'

Try it online!
Different implementations handle errors differently (it is undefined behavior in the official specs), which is why I specified the implementation that I'm using.
Also, this technically only works in version 1.x because EVAL is removed as a required function in the v2 official specs, but this implementation has EVAL even though it is a v2 implementation, which is why I specified EVAL in the header just to be safe.
If EVAL wasn't implemented in this implementation, I think something like Error: No value could be parsed! would be a valid error quine instead (and it coincidentally turns out to also be 32 bytes).
Knight (v1.2) (C (gcc) implementation), 21 bytes
invalid character 'i'

Try it online!
Different implementation, different error messages :)

gpg (GnuPG) 2.2.40, 157 bytes
Note error is followed by a newline.
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: no valid OpenPGP data found.
gpg: processing message failed: Unknown system error

Usage in shell
I don't know if that source is REALLY a program source.
cat <<'X' >source
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: no valid OpenPGP data found.
gpg: processing message failed: Unknown system error
X
gpg <source >stdout 2>stderr
cat stdout
diff source stderr

ACCUMULATOR, 7 bytes
Invalid

Invalid is the only error in ACCUMULATOR. This is because I is not a function in ACCUMULATOR.

xidoc, 66 bytes
Error while rendering file
at 2:17-2:18 in []
Command not found:

xidoc, 135 bytes
Error while rendering file
at 3:26-3:26
Parse error: Unexpected ']'
3 │ Parse error: Unexpected ']'
  │                          ^

Try it (you need to paste in the code)

Python 3 (IDLE)
SyntaxError: incomplete input

This surprisingly outputs just itself and nothing else.

What Python version are you using? Python 1, 2, and 3 all throw a SyntaxError: invalid syntax here for me

It outputted this in the IDLE shell… try in python 3.8 prerelease or python 3.11 @emirps

the IDLE has different output than the python interpreter, but this answer can be an answer in “Python IDLE” if that is what it outputs

Can confirm I get "SyntaxError: invalid syntax" on 3.8 (pre-release) as well on TIO https://tio.run/##K6gsycjPM7YoKPr/P7gyrySxwrWoKL/ISiEzLzk/tyAntSQVyCwoLfn/HwA

It seems to work in IDLE, even on 3.11 though, so if you change your language to "Python 3 (IDLE)" this would be valid.

@mousetail done

MirBSD pax, 127 bytes.
Includes trailing newline:
pax: End of archive volume 1 reached
pax: Cannot identify format. Searching...
pax: Sorry, unable to determine archive format.

Usage
$ pax -f quine
pax: End of archive volume 1 reached
pax: Cannot identify format. Searching...
pax: Sorry, unable to determine archive format.
$ pax < quine
pax: End of archive volume 1 reached
pax: Cannot identify format. Searching...
pax: Sorry, unable to determine archive format.
$

(,) 38 Bytes
code must be surrounded by parentheses

Litterally the only possible one on my current interpreter

CJam, 12 bytes
u not handled

When operator doesn't exist, interpreter prints * not handled

http://codegolf.stackexchange.com/a/37367

Elixir
== Compilation error on file e.ex ==
** (SyntaxError) e.ex:3: keyword argument must be followed by space after: ex:
    (elixir) lib/kernel/parallel_compiler.ex:114: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

Put the code in e.ex and compile with elixirc e.ex. There are also some blank lines in the output (and in the file), but I can't get them to appear on here; S.O. eats them.

F#
e.fs(1,11): error FS0010: Unexpected symbol ':' in implementation file

Compile with fsc --nologo e.fs. Again, there's an extra blank line I can't properly reproduce here. (Without the --nologo flag the compiler wants to announce itself and its version number and display a Microsoft copyright message.)

Syms, 202 bytes
Traceback (most recent call last):
  File "/opt/syms/syms.py", line 196, in <module>
    stack.append(("{"+str(stack.pop())+"}").replace("\\","\\\\").replace("&","\\&"))
IndexError: pop from empty list

Try it online! Works on TIO. May not work on your configuration.

KSH script, 48 bytes
Save as a file named k.
k[1]: not: not found [No such file or directory]

Try it online! Note that TIO saves KSH scripts as .code.tio, so it's a bit longer but still the same thing.

k, oK
Might as well group these answers together, since it's supposedly the same language. I must say, this general approach is quite versatile.
oK
Every error seems to have a lot of environment-specific information, because, well, JavaScript is behind it all. Try it online!
/opt/ok/oK.js:876
    throw new Error("unexpected character '"+text[0]+"'");
    ^

Error: unexpected character ')'
    at Object.parse (/opt/ok/oK.js:876:8)
    at Object.<anonymous> (/opt/ok/repl.js:62:43)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)

k
Notice the space at the bottom. This works in 2016.06.28 (c) arthur whitney version of kmac.

a
^
value error

Python 3
  File ".py", line 1
    File ".py", line 1
    ^
IndentationError: unexpected indent

The file must be named ".py" for this to work.

ink, 65 bytes
ERROR: 'q' line 1: Empty diverts (->) are only valid on choices

Try it online!
Must be saved in a file called q, which is why the code on TIO is 7 bytes longer.

Snowman, 121 bytes
SnowmanException thrown at tokenize
  what():  at tokenize: letter operator terminated prematurely?
fatal error, aborting

Try it online!

33
Very simple. : isn't a valid command, so it's easy to make an unrecognised token error quine. The error is just where the : is in the code.
33 (1:8): Unrecognised token

GNU Smalltalk REPL
REPL is always acceptable, and I only learned the Smalltalk REPL and don't know how to save programs in a file. (I think TIO does not have Smalltalk yet.)
stdin:1: expected expression

This will work when you start the REPL for the first time.

Red 0.6.3
*** Error: not a Red program!

Newline included. Save as a .red file and run with red <filename>.red.

Pxem (pxemi.2.min.posixism), Filename: 14 bytes + Content: 0 bytes = 14 bytes.

Filename (has trailing LF!): .a B4 .[wxyz]
Content: empty.

Try it online!

PPL, 79 bytes
Reference error on line 3, column 3

  a()
  ^

The identifier a is not defined

I haven't implemented syntax checking properly, so only reference errors and type errors are thrown (plus syntax checking in rare cases). Pretty simple answer, frankly. Attempts to call the nonexisting a function (just a without the call does not work because my interpreter does not check for invalid expressions in some cases) I know my language is not very good but I'm too lazy to work on it.

Snap! (scratchblocks syntax)
Hmm...
a custom block definition is missing

JavaScript
Thought I would make an updated JS answer.
Firefox:

Uncaught SyntaxError: unexpected token: identifier

Google Chrome:

Uncaught SyntaxError: Unexpected identifier 'SyntaxError'

Applescript, 70 bytes
0:2: syntax error: A “:” can’t go after this identifier. (-2740)
Run with osascript -e "0:2: syntax error: A “:” can’t go after this identifier. (-2740)"

LOLCODE, 43 bytes
.code.tio:1: unknown token at: .code.tio:1:

Try it online!
Uiua, 95 bytes SBCS
Error: Unexpected token |
  at 1:25
1 | Error: Unexpected token |
                            ─

Try it online!

YASEPL
ERROR 5 no variable is loaded:(

located at :

very simple

Perl 5, 99 bytes code + 8 bytes file path, 107 bytes
File must be named >>;/\1/a to close off the <-- HERE ... <-- HERE and to reference the nonexistent group in a regex.
Link is to a Bash test suite.
Reference to nonexistent group in regex; marked by <-- HERE in m/\1 <-- HERE / at >>;/\1/a line 1.

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Horror Movie Search Party
Plot: Jimmy is missing; we have to find him. We should split up.
Plot twist: Jimmy is already dead.
But, our cast doesn't know that, so they need to search the whole area anyway. There is an N columns x M rows (1<=M,N<=256) grid of cells,
either marked as "S" for the starting point, "." for open space, or "#" for an obstacle. This is the map.
There are 0<=p<=26 costars, 0<=q<=26 extras, and 1 star. Everyone is initially in the cell marked S.
The Rules
Each person has a sight radius shown below:
 ...
.....
..@..
.....
 ...

The star is denoted by "@", the costars by capital letters, starting with "A", and the extras by lowercase letters, starting with "a". Initially, the sight radius surrounding the starting point is already marked as searched. If this constitutes the entire open space of the map, the game ends. Each turn, in the following order:

Each person simultaneously makes a king move (either standing still, or moving to one of the 8 neighboring cells).
All of the cells in the sight radius around each person are counted as searched.
If a costar cannot see anyone else, she dies. If an extra cannot see either a costar, the star, or at least 2 other extras, he dies. These happen simultaneously -- that is, there can be no chain reaction of deaths on a single turn; the above conditions are checked, and everyone who is going to die dies at once.
If all of the open space on the map has been searched, the search is over.

Notes
Multiple people can be on the same square at any point, and these people can see each other.
Obstacles never impede sight, only movement; people can see each other across the, er... lava?
The open spaces on the map are guaranteed to be connected by king moves.
The initial "S" is also considered to be open space, rather than an obstacle.
Any king move that lands on an open space is valid. For instance, the following move is legal:
....      ....
.@#. ---> ..#.
.#..      .#@.
....      ....

Input
The input will be in the format
N M p q
[N cols x M rows grid with characters ".", "#", and "S"]

Sample inputs:
6 5 0 0
......
......
..S...
......
......

and
9 9 1 1
S.......#
.......##
......##.
..#####..
...##....
...##....
...#.....
....#..#.
.........

p and q are the numbers of costars and extras, respectively.
Output
The output should be, for each turn, the moves that are made, with directions indicated by
789
456
123

The order of the moves does not matter, as they are all enacted simultaneously. Not listing a move for a person is fine, and is equivalent to moving him in direction 5. Moves should be listed in the following format:
@9 A2 a2 B7.

"." denotes the end of your moves for a turn.
After the map has been searched, the final line of output should be three integers, separated by spaces: the number of turns that it took you to finish searching the board, the number of living costars, and the number of living extras. For the first example input
6 5 0 0
......
......
..S...
......
......

the following is valid output:
@4.
@6.
@6.
@6.
4 0 0

A final note: the star cannot die and the open space on the map is guaranteed to be connected, so the search will always succeed eventually.
Scoring
Your score is the total number of turns taken over a set of benchmark tests; you're welcome to submit your own test case along with your answer. The sum of the number of living costars over the benchmark set will be used as a tie-breaker, and in the event there is still a tie, the sum of the number of living extras will be used.
Test Set and Controller
Currently, 5 maps are online at https://github.com/Tudwell/HorrorMovieSearchParty/. Anyone submitting an answer may also submit a test case, which I reserve the right to reject for any reason (if I reject your map for some reason, you may submit another). These will be added to the test set at my discretion.
A Python (tested in 2.7.5) controller is provided on github as
controller.py. A second controller there, controller_disp.py, is identical except that it shows graphical output during the search (requires Pygame library).

Usage:
python controller.py <map file> <your execution line>

I.e.:
python controller.py map1.txt python solver.py map1.txt

The controller has output (to your program's stdin) of the form
Turn 1
@:2,3 A:2,3 B:2,3.
##...##
#ooo..#
ooooo..
ooooo..
ooooo..
#ooo...
##.....
###....
----------------------------------------

This is the turn number (turn 1 is before you have moved), a '.'-terminated list of all the actors and their x,y coordinates (the upper left character is (0,0)), a representation of the entire board, and a line with 40 '-'s. It then waits for input (from your program's stdout) of the form
@9 A2 B7.

This is the output format specified above. The controller outputs a 'o' for open space that has been searched, '.' for open space that has not been searched, and '#' for obstacles. It includes only living people in its list of people and their coordinates, and tracks all rules of the game. The controller will exit if an illegal move is attempted. If the moves for a given turn finish the search, the output is not as above; instead it is of the form
Finished in 4 turns
4 1 0

"4 1 0" here denotes 4 total turns, 1 living costar, and 0 living extras. You do not need to use the controller; feel free to use it or modify it for your own entry. If you decide to use it and encounter problems, let me know.
Thanks to @githubphagocyte for helping me write the controller.
Edit:
For a randomized entry, you can choose any run on a particular map as your score for that map. Note that due to the scoring requirements, you should always choose the fewest turns, then the fewest dead costars, then the fewest dead extras for each map.

second line should be between spoilers tags!

Ruby, Safety First + BFS + Randomness, Score ≤ 1458
I'm not sure how you'll be scoring random submissions. If all answers have to be deterministic, let me know and I'll pick a seed or get rid of the randomness altogether.
Some features and shortcomings of this solution:

No one ever dies. At the start I group all the actors such that everyone is safe. The characters in each of these groups move in unison. That's good for keeping everyone alive but not optimally efficient.
Each of the groups searches for the nearest unexplored spot on the map via breadth-first search and takes the first move of that branch of the search. If there is tie between multiple  optimal moves a random one is picked. This is to ensure that not all groups always head in the same direction.
This program doesn't know about field-of-view. It actually tries to move to every unexplored cell. Taking this into account might considerably increase the performance, since then you could also quantify the quality of each move by how many cells it will uncover.
The program doesn't keep track of information between turns (except the actor groups). That makes it quite slow on the larger test cases. map5.txt takes between 1 and 13 minutes to complete.

Some results
Map     Min turns    Max turns
map1        46           86
map2        49          104
map3       332          417
map4       485          693
map5       546          887

Now here is the code:
start = Time.now

map_file = ARGV.shift
w=h=p=q=0
File::open(map_file, 'r') do |file|
    w,h,p,q = file.gets.split.map(&:to_i)
end

costars = p > 0 ? (1..p).map {|i| (i+64).chr} : []
extras = q > 0 ? (1..q).map {|i| (i+96).chr} : []
groups = []

costars.zip(extras).each do |costar, extra|
    break unless extra
    groups << (costar + extra)
    costars.delete(costar)
    extras.delete(extra)
end

costars.each_slice(2) {|c1, c2| groups << (c1 + (c2 || '@'))} unless costars.empty?
extras.each_slice(3) {|c1, c2, c3| groups << (c1 + (c2 || '') + (c3 || '@'))} unless extras.empty?
groups << '@' unless groups.join['@']

#$stderr.puts groups.inspect

directions = {
    1 => [-1, 1],
    2 => [ 0, 1],
    3 => [ 1, 1],
    4 => [-1, 0],
    5 => [ 0, 0],
    6 => [ 1, 0],
    7 => [-1,-1],
    8 => [ 0,-1],
    9 => [ 1,-1]
}

loop do
    break unless gets # slurp turn number
    coords = {}
    input = gets
    input.chop.chop.split.each{|s| actor, c = s.split(':'); coords[actor] = c.split(',').map(&:to_i)}
    #$stderr.puts input
    #$stderr.puts coords.inspect
    map = []
    h.times { map << gets.chomp }

    gets # slurp separator
    moves = groups.map do |group|
        x, y = coords[group[0]]
        distances = {[x,y] => 0}
        first_moves = {[x,y] => nil}
        nearest_goal = Float::INFINITY
        best_move = []
        active = [[x,y]]
        while !active.empty?
            coord = active.shift
            dist = distances[coord]
            first_move = first_moves[coord]
            next if dist >= nearest_goal
            [1,2,3,4,6,7,8,9].each do |move|
                dx, dy = directions[move]
                x, y = coord
                x += dx
                y += dy
                next if x < 0 || x >= w || y < 0 || y >= h || map[y][x] == '#'
                new_coord = [x,y]
                if !distances[new_coord]
                    distances[new_coord] = dist + 1
                    first_moves[new_coord] = first_move || move
                    active << new_coord if map[y][x] == 'o'
                end

                if dist < distances[new_coord]
                    distances[new_coord] = dist + 1
                    first_moves[new_coord] = first_move || move
                end

                if map[y][x] == '.'
                    if dist + 1 < nearest_goal
                        nearest_goal = dist + 1
                        best_move = [first_moves[new_coord]]
                    elsif dist + 1 == nearest_goal
                        best_move << first_moves[new_coord]
                    end
                end
            end
        end

        #if group['@']
        #    distances.each{|k,v|x,y=k;map[y][x]=(v%36).to_s(36)}
        #    $stderr.puts map
        #end

        dir = best_move.sample
        group.chars.map {|actor| actor + dir.to_s}
    end * ' '
    #$stderr.puts moves
    puts moves
    $stdout.flush
end

#$stderr.puts(Time.now - start)

There are a few commented out debug outputs in there. Especially the if group['@'] block is quite interesting because it prints out a visualisation of the BFS data.
Edit: Significant speed improvement, by stopping the BFS if a better move has already been found (which was kinda the point of using BFS in the first place).

is it safe to expect that your entry will always have access to the map file?

Yes; the map file is always there, and if you use the controller, you get an updated copy of it each turn.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
In what base this string equals the following decimal value?
your task is...
Given a string x and a positive integer y, to determine whether there is a positive integer b and an injective mapping from the distinct characters in x to the digits of base b which permit us to interpret x as an integer equal to y.
details:
   If there is more than one base which works, you don't have to output all of them, just one.
   The answer should be a function for those languages that support it, otherwise, code snippet
   Your program should accept 0-9 and (a-z or A-Z) which are 36 characters. You don't have to care about kanji or snowman.
   (e.g. 6 doesn't have to mean 6, it's just a symbol. basically you get a number in unknown base with unknown symbols and you have to substitute them to get y)
for example:
   (foo,4) returns either 2 or 3 because

   f=1, o=0 -> 1002=410
   f=0, o=1 -> 0113=410

   (10,10) any integer greater than 4 but not 9 because

   1=2, 0=0 -> 205=1010
   1=1, 0=4 -> 146=1010
   1=1, 0=3 -> 137=1010
   1=1, 0=2 -> 128=1010
   1=1, 0=0 -> 1010=1010
   1=0, 0=10 -> 0111=1010
   above base 10, 1=0, 0=10 -> 01x=1010 for every x > 10

   (611,1) returns 0 which means there is no possible base for 611 meaning 110
bonus:
   You have to output every possible base, not just one. I know it can be infinite,
   indicate it somehow. 2,3,... for example.
   Answers with bonus gain a 0.7 multiplier.

How can the number of bases be infinite, if we're only using 62 characters to represent digits? More importantly, how many characters is the bonus worth? Also it's slightly misleading that your example use the bonus output and not that of the core challenge.

because in the (10,10) example 1=0,0=10 applies for base 1000 too. 01000^1+101000^0=10 etc. i try to make it clear.

So for the infinitely large bases it's just that we can only use 62 of the available digits?

I find this to be a really clear question. I understand completely the concept of an infinite selection of bases.

Sorry but 9 was not valid. Changing back.

Mathematica, 183 bytes * 0.7 = 128.1
f[s_,n_]:=(For[i=2,1>0,++i,d=(l=Length)@(g=IntegerDigits)[n,i];Which[Count[c=Characters@s,c[[-1]]]>1&&d==1,Return@0,l@c>=d&&And@@Unequal@@@(t=Thread)@Union@t@{g[n,i,l@c],c},Print@i]])

Less golf
f[s_, n_] := (
  For[i = 2, 1 > 0, ++i,
   d = (l = Length)@(g = IntegerDigits)[n, i];
   Which[
    Count[c = Characters@s, c[[-1]]] > 1 && d == 1,
    Return@0,
    l@c >= d && And @@
      Unequal @@@
       (t = Thread)@
        Union@
         t@
          {g[n, i, l@c], c},
    Print@i
    ]
   ]
  )

I don't actually recommend running this, because quick and infinite output is a bit tricky to abort in Mathematica sometimes. To get only the first result, change Print to Result (which is even a character longer). If you're using the version as is, a final 0 output will indicate that no further bases will be found (similar to the returning case).
The first part of the Which simply aborts the loop when no base can possibly be found (it might be possible to shorten this). The second loop is the interesting check. These are the steps taken:

Convert n to digits in the current base (Mathematica can handle arbitrarily large bases.)
Zip those digits up with the characters, basically creating the mapping at each position.
Union throws out duplicates - these are uninteresting because they just point to a consistent mapping.
Transpose the mapping, so I get a list of digits and a list of characters.
If there are no duplicates in either, we have an injective mapping and print the base.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Codegolf: Quine and Antiquine
This challenge is similar to Can you Meta Quine?
A quine is a program that produces itself on STDOUT. This challenge is to produce a program A which when run produces a program B on STDOUT. Program B when run produces program A on STDOUT. Programs A and B must be written in (and run in) the same language. The linked question constrained A != B. That looked too easy. So for this question, we insist A and B are antiquines, using the following rules:

Programs A and B may not use any of the same characters, save for whitespace and statement separators, and punctuation characters.
Programs A and B must each contain at least one character that is neither whitespace nor a statement separator, nor a punctuation character.
For the purpose of rules 1 and 2, the term 'whitespace' excludes any symbol or sequence of symbols which itself is a statement, operator or symbol that is interpreted (as opposed to a separator). Therefore in the Whitespace language, there is no whitespace.
A statement separator is a syntactic element conventionally used within the language to separate statements. This would include the newline in python, or the semicolon in Java, perl or C.
A punctuation character is an ASCII character which is neither whitespace nor in the POSIX word character class (i.e. an underscore is not punctuation for this purpose) - i.e ispunct() would return true, and it's not _.
Program A when run must produce a program (Program B) on its STDOUT, which when run in turn produces Program A.
Programs A and B must be in the same programming language.
The programming language used must actually be a programming language. Unless you make a good case otherwise, I'll suggest it must be Turing complete.
At least one of A and B must execute at least one statement within the language.

This is code golf, so the shortest answer wins, the score being the length of program A in bytes (i.e. the length of program B is not relevant).

Can you please add "punctuation" to the list of exceptions in the first clause? It's impossible to solve this task in many languages (especially those that require you to you curly braces in the main function) otherwise.

related but probably sufficiently different.

@FUZxxl I've permitted punctuation marks but excluded underscores.

So just to make sure: Things like ' and " are allowed to appear in both programs, correct?

@IngoBürk, yes, thinks like ' and " can appear in both programs (per the exception at the end of rule 1). However there must be something that appears in each program that is NOT a punctuation mark, a whitespace character or a statement separator. IE you can't just produce a single quine made of punctuation marks, and say it is both A and B.

Can you use space/tab in python? It's part of the statement separator, just not always.

Your definition of whitespace is wrong. print("Hello, World!") is not the same as pri nt("Hello, World!").

I guess Python is out. Can't imagine any of A or B not having a print command, causing both programs containing these 5 characters. (sys.stdout.write contains r, i and t as well.)

@isaacg you can use whitespace in any language (including Python), but there must also be non-whitespace characters.

@Doorknob thanks - I've clarified that.

For the purposes here, are A and a considered different "characters"?

It would be better if you provided a complete list of ASCII characters that match rule 5.

So, if A has 'class', B would have to use 'CLASS'?

@Ourous: If A has 'class', B would have to have something other than class; CLASS is but one option.

@aditsu: the POSIX word character class consists of the letters a-Z, A-Z, the numbers 0-9 and underscore (_).

@abligh that's not what I asked..

@aditsu I've made the rule rather simpler (similar to the definition of ispunct()).

GolfScript, 13 bytes
1{\~\".~"}.~

The output is
-2{\~\".~"}.~

which generates the initial program.
The byte count include the trailing LF, since the output of the output will contain it.
Try it online.
How it works
1       # Push 1.
{       # Start code block.
  \~\   # Apply logical NOT to the second topmost element of the stack.
  ".~"  # Push that string.
}       # End code block.
.~      # Duplicate the code block and execute the copy.

GolfScript prints the stack's contents upon termination.

Please read the problem statement again - Programs A and B may not use any of the same characters, save for whitespace and statement separators, and punctuation characters.

Everything but 1 and 2 is punctuation.

OK, the rules were changed since I last read them.

Yup, that works. I'd phrased the rules to prevent whitespace being used as statements, but forgot the same loophole would be present for punctuation. So loophole legally exploited.

Pascal (731 characters)
Program A:
program s;{$h+}uses sysutils;const p='program s;{$h+}uses sysutils;const p=';a='a';aa=''';';aaa='a=''';aaaa='''';aaaaa='begin write(lowercase(p+aaaa+p+aa+aaa+a+aa+a+aaa+aaaa+aa+aa+a+a+aaa+aaa+aaaa+aa+a+a+a+aaa+aaaa+aaaa+aa+a+a+a+a+aaa+stringreplace(stringreplace(stringreplace(stringreplace(aaaaa,aaaa,aaaa+aaaa,[rfreplaceall]),''lower''+''c'',''tm''+''p'',[]),''up''+''c'',''lower''+''c'',[]),''tm''+''p'',''up''+''c'',[])+aa+aaaaa))end.';begin write(upcase(p+aaaa+p+aa+aaa+a+aa+a+aaa+aaaa+aa+aa+a+a+aaa+aaa+aaaa+aa+a+a+a+aaa+aaaa+aaaa+aa+a+a+a+a+aaa+stringreplace(stringreplace(stringreplace(stringreplace(aaaaa,aaaa,aaaa+aaaa,[rfreplaceall]),'lower'+'c','tm'+'p',[]),'up'+'c','lower'+'c',[]),'tm'+'p','up'+'c',[])+aa+aaaaa))end.

Outputs program B:
PROGRAM S;{$H+}USES SYSUTILS;CONST P='PROGRAM S;{$H+}USES SYSUTILS;CONST P=';A='A';AA=''';';AAA='A=''';AAAA='''';AAAAA='BEGIN WRITE(UPCASE(P+AAAA+P+AA+AAA+A+AA+A+AAA+AAAA+AA+AA+A+A+AAA+AAA+AAAA+AA+A+A+A+AAA+AAAA+AAAA+AA+A+A+A+A+AAA+STRINGREPLACE(STRINGREPLACE(STRINGREPLACE(STRINGREPLACE(AAAAA,AAAA,AAAA+AAAA,[RFREPLACEALL]),''LOWER''+''C'',''TM''+''P'',[]),''UP''+''C'',''LOWER''+''C'',[]),''TM''+''P'',''UP''+''C'',[])+AA+AAAAA))END.';BEGIN WRITE(LOWERCASE(P+AAAA+P+AA+AAA+A+AA+A+AAA+AAAA+AA+AA+A+A+AAA+AAA+AAAA+AA+A+A+A+AAA+AAAA+AAAA+AA+A+A+A+A+AAA+STRINGREPLACE(STRINGREPLACE(STRINGREPLACE(STRINGREPLACE(AAAAA,AAAA,AAAA+AAAA,[RFREPLACEALL]),'LOWER'+'C','TM'+'P',[]),'UP'+'C','LOWER'+'C',[]),'TM'+'P','UP'+'C',[])+AA+AAAAA))END.

Outputs program A.

I am enjoying the (mis)use of case translation.

ROT13 (not competing anymore after rule update)
Not sure if this counts as a language, but I certainly didn't make it up for the challenge. Usually answers for certain utilities such as sed are accepted as well. However, it's a judgement call, so if it doesn't count I'll remove it (is there a meta discussion somewhere on what counts as a language? Edit: There is now)
A

Cycles between A and N:
~>> echo "A" | rot13
N
~>> echo "A" | rot13 | rot13
A

I think this doesn't work, as rot13 is simply taking input on STDIN, not executing a program. If you are arguing that it is a zero length program, that fails to satisfy rule 2. The program (with sed) is what's passed in sed -e. If this was acceptable, then cat would be a quine, and tac would be a quine and antiquine. However, nothing is producing the source to cat, tac or for that matter rot13.

@abligh If rot13 is the language used, why should I have to print the source code for rot13? Also, if I run Golfscript, Python or anything else, I will likely just pass the source code to it via stdin or file, so there isn't really any difference. In this case rot13 is the interpreter.

rot13 as a programming language does not appear to satisfy any reasonable definition of 'programming language', and it's not interpreting anything. I will amend the question to make that clearer.

Fine with me. I'll leave this answer as not competing anymore and start a meta discussion. Nice challenge, by the way. Can't wait to see "real" solutions!