Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[defect]: mongo queries.conf[217]: Parse error: Unterminated string #5301

Closed
craftycram opened this issue Mar 4, 2024 · 11 comments
Closed
Labels
defect category: a defect or misbehaviour

Comments

@craftycram
Copy link

What type of defect/bug is this?

Unexpected behaviour (obvious or verified by project member)

How can the issue be reproduced?

  • enable the sql mod
  • set dialect to mongo
  • set driver to rlm_sql_mongo
  • set server to mongo connect url

Log output from the FreeRADIUS daemon

2024-03-04T15:04:03.956296656Z FreeRADIUS Version 3.2.3
2024-03-04T15:04:03.956322337Z Copyright (C) 1999-2022 The FreeRADIUS server project and contributors
2024-03-04T15:04:03.956326087Z There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
2024-03-04T15:04:03.956335117Z PARTICULAR PURPOSE
2024-03-04T15:04:03.956338047Z You may redistribute copies of FreeRADIUS under the terms of the
2024-03-04T15:04:03.956340997Z GNU General Public License
2024-03-04T15:04:03.956343777Z For more information about these matters, see the file named COPYRIGHT
2024-03-04T15:04:03.957026656Z Starting - reading configuration files ...
2024-03-04T15:04:03.957035016Z including dictionary file /usr/share/freeradius/dictionary
2024-03-04T15:04:03.967323698Z including dictionary file /usr/share/freeradius/dictionary.dhcp
2024-03-04T15:04:03.967353008Z including dictionary file /usr/share/freeradius/dictionary.vqp
2024-03-04T15:04:03.967365959Z including dictionary file /etc/freeradius/dictionary
2024-03-04T15:04:03.967386259Z including configuration file /etc/freeradius/radiusd.conf
2024-03-04T15:04:03.967456930Z including configuration file /etc/freeradius/proxy.conf
2024-03-04T15:04:03.967523311Z including configuration file /etc/freeradius/clients.conf
2024-03-04T15:04:03.967565811Z including files in directory /etc/freeradius/mods-enabled/
2024-03-04T15:04:03.967590742Z including configuration file /etc/freeradius/mods-enabled/detail
2024-03-04T15:04:03.967613202Z including configuration file /etc/freeradius/mods-enabled/eap
2024-03-04T15:04:03.967703953Z including configuration file /etc/freeradius/mods-enabled/realm
2024-03-04T15:04:03.967730633Z including configuration file /etc/freeradius/mods-enabled/totp
2024-03-04T15:04:03.967742413Z including configuration file /etc/freeradius/mods-enabled/digest
2024-03-04T15:04:03.967755944Z including configuration file /etc/freeradius/mods-enabled/ntlm_auth
2024-03-04T15:04:03.967766644Z including configuration file /etc/freeradius/mods-enabled/replicate
2024-03-04T15:04:03.967781014Z including configuration file /etc/freeradius/mods-enabled/echo
2024-03-04T15:04:03.967797724Z including configuration file /etc/freeradius/mods-enabled/detail.log
2024-03-04T15:04:03.967822415Z including configuration file /etc/freeradius/mods-enabled/attr_filter
2024-03-04T15:04:03.967847955Z including configuration file /etc/freeradius/mods-enabled/always
2024-03-04T15:04:03.967873735Z including configuration file /etc/freeradius/mods-enabled/utf8
2024-03-04T15:04:03.967884415Z including configuration file /etc/freeradius/mods-enabled/exec
2024-03-04T15:04:03.967899936Z including configuration file /etc/freeradius/mods-enabled/expr
2024-03-04T15:04:03.967917606Z including configuration file /etc/freeradius/mods-enabled/expiration
2024-03-04T15:04:03.967929606Z including configuration file /etc/freeradius/mods-enabled/date
2024-03-04T15:04:03.967941636Z including configuration file /etc/freeradius/mods-enabled/dynamic_clients
2024-03-04T15:04:03.967955496Z including configuration file /etc/freeradius/mods-enabled/preprocess
2024-03-04T15:04:03.967972506Z including configuration file /etc/freeradius/mods-enabled/radutmp
2024-03-04T15:04:03.968006577Z including configuration file /etc/freeradius/mods-enabled/sradutmp
2024-03-04T15:04:03.968013247Z including configuration file /etc/freeradius/mods-enabled/mschap
2024-03-04T15:04:03.968040937Z including configuration file /etc/freeradius/mods-enabled/sql
2024-03-04T15:04:03.968104308Z including configuration file /etc/freeradius/mods-config/sql/main/mongo/queries.conf
2024-03-04T15:04:03.968147919Z /etc/freeradius/mods-config/sql/main/mongo/queries.conf[217]: Parse error: Unterminated string
2024-03-04T15:04:03.968154689Z Errors reading or parsing /etc/freeradius/radiusd.conf

Relevant log output from client utilities

No response

Backtrace from LLDB or GDB

No response

@craftycram craftycram added the defect category: a defect or misbehaviour label Mar 4, 2024
@alandekok
Copy link
Member

Already fixed in 8221f70

@craftycram
Copy link
Author

any docker release planned soon? seems like the newest release is older than the fix

@craftycram
Copy link
Author

update @alandekok:
just replaced the queries.conf with the one from your linked fix. still getting the same error.

@alandekok
Copy link
Member

If it gets exactly the same error, then I suspect that you didn't update the correct file. The new version has fixed the issue you're seeing.

What is on line 217 of the file? i.e. when the error message says:

024-03-04T15:04:03.968147919Z /etc/freeradius/mods-config/sql/main/mongo/queries.conf[217]: Parse error: Unterminated string

What is the contents of the file at that line?

@alandekok alandekok reopened this Mar 4, 2024
@craftycram
Copy link
Author

217 interestingly is just a closing brace.

grafik

I validated that it's using the new version I got from here

alandekok added a commit that referenced this issue Mar 4, 2024
alandekok added a commit that referenced this issue Mar 4, 2024
@craftycram
Copy link
Author

That seemed to work, but I think my installation is still missing something.

Could not link driver rlm_sql_mongo: /usr/lib/freeradius/rlm_sql_mongo.so: cannot open shared object file: No such file or directory 
Make sure it (and all its dependent libraries!) are in the search path of your system's ld
/etc/freeradius/mods-enabled/sql[27]: Instantiation failed for module "sql"

I guess I'm doing something wrong?

@alandekok
Copy link
Member

The mongo drivers are not built by default. You'll have to do that from source, unfortunately.

@craftycram
Copy link
Author

alright thanks

@craftycram
Copy link
Author

could you maybe give me another hint on how to setup users with mongo?

grafik

i tried like this, but none of my tries did work

@alandekok
Copy link
Member

The first object should work. The second one definitely won't.

To be honest, this functionality is largely experimental, which is why it isn't in the default packages. If it works, great. If not, please help by contributing fixes, documentation, etc.

@craftycram
Copy link
Author

alright thanks that what i was thinking. then i'll just stick with postgress probably.
thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect category: a defect or misbehaviour
Projects
None yet
Development

No branches or pull requests

2 participants