[Home]

Summary:ASTERISK-29499: sip_to_pjsql.py: Fails to write SQL file
Reporter:Daniel (Bucky101)Labels:
Date Opened:2021-06-29 02:01:03Date Closed:2021-07-15 12:00:03
Priority:MinorRegression?
Status:Closed/CompleteComponents:Contrib/General
Versions:18.3.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 18.04.5 LTS - VMWare esxi 6.7Attachments:( 0) pjsip.conf
( 1) pjsip.sql
( 2) sip.conf
( 3) sqlconfigparser_moredebug.py
Description:when attempting to upgrade to pjsip via sip_to_pjsql.py
I get the below error

Please, report any issue at:
   https://issues.asterisk.org/
Reading sip.conf
Converting to PJSIP realtime sql...
Writing pjsip.sql
Traceback (most recent call last):
 File "/tmp/pjsipnew/sip_to_pjsql.py", line 79, in <module>
   write_pjsip(pjsip_filename, pjsip, non_mappings)
 File "/tmp/pjsipnew/sip_to_pjsql.py", line 17, in write_pjsip
   pjsip.write(fp)
 File "/tmp/pjsipnew/sqlconfigparser.py", line 72, in write
   print("Could not open file " + config_file + " for writing")
TypeError: cannot concatenate 'str' and 'file' objects
Comments:By: Asterisk Team (asteriskteam) 2021-06-29 02:01:03.671-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Benjamin Keith Ford (bford) 2021-06-29 10:57:51.366-0500

After looking at the converter script, there are several things that could have gone wrong. Unfortunately there isn't any logging in that area.

One thing to check is making sure permissions are correct for the user and file you are trying to convert. If that doesn't work, do you mind attaching your sip.conf so we can run some tests? If there is information in there that you don't want publicly visible, you can email it directly to asteriskteam@digium.com.

Can you post the exact command you are running on the terminal? Although I doubt it, it could be an argument parsing issue.

By: Daniel (Bucky101) 2021-06-29 18:35:01.289-0500

Hey Benjamin, I tried putting the sip.conf file in /tmp/pjsip and also did chmod -R 777 /tmp/pjsip but no difference. I am logged in as su when running the script but same result
It does actually create a .sql file as per attached, but the .py program still stops.

sip_to_pjsip.py works fine as attached pjsip.conf

By: Benjamin Keith Ford (bford) 2021-07-01 10:37:03.085-0500

I've attached a modified version of {{sqlconfigparser.py}} that should tell us what kind of error we are running into. Can you try replacing the current file with the attached one (name the attached one the same as the original - {{sqlconfigparser.py}}) and running the script again?

By: Asterisk Team (asteriskteam) 2021-07-15 12:00:03.008-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines