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

cadviewer 9.17.2 doesn't work at nextcloud 24.0.0 #71

Open
emoxam opened this issue Nov 22, 2023 · 22 comments
Open

cadviewer 9.17.2 doesn't work at nextcloud 24.0.0 #71

emoxam opened this issue Nov 22, 2023 · 22 comments

Comments

@emoxam
Copy link

emoxam commented Nov 22, 2023

Hello!

i am using nextcloud 24.0.0

I've installed cadviewer 9.17.2 via the apps section.

Uploaded the dwg file but i cannot find how to view it. I can only download it from my nextcloud.

Can you help me ?
Thanks

@emoxam
Copy link
Author

emoxam commented Nov 22, 2023

did a2enmod rewrite
it become better - with
RewriteCond %{REQUEST_FILENAME} !/apps/cadviewer/converter/php/.
RewriteRule . index.php [PT,E=PATH_INFO:$1]
i got "The user experience is that the canvas is white and the "loading.." modal will keep appearing on the screen when attempting to load a file." and "details" of dwg and other files shows "Error while loading the file data". No records at logs i found useful. What can i do anymore ? I do all at the https://github.com/CADViewer/NextCloud#4-troubleshooting - it doesn't help.

@CADViewer
Copy link
Owner

Hello @emoxam , with the RewriteCond set you should normally see the icons, etc. Have you done the permission setting of the CAD converter ax2023_L64_xx_yy_zz? If a drawing is not being converted this is typically the issue. Try and send the Conversion log, you find from the admin interface Api Conversion Log, or directly in the folder /nextcloud/apps/cadviewer/converter/php/call-Api_conversion_log.txt, the datestamp and content will list if the scripts is executed and the result. Also, if you open the browser developer console, Ctrl+Shift+I and send that trace as .txt, then we can see what the front-end sends to the backend.

@emoxam
Copy link
Author

emoxam commented Nov 23, 2023

Hello @CADViewer
Thanks for the answer, i'am out of ideas and almost lost the hope...

  1. root@nextcloud:/opt/nextcloud/apps/cadviewer/converter/converters/ax2024/linux# ls -l | grep ax2023_L64_23_12_120
    -rwxrwxrwx 1 www-data www-data 95025544 ноя 21 14:52 ax2023_L64_23_12_120

  2. Api log is attaching
    call-Api_Conversion_log.txt

  3. F12 - console - save as TXT ? Do I have to do this?

@emoxam
Copy link
Author

emoxam commented Nov 23, 2023

I take two blocks from /opt/nextcloud/apps/cadviewer/converter/nextcloud_AIO_sample.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_URI} \.dwg$
  RewriteRule ^remote/(.*) remote.php [QSA,L,NC,T=application/x-httpd-php-source,E=no_attachment:1]
  Header set Content-Disposition "inline" env=no_attachment
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
  RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

AddDefaultCharset utf-8
Options -Indexes
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

#ErrorDocument 403 //
#ErrorDocument 404 //

