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

Is finsql Command=generatesymbolreference still working? #930

Closed
janhofmann24 opened this issue Nov 14, 2017 · 8 comments
Closed

Is finsql Command=generatesymbolreference still working? #930

janhofmann24 opened this issue Nov 14, 2017 · 8 comments
Labels
input-needed investigate The issue requires further investigation to determine if this is a product bug

Comments

@janhofmann24
Copy link

I started the generation of symbols for a custom DB 22 hours ago this way:

.\finsql.exe Command=generatesymbolreference,Database=****, ServerName="NAVSERVER\SQLEXPRESS", logfile="C:\demo\log.txt"

The process is still running, a logfile has not been created, I still cannot download the symbols in VS Code.
It is mentioned (https://msdn.microsoft.com/en-us/dynamics-nav/developer/devenv-running-cside-and-al-side-by-side) that it is a lengthy operation, but I didn't expect it to last a day. My rough idea would have been a duration similar to a full compile.

How can I find out, if it is still actually doing something or is stuck? What is to be expected as a runtime for a lengthy operation?

@kalberes
Copy link
Contributor

Normally it takes a a compilation time. I guess you won't get symbols from your objects unless you find which object ( I am guessing some .net object) is killing symbol generation.
Do you maybe have any information in the server event log? Or in the log file if you stop the process.

@janhofmann24
Copy link
Author

Unfortunately there is nothing in the Event Log. Also a Log file is not created, if i stop the process.

I'll pursue the hint with the .net objects. Hope I can find it

@kalberes
Copy link
Contributor

One more thing the command above accepts filters as for any other C/SIDE commands. Maybe that could help nailing down which is the object that causes it. Example try generating tables, pages, codeunits. etc separately. See where does it deadlock.

@kalberes
Copy link
Contributor

If nothing works and you still have not given up having symbols, here are the manual steps to get them.
There are some differences between the manual way and the C/SIDE way. Example: page controls symbols will have no associated type and query names might not resolve correctly. The reason being is that it is C/SIDE that owns the old compiler and have full knowledge of its internal AST's and symbol store. The SymbolReferenceGenerator works on the exported format which cannot provide the same support. Similar to just txt2Al versus exporttonewsyntax and then txt2al.

Manual symbol generation

  1. Export all your objects in a dedicated folder with finsql.
    finsql.exe command=ExportObjects,File=,ServerName=,Database=,Logfile=
    Optionally you could split the files per application objects with Split-NAVApplicationObjectFile (https://msdn.microsoft.com/en-us/library/dn789718(v=nav.90).aspx).
    Things below will be way faster.

  2. Use the Microsoft.Dynamics.Nav.SymbolReferenceGenerator.exe found in the same folder as your finslq.exe.
    Invoke the SymbolReferenceGenerator Application.app Application
    This should create an app package. The third parameter here is the package name and it is very important it is named Application.
    The version should match the version for the application version in the app.json

  3. Unpublish any Application symbols if you have any
    Unpublish-NAVApp -ServerInstance -Name Application -Version

  4. Publish symbols
    Publish-NAVApp -ServerInstance -PackageType SymbolsOnly -Path -SkipVerification
    The last flag is used if you do not have signed packages.

Then download symbols.
Cumbersome but hope it can help as a last resource.

@janhofmann24
Copy link
Author

Thanks for the tips.

In the meantime I pulled a docker image, made it work and managed to use the generatesymbol reference command finsql.exe
It only works though, if I start it from the host system. If I start it from the container command prompt, a process is started, but it uses next to no CPU time and makes no progress. it seems like it will basically run forever. Anyway, I got my Application symbols now :)

Now the next question is: Where do I get System symbols from? and what is it/what's the difference to the Application symbols?

[2017-11-17 15:52:53.30] The request for path /nav/dev/packages?publisher=Microsoft&appName=System&versionText=11.0.0.0 failed with code NotFound. Reason: No published package matches the provided arguments.
[2017-11-17 15:53:01.00] Could not download reference symbols. Please ensure that:

  1. The correct server name and instance are specified in the launch.json file.
  2. The correct application version is specified in the app.json file.

@kalberes
Copy link
Contributor

The System symbols should have been part of your Nav App table from the deployed database with docker. These are the symbols for the system/temporary tables used by the server. E.g. Object,
Application symbols are the symbols generated from your application objects. If you have used finsql to generate them you would see them in the Object Metadata table's Symbol Reference field.
There is also an Application symbol in the NAv App table. That is used as a backing base application object reference if you do not generate your own symbols from C/SIDE.
My manual system generation hints above would generate symbols like that.
One important note.
Please defer using C/SIDE symbol generation until we release the December update. There were some quite serious bugs fixed lately, that have unfortunately only made it to the December release and Nav 2018.
You will see issues with resolving symbols that would come across symbol names that would need quoting, which is the majority of the cases.

@janhofmann24
Copy link
Author

That's correct. The System symbols are available on the Cronus DB of the docker image, I have converted a Custom Database from Nav2017, so wondering how to get them there.

For my current purpose it seems okay though. I am just using the System symbols downloaded from the CRONUS Db.

@kalberes
Copy link
Contributor

When you have issued the .\finsql.exe Command=generatesymbolreference than your converted application's symbols are stored. The system symbols are controlled by us. You cannot change them. They should download automatically when you issue a download symbols from vscode. The uri to download symbols looks correct. Can you double check that in the Nav App table the System reference package has version 11?

@kalberes kalberes added input-needed investigate The issue requires further investigation to determine if this is a product bug labels Nov 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Apr 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
input-needed investigate The issue requires further investigation to determine if this is a product bug
Projects
None yet
Development

No branches or pull requests

3 participants