Getting MIB compile error: Sequence and Row should have related names - snmp

On an MIB I have written I am getting the error
Warning 10 : Sequence "XxxSequence" and Row "xxxEntry" should have related names
smilint is not giving any errors and net-snmp does not seem to care either.
Does anyone have a hint on what this error means, or how to correct it?

The reason I was have trouble here is that it seems you have to have the SEQUENCE entry after the OBJECT-TYPE entry.
xxxEntry OBJECT-TYPE
SYNTAX XxxEntry
...
XxxEntry ::= SEQUENCE {
...
}
If you don't have them in the order then smilint will give you a Only differ by case warning.
smilint does not seem to care about the related names warning.

Related

What does this FreeType2 error code mean?

Using FreeType2, I'm calling FT_Load_Glyph, and getting a return value of 0xFFFFFFFF. According to https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_load_glyph, a non-zero value means an error.
However, this error isn't listed at https://www.freetype.org/freetype2/docs/reference/ft2-error_code_values.html. Can anyone explain to me what this error code means?
I asked this question over at https://gitlab.freedesktop.org/freetype/freetype/-/issues/1063#note_955441, and was told that it is invalid offset (11040).

Unexpected token in Mocha/Chai

This is something I've wondered about for some time now, but only recently am I stuck on this. I am getting this error below when running my test in Mocha:
What does the (14:58) mean? I'm assuming it's the location of the syntax error, but how exactly do I read this in order to locate the error (for future reference)?
Thanks.
It means that node found something it couldn't handle at line 14, column 58 in core.spec.js. Note that the actual error that causes this could be located before this point if your syntax has logical errors.
Example:
if(foo === bar){
console.log('foo equals bar')}
} else { // <-- Unexpected token 'else', but error is on previous line
console.log('nope');
}
would trigger an error on line 3, column 3. But the actual error is the accidental extra ending curly bracket.
(But please, don't post images of code and terminal output. Text will do very well.)

Vim & Syntastic: Sorting Errors before Warnings in the location list

I've found that some warnings can be affected by the presence of a syntax error.
Remove the error and, hey presto, the warning disappears or changes.
So as to not waste time dealing with fake warnings, I want to deal with the errors first, meaning that they would need to appear first in vim's location list.
Syntastic can sort, but :help syntastic-config-sort says it's by line number, then by type, then by column number. The only other option is to display in the order displayed by the generating compiler/checker... which is not configurable.
I know that I could do something like:
let g:syntastic_ruby_checkers=['errors-only', 'warnings-and-errors']
but that would further slow down the already slow-ish checking process in the general case where there are warnings but no errors.
Any way to get errors before warnings?
Or a work-around?
For instance, is there any way to run errors-only if an error is detected in the warnings-and-errors checker?
Or is there a way to: let g:syntastic_quiet_messages = { "level" : "warnings" } only if the list is empty for "level" : "errors"?
My work-around for fixing errors before warnings is to populate the location list with the errors first, followed by the warnings:
let g:syntastic_ruby_checkers=['mri', 'rubocop']
If I save after fixing errors, then any fake warnings disappear.

ORA - 00935: missing expression

This is my code:
select max(vhis_data.C0432_SAMPL_VALUE1_R), vhis_data.C0401_aid
from vhis_data, T0401_accounts
where vhis_data.C0401_aid = T0401_accounts.C0401_aid
and (
vhis_data.c0401_aid between 1179 and 1291 or
vhis_data.c0401_aid between 1382 and 1402 or
vhis_data.c0401_aid between 1462 and 1620 or
# and so on until...
vhis_data.c0401_aid between 5450 and 5485 or
vhis_data.c0401_aid between 5503 and 5495 or
)
(these numbers represent various points in the system)
The program displayed an error:
vhis_data.c0401_aid between 1179 and 1291 or
*
ERROR at line 5:
ORA-00936: missing expression
What I've noticed is that the first part of the error references the first line in the
and ( ... ) part of my code.
I have also noticed that there is an extra or on the last line of my code. I can take it out, but is this extra or the only reason that the whole and (...) part does not work? Or is there another reason that my code is not working?
(I guess a sub-question of mine, then, is, if there is a missing expression, where does the code stop executing properly?)
For example, here, the missing expression is potentially the last line (because it is expecting something after the "or"). However, the code does not even go through the first line of the and (...) part of the code.
I have combed the net for explanations dealing with the error ORA-00936: missing expression but have not found anything relevant enough to help me in this particular situation.
I welcome any criticism or advice you may have, and thank you so much in advance for any contributions that you give me!
you should not end the whole thing with an or
5495 or
)
this makes the entire parenthetical phrase invalid - everything in the ()... so thats why the line number is flagged up top.
Could this extra or be the only reason that the whole and (...) part does not work?
It's the reason the whole query does not work.
A SQL query does not "execute" in order like a string of commands. The entire query is compiled, a plan built, and the plan executed. For that reason any syntax errors are often shown to point to lines that do not have the actual error.
So the "code" does not "execute" at all. The compilation fails, so there's nothing to execute.

net-snmp: force table to have xxEntry value of 2 instead of 1

Using net-snmp, table code generated by mib2c -c mib2c.iterate.conf fooBarTable and then heavily hacked.
Unfortunately the table is defined with an Entry of 2 instead of the normal 1. (I didn't do this, I'm trying to make this fit into an existing situation.) The MIB looks something like this:
fooBarTable OBJECT-TYPE
SYNTAX SEQUENCE OF FooBarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "blah"
::= { fooMIBObjects 8 }
fooBarEntry OBJECT-TYPE
SYNTAX FooBarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Stuff."
INDEX { ifIndex }
::= { fooBarTable 2 }
When you register the table with net-snmp, you just give it an OID like "...,1,8" (i.e. up to fooBarTable, but not including the Entry). Net-snmp implicitly tacks the .1 to the table OID and then columns, indices, etc.
Is there a semi-supported way to force that entry value to 2? (I.e. without resorting to hacking the bits out of the objects that are passed in to the handler.)
No, sorry: there is no supported way to do that. In part because the MIB you're staring at is not legal under SMIv2.
To implement it, you'd either need to change multiple spots in the agent/helper directory (starting near line 328 of table.c and probably other places) or implement a table entirely from scratch without using the helper modules at all.
But nothing mib2c gives you will solve this for you.

Resources