<IfModule mod_rewrite.c>
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|wasm|tflite)$
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update\.php
  RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon\.ico|manifest\.json)$
  RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status)\.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v(1|2)\.php
  RewriteCond %{REQUEST_FILENAME} !/robots\.txt
  RewriteCond %{REQUEST_FILENAME} !/(ocm-provider|ocs-provider|updater)/
  RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
  RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$
  RewriteCond %{REQUEST_FILENAME} !/apps/cadviewer/converter/php/*\.*
  RewriteRule . index.php [PT,E=PATH_INFO:$1]
#  RewriteBase /
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>

Should I have done it? Or these two should be enough ?

  RewriteCond %{REQUEST_FILENAME} !/apps/cadviewer/converter/php/*\.*
  RewriteRule . index.php [PT,E=PATH_INFO:$1]

@CADViewer
Copy link
Owner

@emoxam , so the converter is never executed, I noticed something above in RewriteCond settings , are you on ARM architecture? RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$

Our back-end converter is x86 , so it will not run on an ARM processor. Please let me know.

@emoxam
Copy link
Author

emoxam commented Nov 23, 2023

@CADViewer No, i'm on x86.

@emoxam
Copy link
Author

emoxam commented Nov 23, 2023

@CADViewer Did you read my messages ?

@CADViewer
Copy link
Owner

@emoxam , can you please open the browser developer console, Ctrl+Shift+I, capture the trace where you try to open a drawing, and send that trace as .txt, This will alow to see what the front-end sends to the back-end. You can also send a screenshot of your screen with CADViewer.

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

@CADViewer F12 - console - save as TXT ? Do I have to do this?

@CADViewer
Copy link
Owner

@emoxam , in the console trace, you can see which instructions CADViewer passes on to the server, there will be calls to the php endpoints to do various things, if you isolate those calls, or check the responses, you can see if the rewrite rule is in place, and you can see if there is any server action on the back-end converter, etc. To see the console .txt with traffic will give us some error messages to work with

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

@CADViewer
Copy link
Owner

image

@emoxam , I am not seeing anything in your trace. If you see this image, you will see that there in the console are statements containing CADViewer calls to the server.

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

Can you share default .htaccess with me ?

@CADViewer
Copy link
Owner

On Snap, Ubuntu 22.04 LTS , Nextcloud 7.1.3 , CADViewer v9.19.4

image

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

@CADViewer as a txt file please

@CADViewer
Copy link
Owner

CADViewer commented Nov 24, 2023

Snap install .htaccess instance:

# Section for Apache 2.4 to 2.6
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>
<IfModule mod_access_compat.c>
  Order Allow,Deny
  Deny from all
  Satisfy All
</IfModule>

# Section for Apache 2.2
<IfModule !mod_authz_core.c>
  <IfModule !mod_access_compat.c>
    <IfModule mod_authz_host.c>
      Order Allow,Deny
      Deny from all
    </IfModule>
    Satisfy All
  </IfModule>
</IfModule>

# Section for Apache 2.2 to 2.6
<IfModule mod_autoindex.c>
  IndexIgnore *
</IfModule>


<IfModule mod_rewrite_c>
 RewriteCond %{REQUEST_FILENAME} !/extra-apps/cadviewer/converter/php/*\.*
 RewriteRule . index.php [PT,E=PATH_INFO:$1]
<IfModule>

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

what is it ? After i installing CADViewer via the nextcloud there is a .htaccess on a few pages! Where is can get it without reinstalling CADViewer ?
/opt/nextcloud/.htaccess in my case

@CADViewer
Copy link
Owner

CADViewer does not change your .htaccess file on installation, .htaccess is a control file there is at the top level of a folder, typically it controls settings for an application at that folder, in your case /opt/nextcloud/.htaccess . Check, your rewrite rules in that folder. Basically if there is not a rewrite rule for the location of the CADViewer php scripts, then the front-end CADViewer will not be able to build the menus in cadviewer, nor will it be able to make conversions.

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

You are right, don't you have default nextcloud .htaccess ? i deleted mine...
Or is it it https://github.com/nextcloud/server/blob/master/.htaccess ?

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

@CADViewer Ok. I am using this one now https://github.com/nextcloud/server/blob/master/.htaccess
i added two strings, so it look like

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteCond %{REQUEST_FILENAME} !/apps/cadviewer/converter/php/.
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
  RewriteRule ^ocm-provider/?$ index.php [QSA,L]
  RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
  RewriteRule . index.php [PT,E=PATH_INFO:$1]
</IfModule>

i do
systemctl restart apache2

i refresh my nextcloud page
and i see loading that never ends. md files don't opens too.
if i commented

  RewriteCond %{REQUEST_FILENAME} !/apps/cadviewer/converter/php/.
  RewriteRule . index.php [PT,E=PATH_INFO:$1]

and restarted my apache
al become good.
Here's logs

call-Api_Conversion_log (2).txt
nextcloud.integris.ru-1700824513149.log

@CADViewer
Copy link
Owner

so the log from nextcloud.integris.ru still does not contain any listing from cadviewer, so it's like you are not selecting any dwg files in the file manager, also the call-Api_Conversion_log.txt is an old trace, so you are not firing off any conversions. (which is clear because you have nothing in the nextcloud.integris.ru trace)

@emoxam
Copy link
Author

emoxam commented Nov 24, 2023

@CADViewer Is it because of vesrions?
i am using nextcloud 24.0.0
I've installed cadviewer 9.17.2 via the apps section.

Or it's because i am using nginx reverse proxy ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants