Error when trying to save a diagram - drawing manager keeps loading #4472

Closed
opened 2026-02-05 08:57:24 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @lvg-cm on GitHub (Feb 19, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Create a new page, add a diagram, add e.g. a circle to the diagram and then click save.
Error is displayed: An error occured uploading the image.
When I open dev-tools, it shows me the following errors:
image

On the filesystem I cannot find any diagram in ...\bookstack\public\uploads

When I try again to create a diagram, I get the question Unsaved drawing data was found from a previous failed drawing save attempt. Would you like to restore and continue editing this unsaved drawing?
If I click continue, it does show the previously created diagram.

Secondly, if I open the diagram manager, it keeps loading.
When I open dev-tools, it shows me the following errors:
image

Adding and selecting images does seem to work:

  • I can open the image gallery and it will show me all added images.
  • When double clicking on an image, it will get added to the page (there is no "Select image" button though.)

However, if I open dev-tools in my browser, it will also show errors:
image
On the filesystem I do find the uploaded images in ...\bookstack\public\uploads\images\gallery\2024-02

Exact BookStack Version

v23.12.1

Log Content

No error written to the laravel logfile

Hosting Environment

Windows Server 2022 Standard Edition (21H2)
IIS 10.0.20348.1
PHP Manager - PHP 8.3.2
MySQL Community Edition 8.0.32

Originally created by @lvg-cm on GitHub (Feb 19, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario Create a new page, add a diagram, add e.g. a circle to the diagram and then click save. Error is displayed: An error occured uploading the image. When I open dev-tools, it shows me the following errors: ![image](https://github.com/BookStackApp/BookStack/assets/160477390/640bb506-7fb9-4482-a0ab-de07b9534434) On the filesystem I cannot find any diagram in ...\bookstack\public\uploads When I try again to create a diagram, I get the question _Unsaved drawing data was found from a previous failed drawing save attempt. Would you like to restore and continue editing this unsaved drawing?_ If I click continue, it does show the previously created diagram. Secondly, if I open the diagram manager, it keeps loading. When I open dev-tools, it shows me the following errors: ![image](https://github.com/BookStackApp/BookStack/assets/160477390/335cec22-d05f-4ddc-a700-61f85a53ab38) Adding and selecting images does seem to work: - I can open the image gallery and it will show me all added images. - When double clicking on an image, it will get added to the page (there is no "Select image" button though.) However, if I open dev-tools in my browser, it will also show errors: ![image](https://github.com/BookStackApp/BookStack/assets/160477390/75274903-1dc9-445f-a74e-fe72cadd17ef) On the filesystem I do find the uploaded images in ...\bookstack\public\uploads\images\gallery\2024-02 ### Exact BookStack Version v23.12.1 ### Log Content No error written to the laravel logfile ### Hosting Environment Windows Server 2022 Standard Edition (21H2) IIS 10.0.20348.1 PHP Manager - PHP 8.3.2 MySQL Community Edition 8.0.32
OVERLORD added the 🐕 Support label 2026-02-05 08:57:24 +03:00
Author
Owner

@lvg-cm commented on GitHub (Feb 19, 2024):

I wonder if it has something to do with the url rewriting rules I used (got them from https://www.reddit.com/r/BookStack/comments/yqvg64/installing_bookstack_on_iis_10_windows_server_2016/)

Here is the bookstack web.config:

<configuration>
  <system.webServer>
	<rewrite>
		<rewriteMaps>
				<rewriteMap name="{REQUEST_FILENAME}" />
		</rewriteMaps>
		<rules>
					<clear />
					<rule name="Rule 1" enabled="true" stopProcessing="true">
						<match url="^(.*)$" />
						<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
							<add input="{R:1}" matchType="Pattern" pattern="^(index\.php|images|css|js|favicon\.ico)" ignoreCase="true" negate="true" />
							<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
							<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
						</conditions>
						<action type="Rewrite" url="./index.php/{R:1}" />
					</rule>
					<rule name="Rule 2" enabled="true" stopProcessing="true">
						<match url="^$" />
						<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
							<add input="{URL}" pattern="(.*/bookstack)$" />
						</conditions>
						<action type="Redirect" url="index.php" />
					</rule>
					<rule name="Rule 2bis" enabled="true" stopProcessing="true">
						<match url="(^/*)(.*$)" />
						<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
							<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
							<add input="{URL}" pattern="(\/images\/gallery)(.*)" />
						</conditions>
						<action type="Rewrite" appendQueryString="true" url="index.php/uploads{C:0}" />
					</rule>
					<rule name="Rule 3" enabled="true" stopProcessing="true">
						<match url="(^/*)(.*$)" ignoreCase="false" />
						<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
							<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
							<add input="{R:0}" pattern="(index\\.php|images|css|js|favicon\\.ico)" negate="true" />
						</conditions>
						<action type="Rewrite" url="index.php/{R:1}" />
					</rule>
		</rules>
		</rewrite>
		<directoryBrowse enabled="false" />
		<defaultDocument enabled="false">
			<files>
				<add value="index.php" />
				<add value="index" />
			</files>
		</defaultDocument>
	</system.webServer>
</configuration>
@lvg-cm commented on GitHub (Feb 19, 2024): I wonder if it has something to do with the url rewriting rules I used (got them from https://www.reddit.com/r/BookStack/comments/yqvg64/installing_bookstack_on_iis_10_windows_server_2016/) Here is the bookstack web.config: ``` <configuration> <system.webServer> <rewrite> <rewriteMaps> <rewriteMap name="{REQUEST_FILENAME}" /> </rewriteMaps> <rules> <clear /> <rule name="Rule 1" enabled="true" stopProcessing="true"> <match url="^(.*)$" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{R:1}" matchType="Pattern" pattern="^(index\.php|images|css|js|favicon\.ico)" ignoreCase="true" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="./index.php/{R:1}" /> </rule> <rule name="Rule 2" enabled="true" stopProcessing="true"> <match url="^$" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{URL}" pattern="(.*/bookstack)$" /> </conditions> <action type="Redirect" url="index.php" /> </rule> <rule name="Rule 2bis" enabled="true" stopProcessing="true"> <match url="(^/*)(.*$)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{URL}" pattern="(\/images\/gallery)(.*)" /> </conditions> <action type="Rewrite" appendQueryString="true" url="index.php/uploads{C:0}" /> </rule> <rule name="Rule 3" enabled="true" stopProcessing="true"> <match url="(^/*)(.*$)" ignoreCase="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{R:0}" pattern="(index\\.php|images|css|js|favicon\\.ico)" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:1}" /> </rule> </rules> </rewrite> <directoryBrowse enabled="false" /> <defaultDocument enabled="false"> <files> <add value="index.php" /> <add value="index" /> </files> </defaultDocument> </system.webServer> </configuration> ```
Author
Owner

@ssddanbrown commented on GitHub (Feb 19, 2024):

Do you need to use those rewrite rules? The linked reddit post was from someone using BookStack on a sub-path/folder which can complicate things, whereas (AFAICT) you're just on a domain/subdomain which is simpler.

BookStack does provide some of its own simpler rules: https://github.com/BookStackApp/BookStack/blob/development/public/web.config

Although to be honest these aren't really tested in regard to BookStack, since we don't have IIS testing environments.

@ssddanbrown commented on GitHub (Feb 19, 2024): Do you need to use those rewrite rules? The linked reddit post was from someone using BookStack on a sub-path/folder which can complicate things, whereas (AFAICT) you're just on a domain/subdomain which is simpler. BookStack does provide some of its own simpler rules: https://github.com/BookStackApp/BookStack/blob/development/public/web.config Although to be honest these aren't really tested in regard to BookStack, since we don't have IIS testing environments.
Author
Owner

@lvg-cm commented on GitHub (Feb 19, 2024):

Hi, thx for pointing me back to it. I did try it and at first the original web.config didn't work. Then I tried all steps from the reddit post, which made pages and images available.

I have now put back the original web.config file again and everything seems to work fine now. Most error messages are gone as well in dev-tools.
Thanks a lot!

@lvg-cm commented on GitHub (Feb 19, 2024): Hi, thx for pointing me back to it. I did try it and at first the original web.config didn't work. Then I tried all steps from the reddit post, which made pages and images available. I have now put back the original web.config file again and everything seems to work fine now. Most error messages are gone as well in dev-tools. Thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4472